Merge "Null out instance.availability_zone on shelve offload"

This commit is contained in:
Zuul 2018-09-28 08:24:27 +00:00 committed by Gerrit Code Review
commit 37a4299062
5 changed files with 8 additions and 1 deletions

View File

@ -3,6 +3,7 @@
"payload":{
"$ref":"common_payloads/InstanceActionPayload.json#",
"nova_object.data":{
"availability_zone": null,
"block_devices":[],
"deleted_at":"2012-10-29T13:42:11Z",
"host":null,

View File

@ -3,6 +3,7 @@
"payload":{
"$ref":"common_payloads/InstanceActionPayload.json#",
"nova_object.data":{
"availability_zone": null,
"block_devices":[],
"host":null,
"ip_addresses":[],

View File

@ -3,6 +3,7 @@
"payload":{
"$ref": "common_payloads/InstanceActionPayload.json#",
"nova_object.data":{
"availability_zone": null,
"state": "shelved_offloaded",
"power_state": "shutdown",
"host": null,

View File

@ -578,6 +578,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

@ -2756,7 +2756,8 @@ class ServerMovingTests(integrated_helpers.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,