Bug 1200726

Summary: Active commit does not support on rbd based disk
Product: Red Hat Enterprise Linux 6 Reporter: Jun Li <juli>
Component: qemu-kvmAssignee: Jeff Cody <jcody>
Status: CLOSED NEXTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.7CC: areis, dyuan, hhuang, juzhang, michen, mkenneth, mzhan, qzhang, rbalakri, rpacheco, virt-bugs, virt-maint, xfu, xuzhang, yanyang
Target Milestone: rc   
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: 1189998 Environment:
Last Closed: 2017-11-29 20:51:45 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: 1189998    
Bug Blocks:    

Description Jun Li 2015-03-11 09:51:06 UTC
+++ This bug was initially created as a clone of Bug #1189998 +++

Description of problem:
Inactive blockcommit with rbd based disk works well. But active blockcommit does NOT work.

Version-Release number of selected component (if applicable):
libvirt-1.2.8-16.el7.x86_64
qemu-kvm-rhev-2.1.2-23.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.define/start a guest with the following xml

<disk type='network' device='disk'>
      <driver name='qemu' type='raw'/>
      <source protocol='rbd' name='libvirt-pool/rbd1.img'>
      <config file='/etc/ceph.conf'/>
      </source>
      <target dev='vda' bus='virtio'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </disk>

virsh start vm3
Domain vm3 started

# virsh list --all
 Id    Name                           State
----------------------------------------------------
 24    vm3                            running

2. check qemu command line
# ps -ef|grep qemu
qemu     19364     1 42 11:04 ?        00:00:15 /usr/libexec/qemu-kvm -name vm3 -S -machine pc-i440fx-rhel7.0.0,accel=kvm,usb=off -cpu SandyBridge -m 1024 -realtime mlock=off -smp 1,sockets=1,cores=1,threads=1 -uuid 00469895-ad03-4033-96c5-19c5da2f3ee3 -no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/vm3.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc,driftfix=slew -global kvm-pit.lost_tick_policy=discard -no-hpet -no-shutdown -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -boot strict=on -device ich9-usb-ehci1,id=usb,bus=pci.0,addr=0x5.0x7 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x6 -drive file=rbd:libvirt-pool/rbd1.img:auth_supported=none:conf=/etc/ceph.conf,if=none,id=drive-virtio-disk0,format=raw -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x8,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1
......

3. create 3 external snapshots
# for i in {1..3}; do virsh snapshot-create-as vm3 s$i --disk-only --diskspec vda,file=/tmp/vm1.s$i; done
Domain snapshot s1 created
Domain snapshot s2 created
Domain snapshot s3 created

# qemu-img info /tmp/vm1.s3 --backing-chain
image: /tmp/vm1.s3
file format: qcow2
virtual size: 5.0G (5368709120 bytes)
disk size: 1.1M
cluster_size: 65536
backing file: /tmp/vm1.s2
backing file format: qcow2
Format specific information:
    compat: 1.1
    lazy refcounts: false

image: /tmp/vm1.s2
file format: qcow2
virtual size: 5.0G (5368709120 bytes)
disk size: 196K
cluster_size: 65536
backing file: /tmp/vm1.s1
backing file format: qcow2
Format specific information:
    compat: 1.1
    lazy refcounts: false

image: /tmp/vm1.s1
file format: qcow2
virtual size: 5.0G (5368709120 bytes)
disk size: 196K
cluster_size: 65536
backing file: rbd:libvirt-pool/rbd1.img:auth_supported=none:conf=/etc/ceph.conf
backing file format: raw
Format specific information:
    compat: 1.1
    lazy refcounts: false

image: rbd:libvirt-pool/rbd1.img:auth_supported=none:conf=/etc/ceph.conf
file format: raw
virtual size: 5.0G (5368709120 bytes)
disk size: unavailable
cluster_size: 4194304

4. check domain xml
<disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/tmp/vm1.s3'/>
      <backingStore type='file' index='1'>
        <format type='qcow2'/>
        <source file='/tmp/vm1.s2'/>
        <backingStore type='file' index='2'>
          <format type='qcow2'/>
          <source file='/tmp/vm1.s1'/>
          <backingStore type='network' index='3'>
            <format type='raw'/>
            <source protocol='rbd' name='libvirt-pool/rbd1.img'>
              <config file='/etc/ceph.conf'/>
            </source>
            <backingStore/>
          </backingStore>
        </backingStore>
      </backingStore>
      <target dev='vda' bus='virtio'/>
      <alias name='virtio-disk0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
    </disk>

5. do active commit
# virsh blockcommit vm3 vda --wait --verbose --active
error: internal error: unable to execute QEMU command 'block-commit': 
Block format 'rbd' used by device '' does not support feature 'reopening of file'

6. do blockcommit from middle to base
# virsh blockcommit vm3 vda --wait --verbose --top /tmp/vm1.s2
Block Commit: [100 %]
Now in synchronized phase

# qemu-img info /tmp/vm1.s3 --backing-chain
image: /tmp/vm1.s3
file format: qcow2
virtual size: 5.0G (5368709120 bytes)
disk size: 1.1M
cluster_size: 65536
backing file: rbd:libvirt-pool/rbd1.img:auth_supported=none:conf=/etc/ceph.conf
backing file format: raw
Format specific information:
    compat: 1.1
    lazy refcounts: false

image: rbd:libvirt-pool/rbd1.img:auth_supported=none:conf=/etc/ceph.conf
file format: raw
virtual size: 5.0G (5368709120 bytes)
disk size: unavailable
cluster_size: 4194304

Actual results:
In step 5, active commit with rbd based disk does NOT work
In step 6, inactive commit works well

Expected results:
Support active commit with rbd based disk

Additional info:
2015-02-06 03:09:43.200+0000: 19024: debug : qemuMonitorIOProcess:399 : QEMU_MONITOR_IO_PROCESS: mon=0x7fba70010070 buf={"id": "libvirt-100", "error": {"class": "GenericError", "desc": "Block format 'rbd' used by device '' does not support feature 'reopening of file'"}}^M
 len=152
2015-02-06 03:09:43.200+0000: 19024: debug : qemuMonitorJSONIOProcessLine:183 : Line [{"id": "libvirt-100", "error": {"class": "GenericError", "desc": "Block format 'rbd' used by device '' does not support feature 'reopening of file'"}}]
2015-02-06 03:09:43.200+0000: 19024: debug : virJSONValueFromString:1136 : string={"id": "libvirt-100", "error": {"class": "GenericError", "desc": "Block format 'rbd' used by device '' does not support feature 'reopening of file'"}}
2015-02-06 03:09:43.200+0000: 19024: debug : qemuMonitorJSONIOProcessLine:203 : QEMU_MONITOR_RECV_REPLY: mon=0x7fba70010070 reply={"id": "libvirt-100", "error": {"class": "GenericError", "desc": "Block format 'rbd' used by device '' does not support feature 'reopening of file'"}}
2015-02-06 03:09:43.200+0000: 19024: debug : qemuMonitorJSONIOProcess:252 : Total used 152 bytes out of 152 available in buffer
2015-02-06 03:09:43.201+0000: 19025: debug : virJSONValueToString:1303 : result={"id":"libvirt-100","error":{"class":"GenericError","desc":"Block format 'rbd' used by device '' does not support feature 'reopening of file'"}}
2015-02-06 03:09:43.201+0000: 19024: debug : virEventPollCleanupHandles:576 : Cleanup 13
2015-02-06 03:09:43.201+0000: 19025: debug : qemuMonitorJSONCheckError:370 : unable to execute QEMU command {"execute":"block-commit","arguments":{"device":"drive-virtio-disk0","speed":0,"top":"/tmp/vm1.s3","base":"rbd:libvirt-pool/rbd1.img:auth_supported=none:conf=/etc/ceph.conf"},"id":"libvirt-100"}: {"id":"libvirt-100","error":{"class":"GenericError","desc":"Block format 'rbd' used by device '' does not support feature 'reopening of file'"}}