Red Hat Bugzilla – Bug 1277981
[ppc64le] system is not preserving the vm's disk device name (adding new disk as /dev/vda and rotate the old one)
Last modified: 2016-02-21 08:30:11 EST
Description of problem:
Adding a new disk to a vm will make the other disk rotate (more in reproduce steps)
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Create a vm with a bootable disk and OS. Start it
2. VM's disk will be seen from the OS as /dev/vda (as expected)
3. Shutdown the vm and add a new disk. Start it again
4. First and bootable disk is now /dev/vdb and the new disk is now /dev/vda
Disk device name should be preserved as it happens in x86 platform
Adding to storage component for the moment.
Liron, this resembles a bug you worked on, please have a look
please provide any relevant log as Yaniv requested.
Generally, referencing a device by it's logical name isn't good because it's not deterministic. we pass the disk id as the serial and you should use that, please take a further look at the discussion above -
Unless there is another action item here, it seems like this one can be closed. We shouldn't rely on the device names.
Thanks for your response.
Yes, we're relying on the device name in some cases since in x86_64 the device names "are reliable", at least in all our testing for the boot device it always kept the /dev/vda adding any number of disks later on.
In PPC is consistent that, after the steps provided in the description, the new disks always takes /dev/vda and the boot disk changes to /dev/vdb. So I'm thinking this is a difference between the way each platform's libvirt version handles this.
I'm adding the logs here.
Created attachment 1092351 [details]
General logs, engine, vdsm log, vm's OS messages, qemu log.
vm name is test_get_device_name, starts execution at 18:00:00, vdsm logs 11:00
Reply to your comment in #c4
So according to the logs, the old disk is still passed as virtio-disk0 with bootindex=1 and the new disk is virtio-disk1 without bootindex. So libvirt is doing the right thing here.
According to the logs from the guest OS, even QEMU is doing the right thing because the boot loader finds the kernel and dracut on the correct disk and starts booting from it.
And there's no bug in guest OS configuration either since it happily finishes booting of the right disk.
So as stated in comment 3, don't rely on a device names, use filesystem labels, UUIDs, or something like that to identify individual disks. The fact that it's reliable on some configuration does not mean it will work reliably on another configuration.
Indeed. Aharon - please evaluate this response, and see how (if?) the current automation code should be amended.