I run quite a number of virtual machines on a bare metal server in a data center, and most of those are almost identical copies of virtual machines running at home. So my strategy so far for a failure of that server has been to restore service with another set of copies of the VMs running at home. But in recent months, I have started to run a number of VMs there for which I do not have a master on my home server. So I needed a different backup/restore approach here.
I use QEMU/KVM for virtualization on my network servers, and creating a copy of a VM is as easy as copying the disk image file of the VM and transferring it to another place. The challenge: VM images tend to bloat quite a bit over their lifetime, particularly when snapshots are used, and transferring a 50 GB VM image over the Internet and relatively slow VDSL downlink takes quite a bit of time. The solution: Compacting and compressing the image before transfer. Turns out that has an interesting effect on VM snapshots, which are also stored as part of the disk image, that one should be aware of.
Continue reading Shrinking a KVM Virtual Machine Image – What About Snapshots?