Bug 1277981 - [ppc64le] system is not preserving the vm's disk device name (adding new disk as /dev/vda and rotate the old one)
[ppc64le] system is not preserving the vm's disk device name (adding new disk...
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.0
ppc64le Unspecified
unspecified Severity high
: pre-dev-freeze
: ---
Assigned To: Libvirt Maintainers
Virtualization Bugs
storage
:
Depends On:
Blocks: RHEV3.6PPC
  Show dependency treegraph
 
Reported: 2015-11-04 08:25 EST by Carlos Mestre González
Modified: 2016-02-21 08:30 EST (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-16 08:45:09 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
logs (161.83 KB, application/x-gzip)
2015-11-10 11:24 EST, Carlos Mestre González
no flags Details

  None (edit)
Description Carlos Mestre González 2015-11-04 08:25:12 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):
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 12:00:37 EST
Liron, this resembles a bug you worked on, please have a look
Comment 3 Liron Aravot 2015-11-10 08:14:39 EST
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 11:22:03 EST
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 11:24 EST
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 08:43:35 EST
Reply to your comment in #c4
Comment 8 Jiri Denemark 2015-11-16 08:45:09 EST
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 10:59:15 EST
Indeed. Aharon - please evaluate this response, and see how (if?) the current automation code should be amended.

Note You need to log in before you can comment on or make changes to this bug.