Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 972964 - WWN option for Hot Attaching SCSI Disks
Summary: WWN option for Hot Attaching SCSI Disks
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: John Ferlan
QA Contact: Virtualization Bugs
Depends On:
TreeView+ depends on / blocked
Reported: 2013-06-10 23:28 UTC by Jim McEvoy
Modified: 2016-04-26 13:56 UTC (History)
9 users (show)

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
Clone Of:
Last Closed: 2015-03-05 07:20:46 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2015:0323 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2015-03-05 12:10:54 UTC

Description Jim McEvoy 2013-06-10 23:28:17 UTC
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

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 09:02:10 UTC
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 21:37:44 UTC
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 12:53:52 UTC
Test with the following packages, this bug is verified.

Package version:

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'/>
      <target dev='sdb' bus='scsi'/>
      <alias name='scsi0-0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>

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

Comment 10 errata-xmlrpc 2015-03-05 07:20:46 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.


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