Bug 1277981

Summary: [ppc64le] system is not preserving the vm's disk device name (adding new disk as /dev/vda and rotate the old one)
Product: Red Hat Enterprise Linux 7 Reporter: Carlos Mestre González <cmestreg>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.0CC: acanan, amureini, bugs, cmestreg, gklein, hannsj_uhl, istein, jdenemar, laravot, rbalakri, tnisan, ylavi
Target Milestone: pre-dev-freeze   
Target Release: ---   
Hardware: ppc64le   
OS: Unspecified   
Whiteboard: storage
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-16 13:45:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1201513    
Attachments:
Description Flags
logs none

Description Carlos Mestre González 2015-11-04 13:25:12 UTC
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):
rhevm-3.6.0.2-0.1.el6.noarch
libvirt-daemon-driver-nodedev-1.2.17-13.el7.ppc64le
libvirt-daemon-driver-storage-1.2.17-13.el7.ppc64le
libvirt-client-1.2.17-13.el7.ppc64le
libvirt-daemon-driver-nwfilter-1.2.17-13.el7.ppc64le
libvirt-daemon-driver-interface-1.2.17-13.el7.ppc64le
libvirt-daemon-driver-qemu-1.2.17-13.el7.ppc64le
libvirt-daemon-1.2.17-13.el7.ppc64le
libvirt-daemon-driver-secret-1.2.17-13.el7.ppc64le
libvirt-daemon-kvm-1.2.17-13.el7.ppc64le
libvirt-daemon-config-nwfilter-1.2.17-13.el7.ppc64le
libvirt-python-1.2.17-2.el7.ppc64le
libvirt-daemon-driver-network-1.2.17-13.el7.ppc64le
libvirt-lock-sanlock-1.2.17-13.el7.ppc64le
qemu-kvm-rhev-2.3.0-31.el7.ppc64le
qemu-kvm-tools-rhev-2.3.0-31.el7.ppc64le
qemu-kvm-common-rhev-2.3.0-31.el7.ppc64le
ipxe-roms-qemu-20130517-7.gitc4bce43.el7.noarch
qemu-img-rhev-2.3.0-31.el7.ppc64le
vdsm-python-4.17.10.1-0.el7ev.noarch
vdsm-yajsonrpc-4.17.10.1-0.el7ev.noarch
vdsm-4.17.10.1-0.el7ev.noarch
vdsm-jsonrpc-4.17.10.1-0.el7ev.noarch
vdsm-cli-4.17.10.1-0.el7ev.noarch
vdsm-xmlrpc-4.17.10.1-0.el7ev.noarch
vdsm-infra-4.17.10.1-0.el7ev.noarch
vdsm-hook-ethtool-options-4.17.10.1-0.el7ev.noarch


How reproducible:
100%

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

Expected results:
Disk device name should be preserved as it happens in x86 platform

Adding to storage component for the moment.

Comment 1 Tal Nisan 2015-11-04 17:00:37 UTC
Liron, this resembles a bug you worked on, please have a look

Comment 3 Liron Aravot 2015-11-10 13:14:39 UTC
Hi Carlos,
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 -
https://bugzilla.redhat.com/show_bug.cgi?id=1063597#c18

Unless there is another action item here, it seems like this one can be closed. We shouldn't rely on the device names.

Comment 4 Carlos Mestre González 2015-11-10 16:22:03 UTC
Hi Liron,

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.

Comment 5 Carlos Mestre González 2015-11-10 16:24:00 UTC
Created attachment 1092351 [details]
logs

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

Comment 6 Carlos Mestre González 2015-11-11 13:43:35 UTC
Reply to your comment in #c4

Comment 8 Jiri Denemark 2015-11-16 13:45:09 UTC
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.

Comment 9 Allon Mureinik 2015-11-16 15:59:15 UTC
Indeed. Aharon - please evaluate this response, and see how (if?) the current automation code should be amended.