[Bug 755415] New: make virtio-blk generate a serial attribute
https://bugzilla.novell.com/show_bug.cgi?id=755415 https://bugzilla.novell.com/show_bug.cgi?id=755415#c0 Summary: make virtio-blk generate a serial attribute Classification: openSUSE Product: openSUSE 12.1 Version: Final Platform: x86-64 OS/Version: openSUSE 12.1 Status: NEW Severity: Normal Priority: P5 - None Component: Kernel AssignedTo: kernel-maintainers@forge.provo.novell.com ReportedBy: mjedamzik@novell.com QAContact: qa-bugs@suse.de CC: abergmann@novell.com Found By: Field Engineer Blocker: No if you add a virtio disk to a virtualized system ( kvm ) there we'll be no link in /dev/disk/by-id/ because the device is missing the serial attribute. The links should be created because of these rules in /lib/udev/rules.d/60-persistent-storage.rules : KERNEL=="vd*[!0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}" KERNEL=="vd*[0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}-part%n" However, if you examine the device: sles11sp22:~ # udevadm info --query=all --name=/dev/vdc P: /devices/pci0000:00/0000:00:0e.0/virtio4/block/vdc N: vdc W: 17 S: block/253:32 S: disk/by-path/pci-0000:00:0e.0-virtio-pci-virtio4 E: UDEV_LOG=3 E: DEVPATH=/devices/pci0000:00/0000:00:0e.0/virtio4/block/vdc E: MAJOR=253 E: MINOR=32 E: DEVNAME=/dev/vdc E: DEVTYPE=disk E: SUBSYSTEM=block E: ID_PATH=pci-0000:00:0e.0-virtio-pci-virtio4 E: DEVLINKS=/dev/block/253:32 /dev/disk/by-path/pci-0000:00:0e.0-virtio-pci-virtio4 The same disk, now via scsi: sles11sp22:~ # udevadm info --query=all --name=/dev/sdc P: /devices/pci0000:00/0000:00:0b.0/host3/target3:0:4/3:0:4:0/block/sdc N: sdc W: 24 S: block/8:32 S: disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi1-0-4 S: disk/by-path/pci-0000:00:0b.0-scsi-0:0:4:0 E: UDEV_LOG=3 E: DEVPATH=/devices/pci0000:00/0000:00:0b.0/host3/target3:0:4/3:0:4:0/block/sdc E: MAJOR=8 E: MINOR=32 E: DEVNAME=/dev/sdc E: DEVTYPE=disk E: SUBSYSTEM=block E: ID_SCSI=1 E: ID_VENDOR=QEMU E: ID_VENDOR_ENC=QEMU\x20\x20\x20\x20 E: ID_MODEL=QEMU_HARDDISK E: ID_MODEL_ENC=QEMU\x20HARDDISK\x20\x20\x20 E: ID_REVISION=0.15 E: ID_TYPE=disk E: ID_SERIAL=0QEMU_QEMU_HARDDISK_drive-scsi1-0-4 E: ID_SERIAL_SHORT=drive-scsi1-0-4 E: ID_BUS=scsi E: ID_PATH=pci-0000:00:0b.0-scsi-0:0:4:0 E: DEVLINKS=/dev/block/8:32 /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi1-0-4 /dev/disk/by-path/pci-0000:00:0b.0-scsi-0:0:4:0 Therefore the udev rules can never take effect. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=755415 https://bugzilla.novell.com/show_bug.cgi?id=755415#c1 --- Comment #1 from Alexander Bergmann <abergmann@novell.com> 2012-04-03 14:22:59 UTC --- You can specify a serial number in your libvirt profile. http://libvirt.org/formatdomain.html#elementsDisks serial If present, this specify serial number of virtual hard drive. For example, it may look like <serial>WD-WMAP9A966149</serial>. Since 0.7.1 #> virsh attach-disk glas /tmp/test.qcow2 vdb --subdriver qcow2 --driver qemu --serial test001 <disk type='block' device='disk'> <driver name='qemu' type='qcow2'/> <source dev='/tmp/test.qcow2'/> <target dev='vdb' bus='virtio'/> <serial>test001</serial> <alias name='virtio-disk1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x0d' function='0x0'/> </disk> #> ls -lhtr /dev/disk/by-id/virtio* lrwxrwxrwx 1 root root 9 Apr 3 16:25 /dev/disk/by-id/virtio-test001 -> ../../vdf #> udevadm info --query=all --name=/dev/vdf P: /devices/pci0000:00/0000:00:0d.0/virtio6/block/vdf N: vdf W: 69 S: block/252:80 S: disk/by-id/virtio-test001 S: disk/by-path/pci-0000:00:0d.0-virtio-pci-virtio6 E: UDEV_LOG=3 E: DEVPATH=/devices/pci0000:00/0000:00:0d.0/virtio6/block/vdf E: MAJOR=252 E: MINOR=80 E: DEVNAME=/dev/vdf E: DEVTYPE=disk E: SUBSYSTEM=block E: ID_SERIAL=test001 E: ID_PATH=pci-0000:00:0d.0-virtio-pci-virtio6 E: DEVLINKS=/dev/block/252:80 /dev/disk/by-id/virtio-test001 /dev/disk/by-path/pci-0000:00:0d.0-virtio-pci-virtio6 -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=755415 https://bugzilla.novell.com/show_bug.cgi?id=755415#c2 Jeff Mahoney <jeffm@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |NEEDINFO CC| |jeffm@suse.com InfoProvider| |abergmann@novell.com --- Comment #2 from Jeff Mahoney <jeffm@suse.com> 2012-04-04 13:47:09 EDT --- So is qemu responsible for setting a default serial as well, then? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=755415 https://bugzilla.novell.com/show_bug.cgi?id=755415#c3 --- Comment #3 from Martin Jedamzik <mjedamzik@novell.com> 2012-04-05 07:04:38 UTC --- (In reply to comment #2)
So is qemu responsible for setting a default serial as well, then?
I'm not sure that this bug is valid after reading Alex comment. However, the behaviour is inconsistent. And there's no way to get the by-id links when using virt-manager. What we observe is that the handling of virtio-blk devices is different from scsi devices. But I have no clue which subsystem is responsible for that. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=755415 https://bugzilla.novell.com/show_bug.cgi?id=755415#c4 --- Comment #4 from Alexander Bergmann <abergmann@novell.com> 2012-04-05 10:22:34 UTC --- Yes qemu has a bunch of options that are not yet accessible over virt-manager. However libvirt is capable in storing most of the information inside the guest XML files. In this case the drive option needs the additional parameter 'serial=<id>'. #> qemu-kvm --help | grep -A 4 '\-drive' -drive [file=file][,if=type][,bus=n][,unit=m][,media=d][,index=i] [,cyls=c,heads=h,secs=s[,trans=t]][,snapshot=on|off] [,cache=writethrough|writeback|none|directsync|unsafe][,format=f] [,serial=s][,addr=A][,id=name][,aio=threads|native] [,readonly=on|off] The libvirt documentation is pretty solid in this perspective. http://libvirt.org/formatdomain.html#elementsDisks -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=755415 https://bugzilla.novell.com/show_bug.cgi?id=755415#c Jiri Slaby <jslaby@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEEDINFO |NEW InfoProvider|abergmann@novell.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=755415 https://bugzilla.novell.com/show_bug.cgi?id=755415#c5 Jiri Slaby <jslaby@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |jslaby@suse.com Resolution| |WONTFIX --- Comment #5 from Jiri Slaby <jslaby@suse.com> 2013-06-24 07:19:54 UTC --- Sorry, 12.1 is not supported any more. If you can reproduce with 12.2 or newer, reopen. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com