Red Hat Bugzilla – Bug 972964
WWN option for Hot Attaching SCSI Disks
Last modified: 2016-04-26 09:56:25 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:
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.
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.
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]
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