Comment 7 for bug 1729584

Revision history for this message
melanie witt (melwitt) wrote : Re: boot from volume + configdrive broken (regression)

Hi Logan,

Thank you for all the detailed info to help with debugging.

I noticed in your paste none of the volumes in your disk_info['mapping'] have boot_index=0. Is that correct? I thought one of them would have to have boot_index=0 if you have a bootable volume.

I'm trying to work out what's needed to address the remaining problem you're observing with boot-from-volume plus additional volumes and drives. Would it be possible for you to test the following patch that builds upon the first one?

--- a/nova/virt/libvirt/driver.py
+++ b/nova/virt/libvirt/driver.py
@@ -3763,6 +3763,8 @@ class LibvirtDriver(driver.ComputeDriver):
             # unit added and be able to increment it for each disk
             # added.
             disk_mapping['unit'] = 0
+ if self._is_booted_from_volume(block_device_info):
+ disk_mapping['unit'] = 1

         def _get_ephemeral_devices():
             eph_devices = []
@@ -3852,8 +3854,11 @@ class LibvirtDriver(driver.ComputeDriver):
             info = disk_mapping[vol_dev]
             self._connect_volume(context, connection_info, instance)
             if scsi_controller and scsi_controller.model == 'virtio-scsi':
- info['unit'] = disk_mapping['unit']
- disk_mapping['unit'] += 1
+ if vol.get('boot_index') == 0:
+ info['unit'] = 0
+ else:
+ info['unit'] = disk_mapping['unit']
+ disk_mapping['unit'] += 1
             cfg = self._get_volume_config(connection_info, info)
             devices.append(cfg)
             vol['connection_info'] = connection_info