Merge "Update image_base_image_ref during rebuild."
This commit is contained in:
commit
779fd5ea3b
@ -3549,6 +3549,8 @@ class API(base.Base):
|
||||
new_sys_metadata = utils.get_system_metadata_from_image(
|
||||
image, flavor)
|
||||
|
||||
new_sys_metadata.update({'image_base_image_ref': image_id})
|
||||
|
||||
instance.system_metadata.update(new_sys_metadata)
|
||||
instance.save()
|
||||
return orig_sys_metadata
|
||||
@ -4185,6 +4187,14 @@ class API(base.Base):
|
||||
hypervisor.
|
||||
"""
|
||||
instance.task_state = task_states.SHELVING
|
||||
|
||||
# NOTE(aarents): Ensure image_base_image_ref is present as it will be
|
||||
# needed during unshelve and instance rebuild done before Bug/1893618
|
||||
# Fix dropped it.
|
||||
instance.system_metadata.update(
|
||||
{'image_base_image_ref': instance.image_ref}
|
||||
)
|
||||
|
||||
instance.save(expected_task_state=[None])
|
||||
|
||||
self._record_action_start(context, instance, instance_actions.SHELVE)
|
||||
|
@ -9019,6 +9019,7 @@ class ComputeAPITestCase(BaseTestCase):
|
||||
'image_ramdisk_id': uuids.ramdisk_id,
|
||||
'image_something_else': 'meow',
|
||||
'preserved': 'preserve this!',
|
||||
'image_base_image_ref': image_ref,
|
||||
'boot_roles': ''},
|
||||
sys_meta)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user