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?

F.Rosado
  • 487
  • 4
  • 20
  • Same question created on serverfault : https://serverfault.com/questions/1142284/create-a-vm-from-snapshot-use-dev-vda-instead-dev-sda – F.Rosado Aug 29 '23 at 10:08

1 Answers1

0

When you create an instance snapshot it is uploaded to the glance store. You need to modify the image metadata in glance the same way you do with the flavor, set the appropriate scsi_model and disk_bus:

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"

Modifying the flavor should not be necessary anymore. Both root disk and attached volumes should all have /dev/sdX notation now.

eblock
  • 579
  • 3
  • 5
  • Ok, perhaps i have not explained well, I can create a new server from a volume snapshot, not using images. Using this feature the new server doesn't have any metadata from the original image. Obviusly, you can create an image from the snapshot, but this is not my case. – F.Rosado Aug 25 '23 at 10:40
  • I'm still not sure I fully understand the issue. How exactly do you create the volume snapshot? From the "Instances" tab or from the "volumes" tab? Which openstack version is this? I tried lots of combinations and every instance gets its device named `/dev/sdX`, with multiple attached volumes. Maybe you need to clarify what exactly you try and edit the questions. I have a Victoria cloud running. If the base image has the `hw_scsi_model` and `hw_disk_bus` properties set, all resulting VMs (ephemeral disk or persistent volume) inherit the properties and result in a consistent device name. – eblock Aug 28 '23 at 09:14
  • If i'm not wrong, it is a Okata version (3.8). We created the instance from the "instance" menu, but I think is related with special permissions that "normal users" have that doesn't allow create images. – F.Rosado Aug 28 '23 at 12:44