kvm/libvirt backup: how to ensure a consistent fs during online blockcommit?

muffel asked:

I want to create online backups of a KVM Windows 10 virtual machine that is managed by libvirt. I have the qemu agent setup in the guest.

If found this wiki entry that suggests the following:

1. create an offline snapshot

$ virsh snapshot-create-as --domain my-vm my-snapshot \
    --diskspec vda,file=/export/images/overlay.qcow2 \
    --disk-only --atomic --quiesce

2. backup the base image

$ my-backup-tool /path/to/base.image

3. merge fs changes that occured after the snapshot back into the base image

$ virsh blockcommit my-vm hda --active --verbose --pivot

4. remove snapshot

$ virsh snapshot-delete my-vm --metadata my-snapshot

My question: It is suggested by the articcle to provide the --quiesce parameter to ensure a consistent snapshot creating (i.e. freeze fs activity during creation), but wouldn’t one need to do the same for step 3 with the help of e.g. virsh domfsfreeze? What happens with ongoing fs activity during the blockcommit?

My answer:


Actually you do not want to freeze the filesystem during the blockcommit. That would result in a lengthy delay while blocks are being copied from one image to the other. Because, before and during the copy, one (or both) of the two always represents the actual filesystem state, there’s no higher chance of data loss.


View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.