Red Hat Bugzilla – Bug 831099
add the ability to set a wwn for SCSI disks
Last modified: 2013-02-21 02:17:03 EST
Description of problem: In addition to a serial number, upstream QEMU allows to set a disk's WWN. The feature is enabled for IDE disks in 1.1, and will be added to SCSI disks as well in 1.2. We would like to backport this to RHEL6, but we need libvirt support. The <disk> element should grow a <wwn> sub-element whose contents must be composed of 16 hexadecimal digits.
The WWN can be examined in the guest with "sudo sg_inq -p 0x83 /dev/sda", and should also be visible in /dev/disk/by-id. For example with a <wwn>5000c50015ea71ad</wwn> element sg_vpd will show something like: Designation descriptor number 1, descriptor length: 12 designator_type: NAA, code_set: Binary associated with the addressed logical unit NAA 5, IEEE Company_id: 0xc50 Vendor Specific Identifier: 0x15ea71ad [0x5000c50015ea71ad] Specifying a <serial> and <wwn> element together should also be tested.
Patch posted upstream: https://www.redhat.com/archives/libvir-list/2012-August/msg01853.html
https://www.redhat.com/archives/libvir-list/2012-September/msg01220.html Patches committed to upstream. Move to POST.
It depends on bug https://bugzilla.redhat.com/show_bug.cgi?id=831102 so we will wait for this qemu-kvm bug fixed.
Verify pass on libvirt-0.10.2-9.el6.x86_64 qemu-kvm-0.12.1.2-2.334.el6.x86_64 kernel-2.6.32-329.el6.x86_64 Start guest with xml <disk type='file' device='disk'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/scsi.img'/> <target dev='sda' bus='scsi'/> <serial>cdcdcd</serial> <wwn>5000c60016ea71ad</wwn> </disk> Login to the guest and check # sg_inq -p 0x83 /dev/sda VPD INQUIRY: Device Identification page Designation descriptor number 1, descriptor length: 10 designator_type: vendor specific [0x0], code_set: ASCII associated with the addressed logical unit vendor specific: cdcdcd Designation descriptor number 2, descriptor length: 12 designator_type: NAA, code_set: Binary associated with the addressed logical unit NAA 5, IEEE Company_id: 0xc60 Vendor Specific Identifier: 0x16ea71ad [0x5000c60016ea71ad] So Verify pass
Also test with scsi-cd <disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/var/lib/libvirt/images/images/tt.img'/> <target dev='sdc' bus='scsi'/> <readonly/> <serial>aababab</serial> <wwn>5001c60016ea71ad</wwn> </disk> Login to the guest and check # sg_inq -p 0x83 /dev/sr0 VPD INQUIRY: Device Identification page Designation descriptor number 1, descriptor length: 11 designator_type: vendor specific [0x0], code_set: ASCII associated with the addressed logical unit vendor specific: aababab Designation descriptor number 2, descriptor length: 12 designator_type: NAA, code_set: Binary associated with the addressed logical unit NAA 5, IEEE Company_id: 0x1c60 Vendor Specific Identifier: 0x16ea71ad [0x5001c60016ea71ad] so also verify pass for scsi-cd
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. http://rhn.redhat.com/errata/RHSA-2013-0276.html