Bug 1220617 - udev(in systemd) fail to identify WWN for ata DVD/CD
Summary: udev(in systemd) fail to identify WWN for ata DVD/CD
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: udev
Version: 6.7
Hardware: Unspecified
OS: Unspecified
urgent
high
Target Milestone: rc
: ---
Assignee: Harald Hoyer
QA Contact: Radka Skvarilova
URL:
Whiteboard:
Depends On:
Blocks: 1270825 1130475
TreeView+ depends on / blocked
 
Reported: 2015-05-12 02:43 UTC by Sibiao Luo
Modified: 2016-05-11 00:27 UTC (History)
12 users (show)

Fixed In Version: udev-147-2.66.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-11 00:27:04 UTC


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:0903 normal SHIPPED_LIVE udev bug fix update 2016-05-10 22:51:07 UTC

Description Sibiao Luo 2015-05-12 02:43:37 UTC
Description of problem:
We have fixed by-id fail to identifier for ata DVD/CD in Bug 1130438, but udev(in systemd) fail to identify WWN for ata DVD/CD which block KVM QE to verify Bug 1130475.

Version-Release number of selected component (if applicable):
host info:
# uname -r && rpm -q qemu-kvm
2.6.32-558.el6.x86_64
qemu-kvm-0.12.1.2-2.474.el6.x86_64
guest info:
2.6.32-558.el6.x86_64
udev-147-2.62.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1.Launch a KVM guest with a ATA disk and CDROM specified wwn.
e.g:...-drive file=/mnt/rhel66-64-virtio.raw,if=none,id=drive-system-disk,format=raw,cache=none,aio=native -device ide-drive,bus=ide.0,unit=0,drive=drive-system-disk,id=system-disk,wwn=0x5000c50015ea71aa,bootindex=1...-drive file=/home/cdrom1.iso,if=none,id=hd,format=raw,media=cdrom,readonly=on,cache=none,werror=stop,rerror=stop -device ide-drive,bus=ide.0,unit=1,wwn=0x5000c50015ea71bb,drive=hd,id=cdrom

2.check the wwn in guest.
# ls -lh /dev/cdrom1 
# ls -l /dev/disk/by-id/wwn*
# ls -lh /dev/disk/by-id/* | grep sr
# ls -lh /dev/disk/by-id/* | grep sda
# sg_inq --ata --hex /dev/sda
# sg_inq --ata --hex /dev/sr0

Actual results:
# ls -l /dev/disk/by-id/wwn*
lrwxrwxrwx. 1 root root  9 May 12 18:28 /dev/disk/by-id/wwn-0x5000c50015ea71aa -> ../../sda
lrwxrwxrwx. 1 root root 10 May 12 18:28 /dev/disk/by-id/wwn-0x5000c50015ea71aa-part1 -> ../../sda1
lrwxrwxrwx. 1 root root 10 May 12 18:28 /dev/disk/by-id/wwn-0x5000c50015ea71aa-part2 -> ../../sda2

# ls -lh /dev/disk/by-id/* | grep sr
lrwxrwxrwx. 1 root root  9 May 12 18:28 /dev/disk/by-id/ata-QEMU_DVD-ROM_QM00002 -> ../../sr0

# ls -lh /dev/disk/by-id/* | grep sda
lrwxrwxrwx. 1 root root  9 May 12 18:28 /dev/disk/by-id/ata-QEMU_HARDDISK_QM00001 -> ../../sda
lrwxrwxrwx. 1 root root 10 May 12 18:28 /dev/disk/by-id/ata-QEMU_HARDDISK_QM00001-part1 -> ../../sda1
lrwxrwxrwx. 1 root root 10 May 12 18:28 /dev/disk/by-id/ata-QEMU_HARDDISK_QM00001-part2 -> ../../sda2
lrwxrwxrwx. 1 root root 10 May 12 18:28 /dev/disk/by-id/lvm-pv-uuid-thTRaT-EEDi-l5vc-7xr5-sa1h-A1W5-iLHC5i -> ../../sda2
lrwxrwxrwx. 1 root root  9 May 12 18:28 /dev/disk/by-id/scsi-SATA_QEMU_HARDDISK_QM00001 -> ../../sda
lrwxrwxrwx. 1 root root 10 May 12 18:28 /dev/disk/by-id/scsi-SATA_QEMU_HARDDISK_QM00001-part1 -> ../../sda1
lrwxrwxrwx. 1 root root 10 May 12 18:28 /dev/disk/by-id/scsi-SATA_QEMU_HARDDISK_QM00001-part2 -> ../../sda2
lrwxrwxrwx. 1 root root  9 May 12 18:28 /dev/disk/by-id/wwn-0x5000c50015ea71aa -> ../../sda
lrwxrwxrwx. 1 root root 10 May 12 18:28 /dev/disk/by-id/wwn-0x5000c50015ea71aa-part1 -> ../../sda1
lrwxrwxrwx. 1 root root 10 May 12 18:28 /dev/disk/by-id/wwn-0x5000c50015ea71aa-part2 -> ../../sda2

# sg_inq --ata --hex /dev/sda | grep 68
 68     0000 0000 6000 0000 5000 c500 15ea 71aa     .. .. `. .. P. .. .. q. 

# sg_inq --ata --hex /dev/sr0 | grep 68
 68     0000 0000 0000 0000 5000 c500 15ea 71bb     .. .. .. .. P. .. .. q. 

Expected results:
udev(in systemd) should can be to identify WWN for ata DVD/CD, like:
lrwxrwxrwx. 1 root root  9 Mar 31 22:23 /dev/disk/by-id/wwn-0x5000c50015ea71bb -> ../../sr0

Additional info:
###### rhel6.7 host + rhel7.1 guest.
host info:
# uname -r && rpm -q qemu-kvm
2.6.32-546.el6.x86_64
qemu-kvm-0.12.1.2-2.462.el6.x86_64
guest info:
# uname -r
3.10.0-229.1.2.el7.x86_64
###### Result:
# ls -lh /dev/cdrom*
ls -lh /dev/cdrom*
lrwxrwxrwx. 1 root root 3 Mar 31 22:23 /dev/cdrom -> sr0
# ls -l /dev/disk/by-id/wwn*
ls -l /dev/disk/by-id/wwn*
lrwxrwxrwx. 1 root root  9 Mar 31 22:23 /dev/disk/by-id/wwn-0x5000c50015ea71aa -> ../../sda
lrwxrwxrwx. 1 root root 10 Mar 31 22:23 /dev/disk/by-id/wwn-0x5000c50015ea71aa-part1 -> ../../sda1
lrwxrwxrwx. 1 root root 10 Mar 31 22:23 /dev/disk/by-id/wwn-0x5000c50015ea71aa-part2 -> ../../sda2
lrwxrwxrwx. 1 root root  9 Mar 31 22:23 /dev/disk/by-id/wwn-0x5000c50015ea71ad -> ../../sr0

Comment 1 John Snow 2015-05-12 18:16:58 UTC
Hi, cross-posting from the QEMU bug for the same issue:

---
I am not 100%, but it appears that upstream udev (in systemd) has support for sending the 0xA1 PACKET_IDENTIFY command instead of the 0xEC IDENTIFY command which only works for ATA disks.

If you want to see WWN in rhel6.7 udev, you'll need to send the correct command to the device. Where I am confused is why sending the wrong command does *anything* at all, like getting the right model information and so on.

I suspect this is what you want (commit id taken from the upstream systemd git repo)

commit 560de575148b7efda3b34a7f7073abd483c5f08e
Author: David Zeuthen <davidz@redhat.com>
Date:   Thu Nov 4 08:55:58 2010 -0400

    Use ata_id, not scsi_id, on ATAPI devices
---


So it appears that RHEL6.7 udev is not equipped to actually query the ATAPI drive correctly, but upstream udev (in the systemd tree) currently does. The commit id shown appears to introduce the proper 0XA1 query commands to udev, but I wasn't able to test that it is sufficient to fix the issue.

Comment 3 Qunfang Zhang 2015-05-26 03:39:42 UTC
Hi, Harald

Do we have a chance to fix it in rhel6.7? Since it blocks us to verify the rhel6.7 qemu-kvm bug 1130475.

Thanks,
Qunfang

Comment 4 Harald Hoyer 2015-10-13 08:57:42 UTC
(In reply to Qunfang Zhang from comment #3)
> Hi, Harald
> 
> Do we have a chance to fix it in rhel6.7? Since it blocks us to verify the
> rhel6.7 qemu-kvm bug 1130475.
> 
> Thanks,
> Qunfang

Scheduled for RHEL-6.8

Comment 6 Michal Sekletar 2015-11-10 15:33:18 UTC
I've already backported all necessary patches to my staging branch.

Comment 8 Radka Skvarilova 2016-04-04 15:45:05 UTC
New package already show WWN right for all devices

#rpm -q udev
udev-147-2.72.el6.x86_64

#ls -lh /dev/disk/by-id/
total 0
lrwxrwxrwx. 1 root root  9 Apr  4 17:20 ata-QEMU_DVD-ROM_QM00003 -> ../../sr0
lrwxrwxrwx. 1 root root  9 Apr  4 17:20 ata-QEMU_HARDDISK_QM00001 -> ../../sda
lrwxrwxrwx. 1 root root  9 Apr  4 17:20 ata-QEMU_HARDDISK_QM00002 -> ../../sdb
lrwxrwxrwx. 1 root root 10 Apr  4 17:21 dm-name-vg_dhcp24174-lv_root -> ../../dm-0
lrwxrwxrwx. 1 root root 10 Apr  4 17:20 dm-name-vg_dhcp24174-lv_swap -> ../../dm-1
lrwxrwxrwx. 1 root root 10 Apr  4 17:20 dm-uuid-LVM-ozwVcmKLp9sSbMXv9w7OGUAR3xDeNxyaKl2JgAFjSe1PFOAV1KGFNkiE57JU3roj -> ../../dm-1
lrwxrwxrwx. 1 root root 10 Apr  4 17:21 dm-uuid-LVM-ozwVcmKLp9sSbMXv9w7OGUAR3xDeNxyaVrprYzYgcdJWwBlzVcycitKlIZ82vMmI -> ../../dm-0
lrwxrwxrwx. 1 root root 10 Apr  4 17:20 lvm-pv-uuid-eoYo3U-oSfq-EGP4-9dSI-bNd2-y0KS-BYXcZd -> ../../vda2
lrwxrwxrwx. 1 root root  9 Apr  4 17:20 scsi-SATA_QEMU_HARDDISK_QM00001 -> ../../sda
lrwxrwxrwx. 1 root root  9 Apr  4 17:20 scsi-SATA_QEMU_HARDDISK_QM00002 -> ../../sdb
lrwxrwxrwx. 1 root root  9 Apr  4 17:20 wwn-0x5000c50015ea71aa -> ../../sda
lrwxrwxrwx. 1 root root  9 Apr  4 17:20 wwn-0x5000c50015ea71bb -> ../../sdb
lrwxrwxrwx. 1 root root  9 Apr  4 17:20 wwn-0x5000c50015ea71cc -> ../../sr0

Comment 10 errata-xmlrpc 2016-05-11 00:27:04 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0903.html


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