Port is unbound from a compute node, the DVR scheduler needs to check whether the router can be deleted on the L3-agent

Bug #1489183 reported by Stephen Ma
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Expired
Undecided
Unassigned

Bug Description

In my environment where there is a compute node and a controller node. On the compute node the L3-agent mode is 'dvr' on the controller node the L3-agent mode is 'dvr-snat'. Nova-compute is only running on the compute node.

Start: the compute node has no VMs running, there are no namespaces on the compute node.

1. Created a network and a router
   neutron net-create demo-net
   neutron subnet-create sb-demo-net demo-net 10.1.2.0/24
   neutron router-create demo-router
   neutron router-interface-add demo-router sb-demo-net
   neutron router-gateway-set demo-router public

my-net's UUID is 0d3f0103-43e9-45a2-8ca2-b29700039297
my-router's UUID is 1bbfafde-b1d4-4752-9dd0-4b23bbeca22b

2. Created a port:
stack@Dvr-Ctrl2:~/DEVSTACK/demo$ neutron port-create demo-net
The port's UUID is 278743d7-b057-4797-8b2b-faaf5fe13a4a

Note: the port is not associated with a floating IP.

3. Boot up a VM using the port:
nova boot --flavor 1 --image <IMAGE_UUID> --nic port-id=278743d7-b057-4797-8b2b-faaf5fe13a4a demo-p11vm01

Wait for the VM to come up on the compute node.

4. Deleted the VM.

5. The port still exists and is now unbound from the compute node (device owner and binding:host_id are now None):
stack@Dvr-Ctrl2:~/DEVSTACK/demo$ ../manage/osadmin neutron port-show 278743d7-b057-4797-8b2b-faaf5fe13a4a
+-----------------------+---------------------------------------------------------------------------------+
| Field | Value |
+-----------------------+---------------------------------------------------------------------------------+
| admin_state_up | True |
| allowed_address_pairs | |
| binding:host_id | |
| binding:profile | {} |
| binding:vif_details | {} |
| binding:vif_type | unbound |
| binding:vnic_type | normal |
| device_id | |
| device_owner | |
| extra_dhcp_opts | |
| fixed_ips | {"subnet_id": "b45d41ca-134f-4274-bb05-50fab100315e", "ip_address": "10.1.2.4"} |
| id | 278743d7-b057-4797-8b2b-faaf5fe13a4a |
| mac_address | fa:16:3e:a6:f7:d1 |
| name | |
| network_id | 0d3f0103-43e9-45a2-8ca2-b29700039297 |
| port_security_enabled | True |
| security_groups | 8b68d1c9-cae7-4f0b-8fb5-6adb5a515246 |
| status | DOWN |
| tenant_id | a7950bd5a61548ee8b03145cacf90a53 |
+-----------------------+---------------------------------------------------------------------------------+

The Router is still scheduled on the compute node.

stack@Dvr-Ctrl2:~/DEVSTACK/demo$ ../manage/osadmin neutron l3-agent-list-hosting-router 1bbfafde-b1d4-4752-9dd0-4b23bbeca22b
+--------------------------------------+-------------+----------------+-------+----------+
| id | host | admin_state_up | alive | ha_state |
+--------------------------------------+-------------+----------------+-------+----------+
| 2fc1f65b-4c05-4cec-95eb-93dda39a6eec | Dvr-Ctrl2 | True | :-) | |
| dae065fb-b140-4ece-8824-779cf6426337 | DVR-Compute | True | :-) | |
+--------------------------------------+-------------+----------------+-------+----------+

When the port is unbound, the router should no longer be scheduled on the compute node as it is no longer needed on the compute node. The reason is that when the port is no longer bound to the compute node, the DVR scheduler didn't check whether the router can be removed from an L3-agent.

Revision history for this message
guiyanxing (guiyanxing) wrote :

what's your enviroment ? while in my enviroment,folowing your steps,it's ok!

when the vm is booted,the router is scheduled on the compute node:
[root@controller-kilo ~]# neutron l3-agent-list-hosting-router demo-router
+--------------------------------------+------------------------+----------------+-------+----------+
| id | host | admin_state_up | alive | ha_state |
+--------------------------------------+------------------------+----------------+-------+----------+
| 0ad9782a-2d73-4cf0-9f5a-8762fe312516 | compute-kilo-1 | True | :-) | |
| af482f32-9fd5-43e0-9403-fc49099c5434 | network-kilo.novalocal | True | :-) | |
+--------------------------------------+------------------------+----------------+-------+----------+

when the vm is deleted,the router is not scheduled on the compute node:

[root@controller-kilo ~]# neutron l3-agent-list-hosting-router demo-router
+--------------------------------------+------------------------+----------------+-------+----------+
| id | host | admin_state_up | alive | ha_state |
+--------------------------------------+------------------------+----------------+-------+----------+
| af482f32-9fd5-43e0-9403-fc49099c5434 | network-kilo.novalocal | True | :-) | |
+--------------------------------------+------------------------+----------------+-------+----------+

Revision history for this message
Stephen Ma (stephen-ma) wrote :

This problem is fixed by https://review.openstack.org/#/c/219067. The bug # is wrong in the patch's commit text.

Revision history for this message
Armando Migliaccio (armando-migliaccio) wrote :

This bug is > 240 days without activity. We are unsetting assignee and milestone and setting status to Incomplete in order to allow its expiry in 60 days.

If the bug is still valid, then update the bug status.

Changed in neutron:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for neutron because there has been no activity for 60 days.]

Changed in neutron:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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