Merge "Revert 'Remove image to local block device mapping'" into stable/kilo

This commit is contained in:
Jenkins 2015-12-21 21:14:52 +00:00 committed by Gerrit Code Review
commit a87cbd9128
2 changed files with 15 additions and 0 deletions

View File

@ -292,6 +292,13 @@ class ShellTest(utils.TestCase):
'flavorRef': '1',
'name': 'some-server',
'block_device_mapping_v2': [
{
'uuid': 1,
'source_type': 'image',
'destination_type': 'local',
'boot_index': 0,
'delete_on_termination': True,
},
{
'uuid': 'fake-id',
'source_type': 'volume',

View File

@ -492,6 +492,14 @@ class ServerManager(base.BootingManagerWithFind):
body['server']['block_device_mapping'] = \
self._parse_block_device_mapping(block_device_mapping)
elif block_device_mapping_v2:
# Following logic can't be removed because it will leaves
# a valid boot with both --image and --block-device
# failed , see bug 1433609 for more info
if image:
bdm_dict = {'uuid': image.id, 'source_type': 'image',
'destination_type': 'local', 'boot_index': 0,
'delete_on_termination': True}
block_device_mapping_v2.insert(0, bdm_dict)
body['server']['block_device_mapping_v2'] = block_device_mapping_v2
if nics is not None: