DVR router namespaces are deleted when we manually move a DVR router from one SNAT_node to another SNAT_node even though there are active VMs in the node

Bug #1564575 reported by Swaminathan Vasudevan on 2016-03-31
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Medium
Swaminathan Vasudevan

Bug Description

DVR router namespaces are deleted when we manually move the router from on dvr_snat node to another dvr_snat node.

It should be only deleting the snat_namespace and not the router_namespace, since there are 'dhcp' ports and 'vm' ports still serviced by DVR.

How to reproduce:

Configure a two node setup:

1. I have one node with Controller, compute and networking node with dhcp running in dvr_snat mode.
2. I have another node with compute and networking node without dhcp running in dvr_snat mode.
3. Now create network
4. Create a subnet
5. Create a router and attach the subnet to the router.
6. Also set a gateway to the router.
7. Now you should see that there are three namespaces in the first node.
    a. snat_namespace
    b. qrouter_namespace
    c. dhcp_namespace
8. Now create a VM on the first node.
9. Now try to remove the router from the first agent and assign it to the second agent in the second node.
    neutron l3-agent-router-remove agent-id router-id

This currently removes both the snat_namespace and the router_namespace when there is still a valid vm and dhcp port.

Suspect that checking for available DVR service ports might be causing an issue here.

Will try to find out the root cause.

summary: DVR router namespaces are deleted when we manually move a DVR router
- from one SNAT_node to another SNAT_node even though that are active VMs
+ from one SNAT_node to another SNAT_node even though there are active VMs
in the node

 Remove_router_from_l3_agent was overriden before with different actions based on the binding table, since we restricted the binding table to one, this might not be possible.

This was added by the patch.
https://review.openstack.org/#/c/122024/51

 + def remove_router_from_l3_agent(self, context, agent_id, router_id):
 + router = self.get_router(context, router_id)
 + if router['external_gateway_info'] and router.get('distributed'):
 + binding = self.unbind_snat(context, router_id, agent_id=agent_id)
 + if binding:
 + notification_not_sent = self.unbind_router_servicenode(context,
 + router_id, binding)
 + if notification_not_sent:
 + self.l3_rpc_notifier.routers_updated(
 + context, [router_id], schedule_routers=False)
 + else:
 + super(L3_DVRsch_db_mixin,
 + self).remove_router_from_l3_agent(
 + context, agent_id, router_id)

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

Changed in neutron:
assignee: nobody → Swaminathan Vasudevan (swaminathan-vasudevan)
status: New → In Progress
Changed in neutron:
assignee: Swaminathan Vasudevan (swaminathan-vasudevan) → Brian Haley (brian-haley)
Changed in neutron:
importance: Undecided → Medium
Changed in neutron:
assignee: Brian Haley (brian-haley) → Swaminathan Vasudevan (swaminathan-vasudevan)
Changed in neutron:
assignee: Swaminathan Vasudevan (swaminathan-vasudevan) → Oleg Bondarev (obondarev)
Changed in neutron:
assignee: Oleg Bondarev (obondarev) → Swaminathan Vasudevan (swaminathan-vasudevan)

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

commit c198710dc551bc0f79851a7801038b033088a8c2
Author: Swaminathan Vasudevan <email address hidden>
Date: Thu Mar 31 17:48:09 2016 -0700

    DVR: Moving router from dvr_snat node removes the qrouters

    Removing the router from dvr_snat node removes the qrouters
    that are servicing the VM and dhcp ports.

    If there are still dvr serviceable ports in the dvr_snat node,
    and if router remove command is executed to remove the router
    association from the dvr_snat agent then only the snat
    functionality should be moved to the the different agent
    and the router namespaces should be untouched.

    This patch checks if there are any dvr serviceable ports for
    the dvr router and if exists, it will not send a router_remove
    message to the agent, but instead will send an router_update
    message to the agent.

    Change-Id: I5a3ba329346ab0d5ea7b0296ec64cc8e5fb4056d
    Closes-Bug: #1564575

Changed in neutron:
status: In Progress → Fix Released

Reviewed: https://review.openstack.org/319397
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=1f444899ca225846ac54ed9e33e112a30cc8bc0f
Submitter: Jenkins
Branch: stable/mitaka

commit 1f444899ca225846ac54ed9e33e112a30cc8bc0f
Author: Swaminathan Vasudevan <email address hidden>
Date: Thu Mar 31 17:48:09 2016 -0700

    DVR: Moving router from dvr_snat node removes the qrouters

    Removing the router from dvr_snat node removes the qrouters
    that are servicing the VM and dhcp ports.

    If there are still dvr serviceable ports in the dvr_snat node,
    and if router remove command is executed to remove the router
    association from the dvr_snat agent then only the snat
    functionality should be moved to the the different agent
    and the router namespaces should be untouched.

    This patch checks if there are any dvr serviceable ports for
    the dvr router and if exists, it will not send a router_remove
    message to the agent, but instead will send an router_update
    message to the agent.

    Change-Id: I5a3ba329346ab0d5ea7b0296ec64cc8e5fb4056d
    Closes-Bug: #1564575
    (cherry picked from commit c198710dc551bc0f79851a7801038b033088a8c2)

tags: added: in-stable-mitaka

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

This issue was fixed in the openstack/neutron 8.1.2 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers