Copy created image into all available glance stores
The openstack can have multiple glance stores deployed/available. It may be a proper thing to copy newly created signed image into all the available glance stores so barbican tempest tests can access image regardless on which compute and storage backend they are ran on and regardless on which glance store is local. Additionally there is a nova-compute conf parameter[1] which can even prevent instances being spawned from image which is not available in local glance store. The copy-image would happen only if import_image tempest cong option is available which indicates glance multistore is available. [1] https://review.opendev.org/#/c/657078/ Change-Id: I1f0d8be1b237da0c96e820c4b3dca09a83b29752
This commit is contained in:
parent
a318f6d77c
commit
1972c46924
|
@ -290,6 +290,27 @@ class ScenarioTest(manager.NetworkScenarioTest):
|
|||
self.image_client.update_image(image['id'], data=image_file)
|
||||
else:
|
||||
self.image_client.store_image_file(image['id'], image_file)
|
||||
|
||||
if CONF.image_feature_enabled.import_image:
|
||||
available_stores = []
|
||||
try:
|
||||
available_stores = self.image_client.info_stores()['stores']
|
||||
except exceptions.NotFound:
|
||||
pass
|
||||
available_import_methods = self.image_client.info_import()[
|
||||
'import-methods']['value']
|
||||
if ('copy-image' in available_import_methods and
|
||||
len(available_stores) > 1):
|
||||
self.image_client.image_import(image['id'],
|
||||
method='copy-image',
|
||||
all_stores=True,
|
||||
all_stores_must_succeed=False)
|
||||
failed_stores = waiters.wait_for_image_copied_to_stores(
|
||||
self.image_client, image['id'])
|
||||
self.assertEqual(0, len(failed_stores),
|
||||
"Failed to copy the following stores: %s" %
|
||||
str(failed_stores))
|
||||
|
||||
return image['id']
|
||||
|
||||
def rebuild_server(self, server_id, image=None,
|
||||
|
|
Loading…
Reference in New Issue