Bug 1467271

Summary: <auth> element missing after shallow blockcopy and blockcommit
Product: Red Hat Enterprise Linux 7 Reporter: Han Han <hhan>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED DUPLICATE QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: dyuan, lmen, pkrempa, rbalakri, xuzhang
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1467287 (view as bug list) Environment:
Last Closed: 2017-07-03 10:55:17 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:
Bug Depends On:    
Bug Blocks: 1467287    

Description Han Han 2017-07-03 09:50:52 UTC
Description of problem:
As subject

Version-Release number of selected component (if applicable):
libvirt-3.2.0-14.el7.x86_64
qemu-kvm-rhev-2.9.0-14.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Prepare a CHAP iscsi server. Define a libvirt secret object and set the password in the secret.
2. Start VM on iscsi backend with authorization like this:
 <disk type='network' device='disk' snapshot='no'>
      <driver name='qemu' type='raw'/>
      <auth username='redhat'>
        <secret type='iscsi' usage='libvirtiscsi'/>
      </auth>
      <source protocol='iscsi' name='iqn.2016-12.com.virttest:emulated-iscsi-auth.target6/0'>
        <host name='XX.XX.XX.XX'/>
      </source>
      <backingStore/>
      <target dev='vdi' bus='virtio'/>
      <alias name='virtio-disk8'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x11' function='0x0'/>
    </disk>

3. Create a external snapshot for the disk. Then do shallow blockcopy and blockcommit:
# virsh snapshot-create-as hh s1 --no-metadata --disk-only --diskspec vdi,file=/var/lib/libvirt/images/hh-vdi.s1
Domain snapshot s1 created

# virsh blockcopy hh vdi /var/lib/libvirt/images/hh-vdi.s1.copy --shallow --pivot --wait --verbose --transient-job
Block Copy: [100 %]

# virsh blockcommit hh vdi --shallow --keep-relative --wait --verbose --pivot
Block commit: [100 %]

# virsh dumpxml hh
<disk type="network" device="disk" snapshot="no">
      <driver name="qemu" type="raw"/>
      <source protocol="iscsi" name="iqn.2016-12.com.virttest:emulated-iscsi-auth.target6/0">
        <host name="10.66.5.92"/>
      </source>
      <backingStore/>
      <target dev="vdi" bus="virtio"/>
      <alias name="virtio-disk8"/>
      <address type="pci" domain="0x0000" bus="0x00" slot="0x11" function="0x0"/>
    </disk>

<auth> is missing.

Actual results:
As above

Expected results:
<auth> remains after these operations

Additional info:
Without shallow blockcopy, this bug cannot be reproduced with blockcommit only.

Comment 2 Peter Krempa 2017-07-03 10:55:17 UTC
I've repurposed bug 1171569 to track all blockjobs and all protocols, since it does not make sense to file separate bugs for the same issue.

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