Score:0

Create a VM from snapshot use /dev/VDA instead /dev/SDA

pe flag

0

We have an OpenStack instance configured with multiple images, including CentOS, Redhat, and Ubuntu. When creating a new instance, the root partition attaches as SCSI without any issues. All images are correctly set to use the appropriate drivers.

However, a problem arises when generating a snapshot from a running instance and then creating a new server using this volume snapshot. In this scenario, the root partition appears as "/dev/vda". The more troublesome situation occurs when a new volume is attached, which then appears as "/dev/sda". This new volume becomes the main disk, leading to complications during server reboot as it can't locate a valid boot partition.

We are in need of a solution for this issue. Currently, the workaround involves adding metadata to the flavors: specifically, setting "boot_menu=true". This addition causes a "Press ESC for boot menu" message to appear in the console. While this provides a manual option to select the correct boot disk (VDA), it's not an ideal fix.

I've attempted to apply the metadata value to the flavor, but I'm unsure how to set it as the default for snapshots. Here's what I've tried so far:

$ openstack flavor set --property hw:scsi_model=virtio-scsi zzzz-zzz-zzz-zzz
$ openstack flavor set --property hw:disk_bus=scsi zzzz-zzz-zzz-zzz

Do you have any suggestions or recommendations for resolving this issue?


Edit: posible solution but looking for one using a different approach.

Identified a possible parameter can be added to nova compute nodes :

[libvirt]
disk_prefix=sd

This will force to libvirt attach new disk devices using /dev/sdX It is documented here:

https://docs.openstack.org/ocata/config-reference/compute/config-options.html

I prefer to use some kind of metadata to avoid global side effects changing this setting globally.


Edit 2: This solution only solve the different letter for VDA and SDA, but the second volume attached still acting as boot device.

Score:0
us flag

As already commented, you can use image metadata:

root@control01:~# openstack image set --property hw_scsi_model=virtio-scsi --property hw_disk_bus=scsi <IMAGE>
root@control01:~# openstack image show <IMAGE> -c properties -f json | jq '.properties|.["hw_disk_bus", "hw_scsi_model"]'
"scsi"
"virtio-scsi"

Creating an instance from that image should have /dev/sda as root device (independent of ephemeral disk or persistent volume). Creating a volume snapshot should inherit those properties, launching an instance from that snapshot also inherits them as do all attached volumes. I could verify with Openstack version Victoria. If the snapshot does not have the image properties inherited, you might need to check why that is, maybe some glance or cinder policy? But IIRC this did already work properly for us in Ocata, and it still does in Victoria. I don't have a newer release available yet. If you turn on debug logs for cinder and glance you might see why the properties are not set.

Fernando Rosado avatar
pe flag
In my case, the users have no permission to create images, they boot from volume snapshots and don't inherit those image properties. For some reason to attach a second volume, the new ones is the boot volume.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.