Merge "update scheduler to use image-traits"

This commit is contained in:
Zuul 2018-05-11 22:34:20 +00:00 committed by Gerrit Code Review
commit e94ce405f9

View File

@ -1514,6 +1514,7 @@ class CinderFixtureNewAttachFlow(fixtures.Fixture):
# This represents a bootable image-backed volume to test
# boot-from-volume scenarios.
IMAGE_BACKED_VOL = '6ca404f3-d844-4169-bb96-bc792f37de98'
IMAGE_WITH_TRAITS_BACKED_VOL = '6194fc02-c60e-4a01-a8e5-600798208b5f'
def __init__(self, test):
super(CinderFixtureNewAttachFlow, self).__init__()
@ -1592,14 +1593,23 @@ class CinderFixtureNewAttachFlow(fixtures.Fixture):
}
# Check for our special image-backed volume.
if volume_id == self.IMAGE_BACKED_VOL:
if (volume_id == self.IMAGE_BACKED_VOL or
volume_id == self.IMAGE_WITH_TRAITS_BACKED_VOL):
# Make it a bootable volume.
volume['bootable'] = True
# Add the image_id metadata.
volume['volume_image_metadata'] = {
# There would normally be more image metadata in here...
'image_id': '155d900f-4e14-4e4c-a73d-069cbf4541e6'
}
if volume_id == self.IMAGE_BACKED_VOL:
# Add the image_id metadata.
volume['volume_image_metadata'] = {
# There would normally be more image metadata in here.
'image_id': '155d900f-4e14-4e4c-a73d-069cbf4541e6'
}
elif volume_id == self.IMAGE_WITH_TRAITS_BACKED_VOL:
# Add the image_id metadata with traits.
volume['volume_image_metadata'] = {
'image_id': '155d900f-4e14-4e4c-a73d-069cbf4541e6',
"container_format": "ami",
"trait:HW_CPU_X86_SGX": "required",
}
return volume