Red Hat Bugzilla – Bug 676982
RFE: no qmp command for live snapshot
Last modified: 2015-03-04 19:52:38 EST
Description of problem: There should be qmp command for live snapshot. we have qemu monitor command (qemu) snapshot_blkdev [device] [new-image-file] [format]. Version-Release number of selected component (if applicable): qemu-kvm-0.12.1.2-2.144.el6.x86_64 How reproducible: 100% Steps to Reproduce: 1.start guest with qmp -qmp tcp:0:4444,server 2.query all qmp commands {"execute":"query-commands"} Actual results: no related live snapshot commands Expected results: There should be qmp command for live snapshot. Additional info:
Jiri, Do you need this for libvirt? In which case, what is the timeframe for it? Thanks, Jes
Patch posted for upstream QEMU. Please review it to make sure it does what you need.
Verified on qemu-kvm-0.12.1.2-2.175.el6, have "blockdev-snapshot-sync" command already and the command works well. Steps: 1. Boot a guest /usr/libexec/qemu-kvm -m 2G -smp 2 -cpu cpu64-rhel6,+x2apic -usbdevice tablet -drive file=/home/RHEL-Server-6.1-64-virtio.qcow2,format=qcow2,if=none,id=drive-ide0-0-0,werror=stop,rerror=stop,cache=none -device virtio-blk-pci,drive=drive-ide0-0-0,id=ide0-0-0 -netdev tap,id=hostnet0,script=/etc/qemu-ifup -device e1000,netdev=hostnet0,mac=00:10:2a:25:1a:58,bus=pci.0,addr=0x6 -boot c -uuid 8d4fefcc-2f16-4de3-9005-fb1d651c732f -rtc-td-hack -no-kvm-pit-reinjection -monitor stdio -qmp tcp:0:4444,server,nowait -name rhel6.1 -vnc :10 -device virtio-balloon-pci,bus=pci.0,id=balloon0 2. Using dd to create a file inside base image. 3. {"execute":"blockdev-snapshot-sync","arguments":{"device":"drive-ide0-0-0","snapshot-file":"/home/sn-1","format":"qcow2"}} {"return": {}} 4. {"execute":"query-block"} {"return": [{"device": "drive-ide0-0-0", "locked": false, "removable": false, "inserted": {"ro": false, "drv": "qcow2", "backing_file": "/home/RHEL-Server-6.1-64-virtio.qcow2", "encrypted": false, "file": "/home/sn-1"}, "type": "hd"}, {"device": "ide1-cd0", "locked": false, "removable": true, "type": "cdrom"}, {"device": "floppy0", "locked": false, "removable": true, "type": "floppy"}, {"device": "sd0", "locked": false, "removable": true, "type": "floppy"}]} 5.Check the file created in base image, it exists. Create another file "file_sn1". 6. (qemu)commmit drive-ide0-0-0 or { "execute": "human-monitor-command","arguments": { "command-line": "commit drive-ide0-0-0"}} 7. shutdown guest and boot base image again, the file "file_sn1" exists. 8. Re-test with IDE block again, the result is the same as virtio. So, this bug is verified pass.
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: No technote needed as this feature was pulled from 6.2
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. http://rhn.redhat.com/errata/RHSA-2011-1531.html