Bug 1228007
| Summary: | Using virsh attach-device fail to hotplug iscsi or fc lun volume with --config/--persistent option | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Pei Zhang <pzhang> |
| Component: | libvirt | Assignee: | John Ferlan <jferlan> |
| Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 7.2 | CC: | dyuan, mzhan, ravi.mishra, rbalakri, rick.beldin, xuzhang, yanyang |
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | libvirt-1.2.17-1.el7 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-11-19 06:40:06 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Pei Zhang
2015-06-04 04:45:05 UTC
Ahh... this is because the config/persistent path didn't translate the source pool for the config/persistent path... Sent patch upstream: http://www.redhat.com/archives/libvir-list/2015-June/msg00555.html Patch has been pushed upstream:
$ commit 785a8940eff01223fc813abaaf331c8a8225ec0c
Author: John Ferlan <jferlan>
Date: Thu Jun 11 17:07:38 2015 -0400
scsi: Need to translate disk source pool in config attach path
When attaching a scsi volume lun via the attach-device --config or
--persistent options, there was no translation of the source pool
like there was for the live path, thus the attempt to modify the config
would fail since not enough was known about the disk.
$ git describe 785a8940eff01223fc813abaaf331c8a8225ec0c
v1.2.16-144-g785a894
$
Verify version:
libvirt-1.2.17-5.el7.x86_64
qemu-kvm-rhev-2.3.0-18.el7.x86_64
verify steps:
1.check document.
# firefox /usr/share/doc/libvirt-docs-1.2.17/html/formatdomain.html
check
source --> volume :
Using a LUN from an iSCSI source pool provides the same features as a disk configured using type 'block' or 'network and device of 'lun' with respect to how the LUN is presented to and may used by the guest.
For iscsi pool :
2. Using virsh attach-device to hotplug iscsi or fc lun volume with --config/--persistent option
prepare a iscsi pool and a healthy domain.
# virsh vol-list iscsi-pool
Name Path
------------------------------------------------------------------------------
unit:0:0:1 /dev/disk/by-path/ip-&IP:3260-iscsi-iqn.2008-09.5.165.3ffe.104:server.target3-lun-1
# cat vol-lun-scsi-host.xml
<disk type='volume' device='lun'>
<driver name='qemu' type='raw'/>
<source pool='iscsi-pool' volume='unit:0:0:1' mode='host'/>
<backingStore/>
<target dev='sde' bus='scsi'/>
</disk>
2.1 attach volume lun disk with --persistent option.
# virsh attach-device r720 vol-lun-scsi-host.xml --persistent
Device attached successfully
# virsh dumpxml r720| grep disk -A 9
......
<disk type='volume' device='lun'>
<driver name='qemu' type='raw'/>
<source pool='iscsi-pool' volume='unit:0:0:1' mode='host'/>
<backingStore/>
<target dev='sde' bus='scsi'/>
<alias name='scsi0-0-0-4'/>
<address type='drive' controller='0' bus='0' target='0' unit='4'/>
</disk>
......
login guest to check , the disk can be found in guest.
detach-device to hotunplug it.
# virsh detach-device r720 vol-lun-scsi-host.xml --persistent
Device detached successfully
2.2 attach volume lun disk with --config option.
# virsh attach-device r720 vol-lun-scsi-host.xml --config
Device attached successfully
# virsh destroy r720;virsh start r720
Domain r720 destroyed
Domain r720 started
# virsh dumpxml r720| grep disk -A 9
<disk type='volume' device='lun'>
<driver name='qemu' type='raw'/>
<source pool='iscsi-pool' volume='unit:0:0:1' mode='host'/>
<backingStore/>
<target dev='sde' bus='scsi'/>
<alias name='scsi0-0-0-4'/>
<address type='drive' controller='0' bus='0' target='0' unit='4'/>
</disk>
login guest to check , the disk can be found in guest.
3.domain xml validate
# virsh dumpxml r720 --inactive > r7new.xml
# cat r7new.xml |grep disk -A 9
<disk type='volume' device='lun'>
<driver name='qemu' type='raw'/>
<source pool='iscsi-pool' volume='unit:0:0:1' mode='host'/>
<target dev='sde' bus='scsi'/>
<address type='drive' controller='0' bus='0' target='0' unit='4'/>
</disk>
# virt-xml-validate r7new.xml
r7new.xml validates
4.For FC pool
prepare a FC pool
# virsh vol-list scsi5_pool
Name Path
------------------------------------------------------------------------------
unit:0:3:0 /dev/disk/by-id/wwn-0x600a0b80005adb0b0000ab2d4cae9254
# cat vol-lun-scsi.xml
<disk type='volume' device='lun'>
<driver name='qemu' type='raw'/>
<source pool='scsi5_pool' volume='unit:0:3:0'/>
<backingStore/>
<target dev='sde' bus='scsi'/>
</disk>
# virsh attach-device r7-zp vol-lun-scsi.xml --persistent
Device attached successfully
login guest to check
# virsh attach-device r7-zp vol-lun-scsi.xml --config
Device attached successfully
# virsh destroy r7-zp;virsh start r7-zp
Domain r7-zp destroyed
Domain r7-zp started
login guest to check
As above, move to verified.
*** Bug 1230179 has been marked as a duplicate of this bug. *** *** Bug 1230179 has been marked as a duplicate of this bug. *** 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/RHBA-2015-2202.html |