Bug 1534490

Summary: [RFE] Add support for all backing file in backing chain are network disk type in libvirt
Product: Red Hat Enterprise Linux 7 Reporter: Meina Li <meili>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED DUPLICATE QA Contact: Han Han <hhan>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.5CC: hhan, jiyan, lmen, pkrempa, rbalakri, xuzhang, yisun
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-01-22 08:46:10 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 2018-01-15 11:11:02 UTC
Description of problem:
Recently libvirt can't introspect the backing chain for certain storage
technologies, thus the <backingStore> elements are missing for them. And we hope it can support all backing file in backing chain are network disk type.

Version-Release number of selected component (if applicable):
libvirt-3.9.0-7.el7.x86_64
qemu-kvm-rhev-2.10.0-15.el7.x86_64

How reproducible:
100%

Steps to Reproduce:

1. Prepare a guest with iscsi network disk.

2. Create backing file.
# qemu-img create -f qcow2 -b iscsi://**IP**:3260/iqn.2003-01.org.linux-iscsi.localhost.x8664:sn.9cba196611e6/0 iscsi://**IP**:3260/iqn.2003-01.org.linux-iscsi.localhost.x8664:sn.a8d92ebb4ece/0 -o backing_fmt=qcow2

3. Check backing chain info.
# qemu-img info iscsi://**IP*8:3260/iqn.2003-01.org.linux-iscsi.localhost.x8664:sn.a8d92ebb4ece/0 --backing-chain
image: json:{"driver": "qcow2", "file": {"lun": "0", "portal": "**IP**:3260", "driver": "iscsi", "transport": "tcp", "target": "iqn.2003-01.org.linux-iscsi.localhost.x8664:sn.a8d92ebb4ece"}}
file format: qcow2
virtual size: 5.0G (5368709120 bytes)
disk size: unavailable
cluster_size: 65536
backing file: iscsi://**IP**:3260/iqn.2003-01.org.linux-iscsi.localhost.x8664:sn.9cba196611e6/0
backing file format: qcow2
Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16
    corrupt: false

image: json:{"driver": "qcow2", "file": {"lun": "0", "portal": "**IP**:3260", "driver": "iscsi", "transport": "tcp", "target": "iqn.2003-01.org.linux-iscsi.localhost.x8664:sn.9cba196611e6"}}
file format: qcow2
virtual size: 5.0G (5368709120 bytes)
disk size: unavailable
cluster_size: 65536
Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16
    corrupt: false

4. Start guest with the last layer and check guest xml.
# virsh dumpxml rhel7 | grep disk -A 9
...
    <disk type='network' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source protocol='iscsi' name='iqn.2003-01.org.linux-iscsi.localhost.x8664:sn.a8d92ebb4ece/0'>
        <host name='**IP**' port='3260'/>
      </source>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </disk>
...

Actual results:
As above step4.

Expected results:
# virsh dumpxml rhel7 | grep disk -A 9
...
    <disk type='network' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source protocol='iscsi' name='iqn.2003-01.org.linux-iscsi.localhost.x8664:sn.a8d92ebb4ece/0'>
        <host name='**IP**' port='3260'/>
         <backingStore type='network' index='1'>
            <format type='qcow2'/>
             <source protocol='iscsi' name='iqn.2003-01.org.linux-iscsi.localhost.x8664:sn.9cba196611e6/0'>     
               <host name='**IP**' port='3260'/>
             </source>                                                    --
           </backingStore>
      </source>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk1'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x09' function='0x0'/>
    </disk>
...

Additional info:

Comment 4 Peter Krempa 2018-01-22 08:46:10 UTC
This will be superseded by allowing the full backing chain to be specified in the XML explicitly rather than trying to detect it.

*** This bug has been marked as a duplicate of bug 760547 ***