Bug 831099 - add the ability to set a wwn for SCSI disks
add the ability to set a wwn for SCSI disks
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
6.3
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Osier Yang
Virtualization Bugs
:
Depends On: 831102
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-12 03:55 EDT by Paolo Bonzini
Modified: 2013-02-21 02:17 EST (History)
9 users (show)

See Also:
Fixed In Version: libvirt-0.10.2-0rc1.el6
Doc Type: Enhancement
Doc Text:
Feature: Libvirt introduced new XML to set WWN for IDE and SCSI disk. Reason: WWNs provide stable device paths that are the same for IDE and SCSI disks. Result (if any): Besides a serial number, one can also set WWN for IDE and SCSI disk.
Story Points: ---
Clone Of:
: 831102 (view as bug list)
Environment:
Last Closed: 2013-02-21 02:17:03 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)

  None (edit)
Description Paolo Bonzini 2012-06-12 03:55:22 EDT
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.
Comment 1 Paolo Bonzini 2012-06-12 03:57:14 EDT
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.
Comment 7 Osier Yang 2012-08-30 00:43:00 EDT
Patch posted upstream:

https://www.redhat.com/archives/libvir-list/2012-August/msg01853.html
Comment 8 Osier Yang 2012-09-18 03:03:44 EDT
https://www.redhat.com/archives/libvir-list/2012-September/msg01220.html

Patches committed to upstream. Move to POST.
Comment 11 weizhang 2012-09-20 04:36:43 EDT
It depends on bug https://bugzilla.redhat.com/show_bug.cgi?id=831102
so we will wait for this qemu-kvm bug fixed.
Comment 12 weizhang 2012-11-26 01:38:08 EST
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
Comment 13 weizhang 2012-11-26 02:10:33 EST
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
Comment 14 errata-xmlrpc 2013-02-21 02:17:03 EST
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

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