Revert 'Remove image to local block device mapping'
https://review.openstack.org/#/c/153203/3 added check for novaclient, removed the logic for both --image and --block-device are added. But actually the following valid boot command failed due to the change here, so this patch reverted original one and add some descriptions to avoid further removal. nova boot test-vm --flavor m1.medium --image centos-vm-32 --nic net-id=c3f40e33-d535-4217-916b-1450b8cd3987 --block-device id=26b7b917-2794-452a-95e5-2efb2ca6e32d,bus=sata, source=volume,bootindex=1 Change-Id: Ia29e63c72b34d3038aa591c466425e65edf5755b Partial-Bug: #1433609
This commit is contained in:
parent
e0f5072907
commit
8679eedb83
novaclient
@ -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',
|
||||
|
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user