Andrew Martin
2012-Aug-17 14:27 UTC
[libvirt-users] Live Snapshot and Rebasing using blockpull
Hello, I am looking for a solution for live backups of running KVM hosts. I recently read this article which highlights the following method: http://www.linux-kvm.com/content/first-look-virtual-machine-online-disk-snapshots-coming-fedora-18 1. virsh snapshot-create-as to create the snapshot 2. cp myvm.qcow2 myvm-backup.qcow2 to copy off the now read-only backing image file 3. virsh blockpull to merge the base and snapshot images together into a single image again Is this functionality only available in qemu 1.1? I am using Ubuntu 12.04 LTS on production servers which only includes qemu 1.0.x. Is there a safe alternative for accomplishing live backups like this on qemu 1.0.x? Is there a minimum version of libvirt that supports this behavior? Thanks, Andrew -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20120817/0d086a6a/attachment.htm>
Eric Blake
2012-Aug-17 14:43 UTC
[libvirt-users] Live Snapshot and Rebasing using blockpull
On 08/17/2012 08:27 AM, Andrew Martin wrote:> > 1. virsh snapshot-create-as to create the snapshot > 2. cp myvm.qcow2 myvm-backup.qcow2 to copy off the now read-only backing image file > 3. virsh blockpull to merge the base and snapshot images together into a single image againYep. As long as you don't mind the single image changing names, this works (and if you _do_ mind it changing names, you can do the process twice to get back to the original name, although that's obviously not very efficient). There are future improvements coming down the pipeline for even more efficient block manipulations, but they missed the qemu 1.2 cutoff, so now I have to wait for qemu 1.3 (probably closer to December of this year) before having libvirt control over those features - but I am actively working on this area of code.> > > Is this functionality only available in qemu 1.1?snapshot-create-as was introduced in libvirt 0.9.5, and requires the qemu 'blockdev-snapshot-sync' monitor command (since 0.14.0), but prefers the 'transaction' monitor command (since 1.1) for safety. blockpull was introduced in libvirt 0.9.4, and requires the qemu 'block-stream' monitor command (since 1.1).> I am using Ubuntu 12.04 LTS on production servers which only includes qemu 1.0.x. Is there a safe alternative for accomplishing live backups like this on qemu 1.0.x? Is there a minimum version of libvirt that supports this behavior?It sounds like you can take snapshots but not merge them back while your domain is online, because your qemu is too old. But you can use 'qemu-img' to do offline merging, if having your domain offline is not an issue. -- Eric Blake eblake at redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 620 bytes Desc: OpenPGP digital signature URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20120817/0071e7c8/attachment.sig>