Bug 1030301 - qemu-img can not merge live snapshot to backing file(r/w backing file via libiscsi)
Summary: qemu-img can not merge live snapshot to backing file(r/w backing file via lib...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm
Version: 7.0
Hardware: x86_64
OS: Linux
medium
high
Target Milestone: rc
: ---
Assignee: Jeff Cody
QA Contact: Virtualization Bugs
URL:
Whiteboard:
: 1032001 (view as bug list)
Depends On:
Blocks: 1080820
TreeView+ depends on / blocked
 
Reported: 2013-11-14 10:18 UTC by Jun Li
Modified: 2014-06-24 02:06 UTC (History)
14 users (show)

Fixed In Version: qemu-kvm-1.5.3-44.el7
Doc Type: Bug Fix
Doc Text:
Previously, when using libiscsi storage as the base image (backing file), qemu-img was not able to merge live snapshots to the backing file. Now, the issue has been fixed and live snapshots can be merged.
Clone Of:
Environment:
Last Closed: 2014-06-13 12:10:30 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:0985 0 normal SHIPPED_LIVE qemu-kvm bug fix and enhancement update 2014-07-29 23:34:16 UTC

Description Jun Li 2013-11-14 10:18:38 UTC
Description of problem:
using libiscsi storage as base image(backing file), qemu-img can not merge live snapshot to backing file.

Version-Release number of selected component (if applicable):
qemu-kvm-rhev-1.5.3-19.el7.x86_64
3.10.0-48.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.boot guest with following cli.
<cli>:
# /usr/libexec/qemu-kvm -S -M pc-i440fx-rhel7.0.0 -cpu SandyBridge -enable-kvm -m 4G -smp 4,sockets=2,cores=2,threads=1 -name juli -uuid 355a2475-4e03-4cdd-bf7b-5d6a59edaa68 -rtc base=localtime,clock=host,driftfix=slew \
-device virtio-scsi-pci,bus=pci.0,addr=0x5,id=scsi0 -drive file=iscsi://10.66.6.82:3260/iqn.2013-11.com.example:storage.disk1.juli.xyz/1,if=none,id=drive-scsi0-0-0,media=disk,cache=none,format=qcow2,werror=stop,rerror=stop,aio=native  -device scsi-hd,drive=drive-scsi0-0-0,bus=scsi0.0,scsi-id=0,lun=0,id=juli,bootindex=0 \
-drive file=iscsi://10.66.6.82:3260/iqn.2013-11.com.example:storage.disk1.juli.xyz/3,if=none,id=drive-virtio0-0-0,media=disk,werror=stop,rerror=stop,cache=none,format=qcow2 -device virtio-blk-pci,bus=pci.0,drive=drive-virtio0-0-0,id=virtio0-0-0 \
-drive file=/home/ISO/en_windows_8.1_preview_x86_dvd_2358833.iso,if=none,media=cdrom,format=raw,aio=native,id=drive-ide1-0-0 -device ide-drive,drive=drive-ide1-0-0,id=ide1-0-0,bus=ide.0,unit=0,bootindex=4 \
-device virtio-balloon-pci,id=ballooning \
-global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 \
-net none -k en-us -boot menu=on,reboot-timeout=-1,strict=on \
-qmp tcp:0:4477,server,nowait -serial unix:/tmp/ttyS0,server,nowait -vnc :3 -spice port=5939,disable-ticketing  -vga qxl -global qxl-vga.revision=3 -monitor stdio -monitor tcp:0:7777,server,nowait -monitor unix:/tmp/monitor1,server,nowait \
-netdev tap,id=tap1,vhost=on,queues=4,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown,ifname=tap-juli -device virtio-net-pci,netdev=tap1,id=nic1,mq=on,vectors=17,mac=1a:59:0a:4b:aa:94
2.Create live snapshot after guest log in
(qemu) snapshot_blkdev drive-scsi0-0-0 /home/S1.img
(qemu) snapshot_blkdev drive-scsi0-0-0 /home/S2.img
3.shutdown guest.
4.commit S1 to base image.
# qemu-img commit -f qcow2 /home/S1.img 

Actual results:
# qemu-img commit -f qcow2 /home/S1.img 
qemu-img: Image is read-only

Expected results:
After step 4, commit S1 to base image is successful.

Additional info:
Also test "Live commit with iSCSI", it works well.

After step 2, do "block-commit" via qmp as followings:
{ "execute": "block-commit", "arguments": { "device": "drive-scsi0-0-0", "base": "iscsi://10.66.6.82:3260/iqn.2013-11.com.example:storage.disk1.juli.xyz/1", "top": "/home/S1.img", "speed": 1000000000 } }
{"return": {}}
{"timestamp": {"seconds": 1384424071, "microseconds": 403388}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "drive-scsi0-0-0", "len": 32212254720, "offset": 32212254720, "speed": 1000000000, "type": "commit"}}

Comment 2 Paolo Bonzini 2013-11-19 10:57:59 UTC
*** Bug 1032001 has been marked as a duplicate of this bug. ***

Comment 3 Paolo Bonzini 2013-11-22 14:31:23 UTC
Probably just a missing bdrv_reopen implementation.  Jeff, please write here if there's anything else and you'd like me to take a look.

Comment 4 Jeff Cody 2013-11-27 21:20:08 UTC
(In reply to Paolo Bonzini from comment #3)
> Probably just a missing bdrv_reopen implementation.  Jeff, please write here
> if there's anything else and you'd like me to take a look.

I think you are right, and I believe this is the same root cause as BZ 1031526.  I'll look at putting together a reopen implementation for gluster.

Comment 5 Jeff Cody 2014-01-27 23:12:19 UTC
patch posted.

Comment 6 Miroslav Rezanina 2014-01-29 07:01:55 UTC
Fix included in qemu-kvm-1.5.3-44.el7

Comment 8 huiqingding 2014-02-11 03:25:30 UTC
Reproduce this bug using the following version:
qemu-kvm-rhev-1.5.3-43.el7.x86_64
kernel-3.10.0-84.el7.x86_64

Steps to Reproduce:
1.boot guest with following cli.
# /usr/libexec/qemu-kvm -M pc -cpu SandyBridge -enable-kvm -m 4G -smp 4,sockets=2,cores=2,threads=1 -name juli -uuid 355a2475-4e03-4cdd-bf7b-5d6a59edaa68 -rtc base=localtime,clock=host,driftfix=slew -device virtio-scsi-pci,bus=pci.0,addr=0x5,id=scsi0 -drive file=iscsi://10.66.90.100:3260/iqn.2001-05.com.equallogic:0-8a0906-6aa1f7d03-60ff49b423b52f87-s2-huding-277437-1/0,if=none,id=drive-scsi0-0-0,media=disk,format=raw,werror=stop,rerror=stop,aio=native  -device scsi-hd,drive=drive-scsi0-0-0,bus=scsi0.0,scsi-id=0,lun=0,id=juli,bootindex=1 -device virtio-balloon-pci,id=ballooning -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -net none -k en-us -boot menu=on,reboot-timeout=-1,strict=on -qmp tcp:0:4477,server,nowait -serial unix:/tmp/ttyS0,server,nowait -vnc :3 -spice port=5939,disable-ticketing  -vga qxl -global qxl-vga.revision=3 -monitor stdio -monitor tcp:0:7777,server,nowait -monitor unix:/tmp/monitor1,server,nowait -netdev tap,id=tap1,vhost=on,queues=4,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown,ifname=tap-juli -device virtio-net-pci,netdev=tap1,id=nic1,mq=on,vectors=17,mac=1a:59:0a:4b:aa:94
2.Create live snapshot after guest log in
(qemu) snapshot_blkdev drive-scsi0-0-0 /home/S1.img
(qemu) snapshot_blkdev drive-scsi0-0-0 /home/S2.img
3.shutdown guest.
4.commit S1 to base image.
# qemu-img commit -f qcow2 /home/S1.img 

Actual results:
# qemu-img commit -f qcow2 /home/S1.img 
qemu-img: Image is read-only

Verify this bug using the following version:
qemu-kvm-rhev-1.5.3-45.el7.x86_64
kernel-3.10.0-84.el7.x86_64

Steps to Verification:
1.boot guest with following cli.
# /usr/libexec/qemu-kvm -M pc -cpu SandyBridge -enable-kvm -m 4G -smp 4,sockets=2,cores=2,threads=1 -name juli -uuid 355a2475-4e03-4cdd-bf7b-5d6a59edaa68 -rtc base=localtime,clock=host,driftfix=slew -device virtio-scsi-pci,bus=pci.0,addr=0x5,id=scsi0 -drive file=iscsi://10.66.90.100:3260/iqn.2001-05.com.equallogic:0-8a0906-6aa1f7d03-60ff49b423b52f87-s2-huding-277437-1/0,if=none,id=drive-scsi0-0-0,media=disk,format=raw,werror=stop,rerror=stop,aio=native  -device scsi-hd,drive=drive-scsi0-0-0,bus=scsi0.0,scsi-id=0,lun=0,id=juli,bootindex=1 -device virtio-balloon-pci,id=ballooning -global PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 -net none -k en-us -boot menu=on,reboot-timeout=-1,strict=on -qmp tcp:0:4477,server,nowait -serial unix:/tmp/ttyS0,server,nowait -vnc :3 -spice port=5939,disable-ticketing  -vga qxl -global qxl-vga.revision=3 -monitor stdio -monitor tcp:0:7777,server,nowait -monitor unix:/tmp/monitor1,server,nowait -netdev tap,id=tap1,vhost=on,queues=4,script=/etc/qemu-ifup,downscript=/etc/qemu-ifdown,ifname=tap-juli -device virtio-net-pci,netdev=tap1,id=nic1,mq=on,vectors=17,mac=1a:59:0a:4b:aa:94
2.Create live snapshot after guest log in
(qemu) snapshot_blkdev drive-scsi0-0-0 /home/S1.img
(qemu) snapshot_blkdev drive-scsi0-0-0 /home/S2.img
3.shutdown guest.
4.commit S1 to base image.
# qemu-img commit -f qcow2 /home/S1.img 

Actual results:
# qemu-img commit -f qcow2 /home/S1.img 
Image committed.

Based on the above result, I think this bug has been fixed.

Comment 11 Ludek Smid 2014-06-13 12:10:30 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


Note You need to log in before you can comment on or make changes to this bug.