Bug 1477880
Summary: | can't use default LUN of iscsi protocol used in network type virtual disk when don't specify the LUN | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Meina Li <meili> |
Component: | libvirt | Assignee: | John Ferlan <jferlan> |
Status: | CLOSED ERRATA | QA Contact: | Meina Li <meili> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 7.4 | CC: | dyuan, lmen, rbalakri, xuzhang, yisun |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | libvirt-3.8.0-1.el7 | Doc Type: | No Doc Update |
Doc Text: |
undefined
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2018-04-10 10:52:40 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
Meina Li
2017-08-03 06:53:34 UTC
not related to npiv, remove it from white board key word Strange this was never checked before - sometimes the power of the documentation does make believers. In any case, posted the following patch upstream to resolve: https://www.redhat.com/archives/libvir-list/2017-September/msg00122.html First patch had negative review, so v2 was generated: https://www.redhat.com/archives/libvir-list/2017-September/msg00248.html Primary difference is the XML is adjusted during post parse processing rather than during command creation. This results in a change to the output XML as well. Since QEMU didn't really support a non-supplied value, this should be fine. Patch has been pushed: commit f64f03b5b1e6f3ecd6c6d79316c3efedc00c2167 Author: John Ferlan <jferlan> Date: Mon Sep 11 19:18:21 2017 -0400 qemu: Provide default LUN=0 for iSCSI if not provided ... If the "/#" is missing from the provided iSCSI path, then we need to provide the default LUN of /0; otherwise, QEMU will fail to parse the URL causing a failure to either create the guest or hotplug attach the storage. During post parse, for any iSCSI disk or hostdev, scan the source path looking for the presence of '/', if found, then we can assume the LUN is provided. If not found, alter the input XML to add the "/0". This will cause the generated XML to have the generated value when the domain config is saved after post parse. $ git describe f64f03b5b1e6f3ecd6c6d79316c3efedc00c2167 v3.7.0-52-gf64f03b5b $ Test env components: kernel-3.10.0-734.el7.x86_64 libvirt-3.8.0-1.el7.x86_64 qemu-kvm-rhev-2.10.0-2.el7.x86_64 Steps to verify: Scenario 1: 1. iSCSI network disk XML(network-disk.xml): <disk type='network' device='disk'> <driver name='qemu' type='raw'/> <source protocol='iscsi' name='iqn.2003-01.org.linux-iscsi.hostname.x8664:sn.target1'> <host name='10.73.224.151' port='3260'/> </source> <target dev='vdb' bus='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x0b' function='0x0'/> </disk> 2. Attach/detach the disk and check the status: # virsh attach-device lmn network-disk.xml Device attached successfully # virsh domblklist lmn Target Source ------------------------------------------------ vda /var/lib/libvirt/images/lmn.qcow2 vdb iqn.2003-01.org.linux-iscsi.hostname.x8664:sn.target1/0 # virsh detach-device lmn network-disk.xml Device detached successfully Scenario 2: 1. iSCSI network lun XML(network-lun.xml): <disk type='network' device='lun'> <driver name='qemu' type='raw'/> <source protocol='iscsi' name='iqn.2003-01.org.linux-iscsi.hostname.x8664:sn.target1'> <host name='10.73.224.151' port='3260'/> </source> <target dev='sdb' bus='scsi'/> <address type='drive' controller='0' bus='0' target='0' unit='1'/> </disk> 2. Attach/detach the disk and check the status: # virsh attach-device lmn network-lun.xml Device attached successfully # virsh domblklist lmn Target Source ------------------------------------------------ vda /var/lib/libvirt/images/lmn.qcow2 sdb iqn.2003-01.org.linux-iscsi.hostname.x8664:sn.target1/0 # virsh detach-device lmn network-lun.xml Device detached successfully Scenario 3: 1. iSCSI hostdev with no scsi controller model: 1)Domain's scsi controller in XML: <controller type='scsi' index='0'> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </controller> 2)iSCSI hostdev XML(hostdev-lsi.xml) <hostdev mode='subsystem' type='scsi' managed='yes'> <source protocol='iscsi' name='iqn.2003-01.org.linux-iscsi.hostname.x8664:sn.target1'> <host name='10.73.224.151' port='3260'/> </source> <alias name='hostdev0'/> <address type='drive' controller='0' bus='0' target='0' unit='4'/> </hostdev> 2. Attach/ the host device and use 'fdisk -l' to check the device in guest: # virsh attach-device lmn hostdev-lsi.xml Device attached successfully # virsh detach-device lmn hostdev-lsi.xml Device detached successfully Scenario 4: 1. iSCSI hostdev with scsi controller model='virtio-scsi': 1)Domain's scsi controller in XML: <controller type='scsi' index='0' model='virtio-scsi'> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </controller> 2)iSCSI hostdev XML(hostdev-virtio.xml) <hostdev mode='subsystem' type='scsi' managed='yes'> <source protocol='iscsi' name='iqn.2003-01.org.linux-iscsi.hostname.x8664:sn.target1'> <host name='10.73.224.151' port='3260'/> </source> <alias name='hostdev0'/> <address type='drive' controller='0' bus='0' target='0' unit='4'/> </hostdev> 2. Attach the host device and use 'fdisk -l' to check the device in guest: # virsh attach-device lmn hostdev-virtio.xml Device attached successfully # virsh detach-device lmn hostdev-virtio.xml Device detached successfully The results are as expected, move this bug to be verified. 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://access.redhat.com/errata/RHEA-2018:0704 |