Professional Documents
Culture Documents
WWW Gonzalomarcote Com 2014 KVM Live Backups With Qcow2
WWW Gonzalomarcote Com 2014 KVM Live Backups With Qcow2
Pgina personal
Inicio
Perfil
Profile
Proyectos
Goals
Contacto
I was looking for some resources to do one simple guest disk live backup without stooping the guest.
And it was resulting difficult to me to find one official, simple and elegant way of doing it. All the options ends with
the guest running with another snapshot disk.
After spending some time reading I have found this:
http://wiki.libvirt.org/page/Live-disk-backup-with-active-blockcommit
So the process to do one live disk backup while the guest is running (with qcow disks of course), could be this one:
1. List the current block device in use:
# virsh domblklist hermes
open in browser PRO version
pdfcrowd.com
Target Source
-----------------------------------------------vda /var/lib/libvirt/images/hermes.qcow2
2. Create an external disk snapshot:
# virsh snapshot-create-as --domain hermes hermes-snap1 --disk-only --atomic --quiesce
disk-only -> option, takes the snapshot only for the disk
atomic -> just ensures either the snapshot is run completely or fails w/o making any
changes
quiesce -> if you have QEMU guest agent installed in your virtual machine (apt-get
install qemu-guest-agent), try quiesce option with virsh snapshot-create-as[. . .] to
ensure you have a consistent disk state. Check this post for install it ->
http://www.gonzalomarcote.com/2014/qemu-guest-agent/
3. Now that the guest is using the external snapshot disk we can take a backup of the original disk in backround
using your faviourite tool. Rsync for example:
# rsync -avh --progress /var/lib/libvirt/images/hermes.qcow2
/mnt/local/nas/backups/libvirt/images/hermes-snap1.qcow2
4. When the backup is finished, perform active blockcommit by live mergning contents of hermes-snap1 into base:
# virsh blockcommit hermes vda --active --verbose --pivot
open in browser PRO version
pdfcrowd.com
pdfcrowd.com
You forgot deleting the snapshot disk file after virsh snapshot-delete hermes hermes-snap1 metadata
Otherwise you will not be able to repeat the process, because the snapshot file already exists.
open in browser PRO version
pdfcrowd.com
$ rm /mnt/local/nas/backups/libvirt/images/hermes-snap1.qcow2
QEMU Guest Agent | Gonzalo Marcote | Open source, open mind dice:
3 diciembre, 2014 a las 21:59
[] This option is necessary for use virsh snapshot-create-as quiesce option that ensures you have a
consistent disk state when you do live backups (check http://www.gonzalomarcote.com/2014/kvm-live-backupswith-qcow2) []
Deja un comentario
Tu direccin de correo electrnico no ser publicada. Los campos obligatorios estn marcados con *
Comentario
pdfcrowd.com
Nombre *
Correo electrnico *
Web
Publicar comentario
pdfcrowd.com