shelved offloaded server still shows old AZ while shelved
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Low
|
Matt Riedemann | ||
Pike |
Fix Committed
|
Low
|
Matt Riedemann | ||
Queens |
Fix Committed
|
Low
|
Matt Riedemann | ||
Rocky |
Fix Committed
|
Low
|
Matt Riedemann |
Bug Description
When a server is shelved (and offloaded from the compute host), the instance.host and instance.node values are cleared because it's no longer on any host:
However, the instance.
Recreate steps:
1. create an AZ and put a host in it (this is single-node devstack created from master today):
stack@stein:~$ openstack aggregate add host DC1 stein
+------
| Field | Value |
+------
| availability_zone | DC1 |
| created_at | 2018-08-
| deleted | False |
| deleted_at | None |
| hosts | [u'stein'] |
| id | 1 |
| metadata | {u'availability
| name | DC1 |
| updated_at | None |
+------
2. Create a server - in this case there is only 1 host and it's in an AZ so that's what shows up for the server output:
stack@stein:~$ openstack server create --flavor m1.tiny --image cirros-
+------
| Field | Value |
+------
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-STS:vm_state | active |
| OS-SRV-
| OS-SRV-
| accessIPv4 | |
| accessIPv6 | |
| addresses | private=
| adminPass | HSetKiH8g336 |
| config_drive | |
| created | 2018-08-
| flavor | m1.tiny (1) |
| hostId | 50c671bf8b1d64a
| id | 1fee3708-
| image | cirros-
| key_name | None |
| name | test-shelve-az |
| progress | 0 |
| project_id | 567c6a1c89f04c2
| properties | |
| security_groups | name='default' |
| status | ACTIVE |
| updated | 2018-08-
| user_id | 71835b0bbc6c4ba
| volumes_attached | |
+------
3. shelve (offload) the server and verify the host and hypervisor_hostname are no longer set for the instance but the AZ still is:
stack@stein:~$ openstack server shelve test-shelve-az
stack@stein:~$ openstack server show test-shelve-az
+------
| Field | Value |
+------
| OS-DCF:diskConfig | MANUAL |
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-
| OS-EXT-STS:vm_state | shelved_offloaded |
| OS-SRV-
| OS-SRV-
| accessIPv4 | |
| accessIPv6 | |
| addresses | private=
| config_drive | |
| created | 2018-08-
| flavor | m1.tiny (1) |
| hostId | |
| id | 1fee3708-
| image | cirros-
| key_name | None |
| name | test-shelve-az |
| project_id | 567c6a1c89f04c2
| properties | |
| security_groups | name='default' |
| status | SHELVED_OFFLOADED |
| updated | 2018-08-
| user_id | 71835b0bbc6c4ba
| volumes_attached | |
+------
The easy fix is to null out the instance. availability_ zone here:
https:/ /github. com/openstack/ nova/blob/ bb14337c30df0c1 7bc1dadc00d5a55 00ae2dc4b7/ nova/compute/ manager. py#L574