Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1686562

Summary: when the last vm of a network in a compute in migrated with DVR enable, the qrouter namespace is not deleted
Product: Red Hat OpenStack Reporter: Candido Campos <ccamposr>
Component: openstack-neutronAssignee: Slawek Kaplonski <skaplons>
Status: CLOSED ERRATA QA Contact: Candido Campos <ccamposr>
Severity: medium Docs Contact:
Priority: medium    
Version: 14.0 (Rocky)CC: amuller, bcafarel, chrisw, njohnston, scohen
Target Milestone: z4Keywords: Triaged, ZStream
Target Release: 14.0 (Rocky)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-neutron-13.0.4-0.20190508213450.de95bc6.el7ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-11-06 16:50:27 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Candido Campos 2019-03-07 17:19:11 UTC
Description of problem:
when the last vm of a network in a compute in migrated with DVR enable, the qrouter namespace is not deleted 

Version-Release number of selected component (if applicable):
OSP14

How reproducible:
 test bed with 2 or more computes

 Deploy a network with a distributed router and a vm

Steps to Reproduce:
1. Migrate the vm


Actual results:
The qrouter is not deleted in the compute when the vm is created when it is migrated.

Expected results:
 the qrouter shoud be deleted

Additional info:

overcloud) [stack@undercloud-0 ~]$ openstack server show a59815b1-9b5b-4d2f-a0f3-16b99b1c82ea
+-------------------------------------+----------------------------------------------------------+
| Field                               | Value                                                    |
+-------------------------------------+----------------------------------------------------------+
| OS-DCF:diskConfig                   | MANUAL                                                   |
| OS-EXT-AZ:availability_zone         | nova                                                     |
| OS-EXT-SRV-ATTR:host                | compute-0.localdomain                                    |
| OS-EXT-SRV-ATTR:hypervisor_hostname | compute-0.localdomain                                    |
| OS-EXT-SRV-ATTR:instance_name       | instance-00000089                                        |
| OS-EXT-STS:power_state              | Running                                                  |
| OS-EXT-STS:task_state               | migrating                                                |
| OS-EXT-STS:vm_state                 | active                                                   |
| OS-SRV-USG:launched_at              | 2019-03-07T16:19:10.000000                               |
| OS-SRV-USG:terminated_at            | None                                                     |
| accessIPv4                          |                                                          |
| accessIPv6                          |                                                          |
| addresses                           | selfservice=10.1.0.12, 10.0.0.215                        |
| config_drive                        |                                                          |
| created                             | 2019-03-07T16:18:55Z                                     |
| flavor                              | cirros (0)                                               |
| hostId                              | 3a082c033f4bff7bb267aee72ed3cd36bfb670f164ae37e3ab5a65f6 |
| id                                  | a59815b1-9b5b-4d2f-a0f3-16b99b1c82ea                     |
| image                               | cirros (10fb27dc-7894-4fc1-95ec-443b74077a73)            |
| key_name                            | mykey                                                    |
| name                                | provider-instance3                                       |
| progress                            | 0                                                        |
| project_id                          | 0dcb502bdb6f4f3683c51557b443168e                         |
| properties                          |                                                          |
| security_groups                     | name='default'                                           |
| status                              | MIGRATING                                                |
| updated                             | 2019-03-07T16:24:06Z                                     |
| user_id                             | 47bb2cdfa9734038a2a3f2e5cc1876e6                         |
| volumes_attached                    |                                                          |
+-------------------------------------+----------------------------------------------------------+



[root@compute-0 heat-admin]# virsh list 
 Id    Name                           State
----------------------------------------------------
 14    instance-00000089              running

[root@compute-0 heat-admin]# ip nentns 
Object "nentns" is unknown, try "ip help".
[root@compute-0 heat-admin]# ip netns 
qrouter-80ef0dfc-ca3c-4e7c-8db4-e8982cc7699a (id: 0)
fip-edda7853-cf14-4856-9850-afd04c8e2e13 (id: 1)
[root@compute-0 heat-admin]# ip nentns 


(overcloud) [stack@undercloud-0 ~]$ nova live-migration a59815b1-9b5b-4d2f-a0f3-16b99b1c82ea

(overcloud) [stack@undercloud-0 ~]$ openstack server show a59815b1-9b5b-4d2f-a0f3-16b99b1c82ea
+-------------------------------------+----------------------------------------------------------+
| Field                               | Value                                                    |
+-------------------------------------+----------------------------------------------------------+
| OS-DCF:diskConfig                   | MANUAL                                                   |
| OS-EXT-AZ:availability_zone         | nova                                                     |
| OS-EXT-SRV-ATTR:host                | compute-2.localdomain                                    |
| OS-EXT-SRV-ATTR:hypervisor_hostname | compute-2.localdomain                                    |
| OS-EXT-SRV-ATTR:instance_name       | instance-00000089                                        |
| OS-EXT-STS:power_state              | Running                                                  |
| OS-EXT-STS:task_state               | None                                                     |
| OS-EXT-STS:vm_state                 | active                                                   |
| OS-SRV-USG:launched_at              | 2019-03-07T16:19:10.000000                               |
| OS-SRV-USG:terminated_at            | None                                                     |
| accessIPv4                          |                                                          |
| accessIPv6                          |                                                          |
| addresses                           | selfservice=10.1.0.12, 10.0.0.215                        |
| config_drive                        |                                                          |
| created                             | 2019-03-07T16:18:55Z                                     |
| flavor                              | cirros (0)                                               |
| hostId                              | de406aa667510aae422503b79d80663cd48c126a810292af891404d5 |
| id                                  | a59815b1-9b5b-4d2f-a0f3-16b99b1c82ea                     |
| image                               | cirros (10fb27dc-7894-4fc1-95ec-443b74077a73)            |
| key_name                            | mykey                                                    |
| name                                | provider-instance3                                       |
| progress                            | 0                                                        |
| project_id                          | 0dcb502bdb6f4f3683c51557b443168e                         |
| properties                          |                                                          |
| security_groups                     | name='default'                                           |
| status                              | ACTIVE                                                   |
| updated                             | 2019-03-07T16:24:18Z                                     |
| user_id                             | 47bb2cdfa9734038a2a3f2e5cc1876e6                         |
| volumes_attached                    |                                                          |
+-------------------------------------+----------------------------------------------------------+

[root@compute-0 heat-admin]# virsh list
 Id    Name                           State
----------------------------------------------------

[root@compute-0 heat-admin]# ip netns
qrouter-80ef0dfc-ca3c-4e7c-8db4-e8982cc7699a (id: 0)
fip-edda7853-cf14-4856-9850-afd04c8e2e13 (id: 1)
[root@compute-0 heat-admin]#

Comment 1 Slawek Kaplonski 2019-04-18 10:40:37 UTC
It looks like this issue is caused by multiple port binding feature. It happens like that because in https://github.com/openstack/neutron/blob/c21d922abd1208a72fe64d404a8eab93e0c56870/neutron/db/l3_dvrscheduler_db.py#L438 port is still visible on old host as INACTIVE. But ports in such state aren't filtered out from the list, so there is still serviceable port on old host and there is no any router to remove found.

I need to confirm it on OSP-13 but it looks like it is an regression in OSP-14

Comment 2 Slawek Kaplonski 2019-05-21 06:23:05 UTC
Patch merged u/s https://review.opendev.org/#/c/657556/

Comment 10 errata-xmlrpc 2019-11-06 16:50:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2019:3750