SNAT interface not created for dvrha in some scenarios

Bug #1571113 reported by Adolfo Duarte
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Medium
Adolfo Duarte

Bug Description

branch: master
commit: 4e3a9c2b9c0ada6c2a471d24a20927aa8e8f5740

Depending on the order neutron router commands are given, the snat interface for a dvrha router on the dvr_snat agent might not get created.

look at following interaction:

--create a couple of network and subnets we will use (public and private)
neutron net-create public --router:external
neutron subnet-create public 192.168.201.0/24 --disable_dhcp
neutron net-create n1
neutron subnet-create n1 101.0.0.0/24 --name s1

-- now we create and attach router in particular order: first set external gateway and then attach private subnet.

neutron router-create dvrha --distributed=True --ha=True
neutron router-gateway-set dvrha public
neutron router-interface-add dvrha s1

neutron router-port-list dvrha -c fixed_ips
+--------------------------------------------------------------------------------------+
| fixed_ips |
+--------------------------------------------------------------------------------------+
| {"subnet_id": "b4a81968-8a08-4054-985f-e4e1cf687945", "ip_address": "101.0.0.3"} |
| {"subnet_id": "b4a81968-8a08-4054-985f-e4e1cf687945", "ip_address": "101.0.0.1"} |
| {"subnet_id": "782574e8-fabb-41da-a1a0-9817994ec0a5", "ip_address": "169.254.192.2"} |
| {"subnet_id": "782574e8-fabb-41da-a1a0-9817994ec0a5", "ip_address": "169.254.192.3"} |
| {"subnet_id": "0173f29d-746d-45a1-ad10-16dde529eb34", "ip_address": "192.168.201.4"} |
| {"subnet_id": "782574e8-fabb-41da-a1a0-9817994ec0a5", "ip_address": "169.254.192.1"} |

*** as you can see there are two interfaces on subnet 101/24: 101.0.0.3, and 101.0.0.1, one is the router interface the other is the snat interface
THIS IS CORRECT BEHAVIOR

*** next we change the order of the commands:
-- first clean up
neutron router-interface-delete dvrha s1
neutron router-gateway-clear dvrha
neutron router-delete dvrha

-- This time, we add the internal interface before setting the external gateway. (reverse order of steps)

neutron router-create dvrha --distributed=True --ha=True
neutron router-interface-add dvrha s1
neutron router-gateway-set dvrha public
neutron router-port-list dvrha -c fixed_ips
+--------------------------------------------------------------------------------------+
| fixed_ips |
+--------------------------------------------------------------------------------------+
| {"subnet_id": "0173f29d-746d-45a1-ad10-16dde529eb34", "ip_address": "192.168.201.7"} |
| {"subnet_id": "e9c7148e-04e5-4343-ac66-ac1651514b88", "ip_address": "169.254.192.1"} |
| {"subnet_id": "b4a81968-8a08-4054-985f-e4e1cf687945", "ip_address": "101.0.0.1"} |
| {"subnet_id": "e9c7148e-04e5-4343-ac66-ac1651514b88", "ip_address": "169.254.192.2"} |
+--------------------------------------------------------------------------------------+

*** this time the snat interface is NOT created.
-- we can fix this by toggling the internal subnet connection to the router:
 neutron router-interface-delete dvrha s1
Removed interface from router dvrha.
neutron router-interface-add dvrha s1
Added interface c3cb410d-08a0-46a5-84fb-ec7bbead4eb3 to router dvrha.
neutron router-port-list dvrha -c fixed_ips
+--------------------------------------------------------------------------------------+
| fixed_ips |
+--------------------------------------------------------------------------------------+
| {"subnet_id": "0173f29d-746d-45a1-ad10-16dde529eb34", "ip_address": "192.168.201.7"} |
| {"subnet_id": "e9c7148e-04e5-4343-ac66-ac1651514b88", "ip_address": "169.254.192.1"} |
| {"subnet_id": "b4a81968-8a08-4054-985f-e4e1cf687945", "ip_address": "101.0.0.5"} |
| {"subnet_id": "b4a81968-8a08-4054-985f-e4e1cf687945", "ip_address": "101.0.0.1"} |
| {"subnet_id": "e9c7148e-04e5-4343-ac66-ac1651514b88", "ip_address": "169.254.192.2"} |

now the snat port is created (101.0.0.5)

Assaf Muller (amuller)
tags: added: l3-dvr-backlog l3-ha
Changed in neutron:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/307526

Changed in neutron:
assignee: nobody → Adolfo Duarte (adolfo-duarte)
status: Confirmed → In Progress
tags: added: mitaka-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/307526
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=88a1a8cfe9d9d5bc8b0e7ff0040f28c3d3caaaa5
Submitter: Jenkins
Branch: master

commit 88a1a8cfe9d9d5bc8b0e7ff0040f28c3d3caaaa5
Author: Adolfo Duarte <email address hidden>
Date: Fri Apr 15 07:45:38 2016 -0700

    DVRHA interfaces should be created in all cases.

    Interfaces owned by dvrha routers need to follow
    the device owner naming convention of dvr routers.
    Otherwise interfaces will not be created appropriately.

    Closes-Bug: #1571113

    Change-Id: I3a1fbd2d028b7caf0b2b8824c9c1d4e5eb9560f5

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/neutron 9.0.0.0b1

This issue was fixed in the openstack/neutron 9.0.0.0b1 development milestone.

tags: added: liberty-backport-potential
tags: added: neutron-proactive-backport-potential
Revision history for this message
Brian Haley (brian-haley) wrote :

This change depends on https://review.openstack.org/#/c/291651/ - but that has a contract migration of the DB.

tags: removed: neutron-proactive-backport-potential
Revision history for this message
Ihar Hrachyshka (ihar-hrachyshka) wrote :

As per Brian's comment, we can't backport the fix.

tags: removed: liberty-backport-potential
tags: removed: mitaka-backport-potential
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.