Backup VM images or snapshots

Hello all,

I see this thread Backup the container and install it on another server discussing creating backups of containers and exporting them to remote hosts.

I am using a cluster with a ceph storage pool to run VMs. The thing here is I would like to be able to export images of the snapshots (in some sort of image format like qcow2 or .img) once daily and send to a backup storage host. I can’t figure out where I would access those like one would for containers in order to create tarballs.

/var/snap/lxd/common/lxd/storage-pools/default/virtual-machines-snapshots/$vmname/$snapshotname is empty even though the snapshots exist

/var/snap/lxd/common/lxd/storage-pools/default/virtual-machines/$vmname is also empty

As mentioned in the thread we can abuse the image distribution system with image export but I would like the VM to be running during the process which I’m not sure this will achieve.

Any suggestions would be appreciated!

lxc publish when run against a snapshot doesn’t cause the VM to be stopped, so that may be an option.

As you’re using Ceph, I wonder if you considered having your backup site run a small Ceph cluster and use rbd-mirror to automate the syncing of specific Ceph volumes between the two locations.

That’s what I’ve started to use when I need to have data replicated between datacenters and I’ve found that to be pretty low overhead (ceph keeps track of what changed and sends the streams) and quite reliable (can run in HA mode with multiple instances of the mirror).