I want to create backups of my running KVM VMs using virsh (qcow2). The VMs don't have snapshots, but in order to create a clean backup I want to create a snapshot, back up the backing file then discard (merge back to running file) the snapshot.
Most importantly, I need to be able to restore these, too.
What I don't want is to suspend or stop the VM at any point during backup except for the instant during the creation and removal of the snapshot.
So far I have the following.
BACKUP
# virsh snapshot-create-as VM_NAME SNAPSHOT_NAME --disk-only --quiesce <BACKUP_PATH/VM_NAME.img>
# virsh dumpxml VM_NAME > <BACKUP_PATH>/VM_NAME.xml
// do backup like rsync, ftp, cp, etc. of the VM_NAME.img and VM_NAME.xml
# virsh snapshot-delete VM_NAME SNAPSHOT_NAME
RESTORE
// assuming the VM is shut down or deleted, copy VM_NAME.img to the desired folder
// ensure xml file has correct path to VM_NAME.img
# virsh define <BACKUP_PATH>/VM_NAME.xml
Is this about right?