"Differential" Backups of QEMU VM disks?
I have multiple TBytes of QEMU VM disks / disk images (.img and .qcow2) and am currently using rsync to backup all files to HDDs.
As rsync basically replaces the old version of a disk image by writing the complete new version onto the HDDs, it is terribly slow. For example sometimes it has to write 500GB because I booted a VM.
Is there a recommended solution which allows to only write the changes, instead of the whole disk using rsync or something that nicely integrates into a rsync script?
About this post
- Posted
- Archived
- Score
- 3 · 81% up
- Kind
- Text
- ID
- 17cntps
2 comments
I've been struggling with the same thing, and I've been thinking a bit about it again recently, since I'm planning on setting up a new NAS. In the past, for rsync I read a whole bunch of posts regarding in-place sync, and other options to efficiently sync a large file. When I finally got it working so that it did an in-place sync, it was actually slower than just copying the whole file.
In theory, I'd imagine you'd need some process that creates check-sums for "blocks" of the source file, and compares that against a checksum file at the destination. Then if a block matches the check-sum, don't copy, otherwise do. For an image file I would guess that it would function reasonably well, as I wouldn't expect you'd have any inserts or deletes like you would with a text file. It shouldn't shift and become misaligned so that at some part during the process none of the check-sums match anymore. I haven't really looked to see if there are any programs that do this.
Ideally however, you'd be able to only get the changes, so maybe one option is to use something like external snapshots, which from what I understand puts the changes in a separate file rather than internally in the same .qcow2. You'd only have to copy the external snapshot as the base image should remain the same.
The other possible option I've been thinking about is to run the VMs on a zfs zvol block device, and then using zfs snapshots and zfs send to only get the differences. I have no idea if that will actually work or not.
Kopia
I am on it only for few months, but so far so good.... the draw to it is that it seems like the endgame backup utility. That it has everything and runs on everything.
Heres some useful deployment info.