I would try to snapshot more than only live / running VMs’ committed writes. I host all of my VMs at current in ZFS and snapshot regularly, I’m a fan of this method. In the same script, however, I also throw an empty indicator file (“on” or “off”) in the mount point prior to snapshotting. This way, I can run a simple `find /dataset/path/ -name “on”` to find all the ‘good’ restore points to clone from, if need be (you could also just append it to the snapshot name).

I’ve had some difficulties getting live / running snapshots to work in a manner that doesn’t cause my servers to freeze for a few moments. I’d definitely like to learn the proper way to do this; I’d like to take regular (e.g. hourly) live quiesced backups of Windows- and Linux-based servers that store (external) state data in a subdirectory at the disks’ mount point in my storage array, rather than the default location (which is not all that useful as it’d fill up my host’s OS drive). But again, I’ve found that I experience network traffic loss to the VMs with the current flags.

109         eval "virsh snapshot-create-as --domain $VM --atomic —memspec file=$path/$(MEM_FILE),snapshot=external$devs"                                                         

where `$devs` is a string that’s built as


 95     # Append all the disks to a string iteratively.                                                                                                                           
 96     devs=""                                                                                                                                                                   
 97     for dev in $(virsh domblklist "$VM" | tail -n +3 | head -n -1 \                                                                                                           
 98         | awk '{ print $1 }')                                                                                                                                                 
 99     do                                                                                                                                                                        
100         devs="$devs --diskspec $dev,snapshot=external,file=$path/$(DISK_FILE "$dev")                                                                                     101     done 

I could probably clean this up or make it simpler somehow (wrote it quite a while ago), but I’d appreciate any / all suggestions.

Brandon

On Sep 10, 2019, at 4:49 PM, Daniel Romero <romero.cl@gmail.com> wrote:

have you tried to use direct access to block devices using lvm in your vm's and then do backups with lvm snapshots?

I'm currently migrating all my "images" vm's to "lvm" vm's because taking live snapshots is very easy this way. In your case live and offline snapshot script should be the same.


Regards.
Daniel Romero P.



On Tue, Sep 10, 2019 at 5:38 PM Tim Schumacher <tim@timakro.de> wrote:
Hi,

I followed the instructions on the wiki
https://wiki.libvirt.org/page/Live-disk-backup-with-active-blockcommit
for a live disk backup. Unfortunately this is not working when the
domain is offline because the active blockcommit throws

error: Requested operation is not valid: domain is not running

For my use case it should be possible for the domain to shut down while
the backup is in progress. I'm looking for a way to shorten the backing
chain after the backup finishes and the domain is offline.

Is there a way to let libvirt decide wether to shorten the backing chain
using blockcommit or some alternative way which works on offline
domains?

As I'm writing this I might as well ask about the current state of
"incremental backups". It seems like dirty bitmaps can keep track of
which blocks changed and just copy those to the backup. Is there some
libvirt command-line frontend for that or is it planned for the future?

Thanks.

- Tim
_______________________________________________
libvirt-users mailing list
libvirt-users@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users
_______________________________________________
libvirt-users mailing list
libvirt-users@redhat.com
https://www.redhat.com/mailman/listinfo/libvirt-users