qrouter ns leak while last service port delete because of router gw port
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Fix Released
|
Medium
|
Krzysztof Tomaszewski |
Bug Description
While removing last port from the subnet on compute host with DVR then L3 agent is cleaning unneeded qrouter-* namespaces.
When you have a different (even other user) VM on the same host that has port
from the subnet that your router has a gateway then deleting of qrouter namespaces is not triggered.
Scenario to reproduce:
Two instances multinode devstack master; no dhcp agent (for simplicity);
devstack default DVR router preconfiguration (public net as a default GW, private net as a subnet);
two nodes:
- devstack1 - dvr_snat node,
- devstack2 - dvr node
1) create a VM with private network on devstack2 node as a demo user:
(demo)$ openstack server create --net private --flavor cirros256 --image cirros-
(demo)$ openstack server show test_private -c id
+------
| Field | Value |
+------
| id | 7e5bebfd-
+------
(demo)$ openstack port list --device-id 7e5bebfd-
+------
| ID |
+------
| d359efe3-
+------
There is proper tap interface and L3 agent creates qrouter-* namespace:
stack@devstack2:~/$ sudo ip netns | grep qr
qrouter-
stack@devstack2:~/$ ip a | grep d359
28: tapd359efe3-80: <BROADCAST,
stack@devstack2:~$ sudo ovs-vsctl get port tapd359efe3-80 tag
4
stack@devstack2:~$ sudo ovs-vsctl --format=table --columns=name,tag find port tag=4
name tag
-------------- ---
qr-c3ae7e60-aa 4
qr-7f7c0893-f7 4
tapd359efe3-80 4
2) create a VM with public network on devstack2 node as an admin user:
(admin)$ openstack server create --net public --flavor cirros256 --image cirros-
(admin)$ openstack server show test_public -c OS-EXT-
+------
| Field | Value |
+------
| OS-EXT-
| OS-EXT-
| OS-EXT-STS:vm_state | active |
| id | 0622fd62-
+------
(admin)$ openstack port list --device-id 0622fd62-
+------
| ID |
+------
| dc822c75-
+------
stack@devstack2:~$ ip a | grep dc8
14: tapdc822c75-71: <BROADCAST,
3) delete demo user test_private VM
(demo)$ openstack server delete test_private
VM is deleted but qrouter-* namespaces stays.
One VM only exist (admin's one):
stack@devstack2:~$ sudo virsh list --all
Id Name State
-------
2 instance-00000007 running
stack@devstack2:~$ sudo ip netns | grep qr
qrouter-
stack@devstack2:~$
stack@devstack2:~$ sudo ovs-vsctl --format=table --columns=name,tag find port tag=4
name tag
-------------- ---
qr-c3ae7e60-aa 4
qr-7f7c0893-f7 4
To clear this namespace you need to full resync L3 agent by agent restart or by disabling/enabling agent:
(admin)$ openstack network agent list --host devstack2 --agent-type l3 -c ID -c Host
+------
| ID | Host |
+------
| 77b01aa0-
+------
(admin)$ openstack network agent set --disable 77b01aa0-
(admin)$ openstack network agent set --enable 77b01aa0-
and qrouter-* namespace disappear:
stack@devstack2:~$ sudo ip netns | grep qr
stack@devstack2:~$ sudo ovs-vsctl --format=table --columns=name,tag find port tag=4
name tag
---- ---
stack@devstack2:~$
description: | updated |
description: | updated |
description: | updated |
Changed in neutron: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in neutron: | |
status: | Confirmed → In Progress |
Changed in neutron: | |
status: | In Progress → Fix Released |
fix proposed: https:/ /review. opendev. org/c/openstack /neutron/ +/824008