Port is unbound from a compute node, the DVR scheduler needs to check whether the router can be deleted on the L3-agent
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-
neutron router-gateway-set demo-router public
my-net's UUID is 0d3f0103-
my-router's UUID is 1bbfafde-
2. Created a port:
stack@Dvr-
The port's UUID is 278743d7-
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=
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-
+------
| Field | Value |
+------
| admin_state_up | True |
| allowed_
| 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-
| id | 278743d7-
| mac_address | fa:16:3e:a6:f7:d1 |
| name | |
| network_id | 0d3f0103-
| port_security_
| security_groups | 8b68d1c9-
| status | DOWN |
| tenant_id | a7950bd5a61548e
+------
The Router is still scheduled on the compute node.
stack@Dvr-
+------
| id | host | admin_state_up | alive | ha_state |
+------
| 2fc1f65b-
| dae065fb-
+------
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.
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: r-kilo ~]# neutron l3-agent- list-hosting- router demo-router ------- ------- ------- ------- ----+-- ------- ------- ------- -+----- ------- ----+-- -----+- ------- --+ ------- ------- ------- ------- ----+-- ------- ------- ------- -+----- ------- ----+-- -----+- ------- --+ 2d73-4cf0- 9f5a-8762fe3125 16 | compute-kilo-1 | True | :-) | | 9fd5-43e0- 9403-fc49099c54 34 | network- kilo.novalocal | True | :-) | | ------- ------- ------- ------- ----+-- ------- ------- ------- -+----- ------- ----+-- -----+- ------- --+
[root@controlle
+------
| id | host | admin_state_up | alive | ha_state |
+------
| 0ad9782a-
| af482f32-
+------
when the vm is deleted,the router is not scheduled on the compute node:
[root@controlle r-kilo ~]# neutron l3-agent- list-hosting- router demo-router ------- ------- ------- ------- ----+-- ------- ------- ------- -+----- ------- ----+-- -----+- ------- --+ ------- ------- ------- ------- ----+-- ------- ------- ------- -+----- ------- ----+-- -----+- ------- --+ 9fd5-43e0- 9403-fc49099c54 34 | network- kilo.novalocal | True | :-) | | ------- ------- ------- ------- ----+-- ------- ------- ------- -+----- ------- ----+-- -----+- ------- --+
+------
| id | host | admin_state_up | alive | ha_state |
+------
| af482f32-
+------