I got a Ubuntu (hardy) system used for virtualization using KVM. Each guest got it's own qcow2 file used as disk. Guests are running Ubuntu (hardy). What would a good backup strategy be for such a setup? I would prefer not to shutdown the guests during backup.
2 Answers
You'll want to coordinate that within the guest .. ideally you:
- Cause any RDBMS running in the guest to flush its cache
- Tell Linux to sync disks (sysrq S or just type 'sync')
Then just make a qcow2 snapshot of the guest. You then have a read-only immutable copy of the guest FS as it was when you took the snapshot.
This page offers a lot more information than you probably wanted to know on how snapshots (and qcow2 itself) works. See also the accepted answer to this question.
-
Can I do the snapshot "online"? Do you know of any tools that can help? – rkthkr Oct 27 '09 at 09:34
I was looking for similar solution, now I'm using software RAID+LVM2 volume for libvirt storage, I've taken a snapshot and few times (about 8-10) I had to revert to backup and it worked, even if Win guest said: unclean shutdown. I'm not using hardware RAID anyway, software is enough but prorably SCSI/SAS + HW RAID + battery backup is the best solution for LVM2 snapthots (due to double write to different places on hard disks when snapshot is taken). I always use full-filled RAW volume files or even direct attached drive/partition, recenty I've enabled write cache for VMs drives which increased write speed A LOT! Now I'm considering QCOW2's built-in snapshots to turn off LVM2, becouse it's very slow when compared to RAW partition, like EXT4.
- 11
- 1