Merge "Null out instance.availability_zone on shelve offload" into stable/queens

This commit is contained in:
Zuul 2019-02-09 03:00:52 +00:00 committed by Gerrit Code Review
commit 2ec8cf74a0
3 changed files with 6 additions and 2 deletions

View File

@ -3,7 +3,7 @@
"payload":{
"nova_object.data":{
"architecture":"x86_64",
"availability_zone": "nova",
"availability_zone": null,
"block_devices": [{
"nova_object.data": {
"boot_index": null,

View File

@ -577,6 +577,9 @@ class ComputeManager(manager.Manager):
# to the database layer.
instance.host = None
instance.node = None
# If the instance is not on a host, it's not in an aggregate and
# therefore is not in an availability zone.
instance.availability_zone = None
def _set_instance_obj_error_state(self, context, instance,
clean_task_state=False):

View File

@ -2484,7 +2484,8 @@ class ServerMovingTests(ProviderUsageBaseTestCase):
self.api.post_server_action(server['id'], req)
self._wait_for_server_parameter(
self.api, server, {'status': 'SHELVED_OFFLOADED',
'OS-EXT-SRV-ATTR:host': None})
'OS-EXT-SRV-ATTR:host': None,
'OS-EXT-AZ:availability_zone': ''})
source_usages = self._get_provider_usages(source_rp_uuid)
self.assertEqual({'VCPU': 0,
'MEMORY_MB': 0,