Fix device_type=lun with boot_index
Right now we'll fail to calculate the boot order of a set of BDMs if one of them is a device_type=lun. This fixes that and teaches us that it's just a "hd" from qemu's perspective. Closes-Bug: #2065084 Change-Id: Ic1340918738d503fc797c9373fe2e1dd16b27a09
This commit is contained in:
@@ -1372,6 +1372,20 @@ class LibvirtBlockInfoTest(test.NoDBTestCase):
|
||||
expected_order = ['hd', 'cdrom']
|
||||
self.assertEqual(expected_order, blockinfo.get_boot_order(disk_info))
|
||||
|
||||
def test_get_boot_order_lun(self):
|
||||
disk_info = {
|
||||
'disk_bus': 'virtio',
|
||||
'cdrom_bus': 'ide',
|
||||
'mapping': {
|
||||
'disk': {'bus': 'virtio', 'dev': 'vda',
|
||||
'type': 'disk', 'boot_index': '1'},
|
||||
'root': {'bus': 'virtio', 'dev': 'vda',
|
||||
'type': 'lun', 'boot_index': '1'},
|
||||
}
|
||||
}
|
||||
expected_order = ['hd']
|
||||
self.assertEqual(expected_order, blockinfo.get_boot_order(disk_info))
|
||||
|
||||
def _get_rescue_image_meta(self, props_dict):
|
||||
meta_dict = dict(self.test_image_meta)
|
||||
meta_dict['properties'] = props_dict
|
||||
|
||||
@@ -88,7 +88,8 @@ from nova.virt import osinfo
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
BOOT_DEV_FOR_TYPE = {'disk': 'hd', 'cdrom': 'cdrom', 'floppy': 'fd'}
|
||||
BOOT_DEV_FOR_TYPE = {'disk': 'hd', 'cdrom': 'cdrom', 'floppy': 'fd',
|
||||
'lun': 'hd'}
|
||||
# NOTE(aspiers): If you change this, don't forget to update the docs and
|
||||
# metadata for hw_*_bus in glance.
|
||||
SUPPORTED_DEVICE_BUSES = {
|
||||
|
||||
Reference in New Issue
Block a user