Linux – nyway to do a live qcow2 backup without pausing vm’s

backupkvm-virtualizationlibvirtlinux

I'm trying to setup a KVM backup solution for our servers that would take live backups without stopping the system.

I Found several ready scripts which i have tested, but they all either stop or "freeze" the VM for a little while, to save memory state. But this is no good for us.

We have few custom application that write logs, that need to be consistent and we cannot have 10-60second pauses while system is "freezed" for the duration of backups, also this "freeze" causes the VM's clock to be out of sync ( clock is behind by the duration of the "freeze) which in term messes with our custom sofware, where one of its functions is to monitor some measuring equipments timestamps.

So where question is, is there a way to do full VM backups that can be done consistently without freezing the VM and restore of backup should work aswell 🙂

here is one of the several scripts i have tried for an example:
KVM QCOW2 Live backup

Best Answer

The easiest and most common solution would be to take a live snapshot of the VM (fsfreeze/flush/use the qemu-ga to maintain fs consistency before taking the snapshot), back up the underlying image, while the VM writes to the snapshot, and then merge the two when the backup is complete.

Related Topic