Comment 0 for bug 1822129

Revision history for this message
Eric Desrochers (slashd) wrote : leave device name empty so that nova can determine it instead

Upstream bug:
https://bugs.launchpad.net/nova/+bug/1560965

Upstream git-review:
[git-review] https://review.openstack.org/644982/ # Taking care of bootimagefromvolume
[git-review] https://review.openstack.org/648328/ # Taking care of existing volume and snapshot

Description:
Horizon hardcoded 'vda' no matter what (legacy code) for boot volume scenarios. Meaning that if for instance we use an image with scsi decoration[1] horizon will name the device_name as 'vda' when it should be 'sda'.

Inside the instance, it will be 'sda' but horizon will show 'vda', if you then attach a second volume, the volume will be seen as 'sda' in horizon, but 'sdb' in the instance, creating a inconsistency depending from where you look at, and can also cause VM to have issue to successfully reboot, hanging with "No bootable device".

There is 2 functions separate as follow:

* setFinalSpecBootImageToVolume() which already uses BDMv2, in this case it was just a matter to remove the 'device_name' attribute as suggested per documentation[2]. This function take care of boot image from volume scenario.

* setFinalSpecBootFromVolumeDevice() which currently uses BDMv1 (legacy), in this case an upgrade to BDMv2 without setting up a 'device_name' attribute is sufficient to fix the issue. This function take care of booting from existing volume and snapshot.

Basically, with theses 2 fixes, it is no longer relying on "vol_device_name= 'vda'" as it was before as it is no longer needed since Liberty (again as per documentation)

An instance with scsi decoration will properly show 'sda' and without will show 'vda'.
'vda' will still be taken when it's the right thing to do, but not because it is hardcorded like it used to before these fixes.

[1] - scsi meta decoration:
hw_disk_bus='scsi'
hw_scsi_model='virtio-scsi'

[2]- https://docs.openstack.org/nova/stein/user/block-device-mapping.html