Port device owner isn't updated with new host availability zone during unshelve
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Medium
|
Matt Riedemann | ||
Ocata |
Fix Committed
|
Low
|
Matt Riedemann | ||
Pike |
Fix Committed
|
Low
|
Matt Riedemann | ||
Queens |
Fix Committed
|
Low
|
Matt Riedemann | ||
Rocky |
Fix Committed
|
Low
|
Matt Riedemann |
Bug Description
During an unshelve the host for an instance and therefor the availability zone may change but does not seem to updated in the port's device_owner causing problems with server action add fixed ip for example.
In nova/network/
+------
| Field | Value |
+------
| admin_state_up | UP |
| allowed_
| binding_host_id | r02c4b15 |
| binding_profile | |
| binding_vif_details | port_filter='True' |
| binding_vif_type | bridge |
| binding_vnic_type | normal |
| created_at | 2018-03-
| data_plane_status | None |
| description | |
| device_id | 53f04bf3-
| device_owner | compute:zone-r7 |
| dns_assignment | |
| dns_name | instance-
| extra_dhcp_opts | |
| fixed_ips | |
| id | 327b891f-
| ip_address | None |
| mac_address | fa:16:3e:14:21:d1 |
| name | |
| network_id | e73b1699-
| option_name | None |
| option_value | None |
| port_security_
| project_id | ecf32b152563403
| qos_policy_id | None |
| revision_number | 19 |
| security_group_ids | bb25a73a-
| status | ACTIVE |
| subnet_id | None |
| tags | |
| trunk_details | None |
| updated_at | 2018-03-
+------
nova show 53f04bf3-
+------
| Property | Value |
+------
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-
| OS-EXT-
| OS-EXT-
Changed in nova: | |
status: | New → Confirmed |
status: | Confirmed → Triaged |
importance: | Undecided → Medium |
tags: | added: neutr shelve |
tags: |
added: neutron removed: neutr |
I think this was the scenario described in IRC for this bug:
1. launch instance, it's in az zone-r7
2. shelve the instance
3. unshelve the instance - the scheduler now puts it in zone-r2
4. add a fixed IP to the instance
This fails because the addFixedIP flow is looking up ports for the instance by it's current zone and fails to find any because the ports still have the old zone in their device_owner field.
Looking at shelve offload, we could cleanup the device_owner and port binding information here:
https:/ /github. com/openstack/ nova/blob/ 144d621397c6a40 65dec9773dc7441 d9badc8f03/ nova/compute/ manager. py#L4837
That cleanup_ instance_ network_ on_host method is currently just a no-op when using neutron.
If we look at unshelve, we call this method to update the port bindings for the host to point at the new host:
https:/ /github. com/openstack/ nova/blob/ 144d621397c6a40 65dec9773dc7441 d9badc8f03/ nova/compute/ manager. py#L4951
That gets into this code to change the port's binding:host_id value to the new host after the unshelve:
https:/ /github. com/openstack/ nova/blob/ 144d621397c6a40 65dec9773dc7441 d9badc8f03/ nova/network/ neutronv2/ api.py# L2576
At that point, we likely should also change the device_owner on the port, like is done here:
https:/ /github. com/openstack/ nova/blob/ 144d621397c6a40 65dec9773dc7441 d9badc8f03/ nova/network/ neutronv2/ api.py# L1031-L1033