Bug 972964 - WWN option for Hot Attaching SCSI Disks
WWN option for Hot Attaching SCSI Disks
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt (Show other bugs)
7.0
All Linux
unspecified Severity medium
: rc
: ---
Assigned To: John Ferlan
Virtualization Bugs
: Upstream
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-10 19:28 EDT by Jim McEvoy
Modified: 2016-04-26 09:56 EDT (History)
9 users (show)

See Also:
Fixed In Version: libvirt-1.2.7-1.el7
Doc Type: Bug Fix
Doc Text:
Cause: Support was added to only add a WWN (World Wide Name) for a disk to libvirt via XML. Consequence: Cannot use virsh to define a WWN, rather the user must virsh edit the guest XML file and add the XML for the disk. Fix: Add --wwn to virsh attach-disk command Result: The following command would attach the test.img to a virtual machine as a SCSI device via virsh virsh attach-disk rhel7.1 /var/lib/libvirt/images/test.img sdb --driver qemu --subdriver raw --type disk --sourcetype file --wwn 5000c60016ea71ad --cache none
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-03-05 02:20:46 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 Jim McEvoy 2013-06-10 19:28:17 EDT
Description of problem:
When bug 831099 was fixed to allow assigning World Wide Names to SCSI disks the virsh command attach-disk was not updated to include a --wwn option.  Currently the only way to assign a wwn is by using an xml snippet.  When I pointed this out to Osier he said that it was an oversight and he has alredy committed a fix to git.  This bug is just to track the fix into the next Errata.

Version-Release number of selected component (if applicable):
RHEL 6.4 

How reproducible:
Every time.

Steps to Reproduce:
1.virsh attach-disk --source /dev/mapper/KVM-vol02 --target sdg --wwn=5000c60016ea71a --type=disk --domain Unity01 --config --cache none
2.
3.

Actual results:
error: command 'attach-disk' doesn't support option --wwn

Expected results:
Disk attached successfully

Additional info:
Comment 2 Jiri Denemark 2013-06-24 05:02:10 EDT
Fixed upstream by v1.0.6-15-g232240d:

commit 232240d0958fa967cee88d688b48e1bc1c0e1008
Author: Osier Yang <jyang@redhat.com>
Date:   Tue Jun 4 11:27:04 2013 +0800

    virsh: Allow attach-disk to specify disk wwn
    
    Commit 6e73850b01ee support to set wwn for disks, but it was not
    exposed to attach-disk.
Comment 6 Jiri Denemark 2014-04-04 17:37:44 EDT
This bug was not selected to be addressed in Red Hat Enterprise Linux 6. We will look at it again within the Red Hat Enterprise Linux 7 product.
Comment 8 Xuesong Zhang 2014-11-24 07:53:52 EST
Test with the following packages, this bug is verified.

Package version:
libvirt-1.2.8-8.el7.x86_64
qemu-kvm-rhev-2.1.2-12.el7.x86_64
kernel-3.10.0-208.el7.x86_64

Steps:
1. prepare one running guest.
# virsh list --all
 Id    Name                           State
----------------------------------------------------
 23    rhel7.1                        running


2. hot-plug the disk with wwn option via parameter
# virsh attach-disk rhel7.1  /var/lib/libvirt/images/test.img sdb --driver qemu --subdriver raw --type disk --sourcetype file --wwn 5000c60016ea71ad --cache none
Disk attached successfully

3. checking the dumpxml, the disk and wwn is correct.
# virsh dumpxml rhel7.1
......
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw' cache='none'/>
      <source file='/var/lib/libvirt/images/test.img'/>
      <backingStore/>
      <target dev='sdb' bus='scsi'/>
      <wwn>5000c60016ea71ad</wwn>
      <alias name='scsi0-0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
......

4. login the guest, the wwn of disk in guest is correct also.
# sg_inq -p 0x83 /dev/sdb
VPD INQUIRY: Device Identification page
  Designation descriptor number 1, descriptor length: 21
    designator_type: vendor specific [0x0],  code_set: ASCII
    associated with the addressed logical unit
      vendor specific: drive-scsi0-0-0-1
  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]
Comment 10 errata-xmlrpc 2015-03-05 02:20:46 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.

https://rhn.redhat.com/errata/RHSA-2015-0323.html

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