Need help on KVM and snapshots
Karl Auer
kauer at biplane.com.au
Sat May 9 13:28:22 UTC 2020
Warning - long question :-)
I'm trying to get my head around snapshots in KVM - specifically the
variety created using virsh.
So I am hoping there is someone out there that can save me hours of
experimentation and tell me how to back up a qcow2 virtual disk!
The only method I have right now is to
- use virsh to stop the VM
- use virsh to dump the machine definition to a file
- copy the definition and virtual disk file somewhere safe
- use virsh to start the VM
This definitely works, and I have successfully restored from such a
backup. On a virtual disk hundreds of gigabytes in size, this takes a
good while thouigh, and the VM is stopped the whole time.
This is the most coherent alternative recipe I have found so far:
https://wiki.libvirt.org/page/Live-disk-backup-with-active-blockcommit
What I don't understand in that article is why the base image stops
changing when the snapshot is made. Or, put another way, why the so-
called "snapshot" becomes the live disk! This seems to be the complete
opposite of what I think a snapshot should be - an unchanging record of
a filesystem at a point in time.
I do not want to have to rely on "--quiesce" but I can find little
information on how important it is. Perhaps I need to stop the VM, take
the snapshot, then start the VM before continuing to take the backup?
It would be a short interruption, and acceptable for my workloads.
Finally, I don't see how I go back to not using the snapshot after the
backup is finished. I.e., how do I get the changed information from the
snapshot back into the original image? If I just delete the snapshot,
does the VM revert to usingthe (unchanged?) original virtual disk?
"virsh blockcommit" looks like the answer, but given my haziness on
which layer in the virtual disk is actually being used, it will only
make sense to me when I understand the earlier questions, I think.
If you have *you yourself personally* backed up running KVM virtuals
with qcow2 virtual disks I'd love to hear from you :-)
Off-list is fine, too.
Many hopeful thanks in advance, K.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer at biplane.com.au)
http://www.biplane.com.au/kauer
http://twitter.com/kauer389
GPG fingerprint: 2561 E9EC D868 E73C 8AF1 49CF EE50 4B1D CCA1 5170
Old fingerprint: 8D08 9CAA 649A AFEF E862 062A 2E97 42D4 A2A0 616D
More information about the ubuntu-users
mailing list