I’m trying to work out the best (simplest and most efficient) way to backup and restore my ZFS pool backed LXD containers whilst retaining all snapshots intact.
I would prefer to do this by backing up the lxd config and using the
zfs send command to backup the LXD containers dataset onto a ZFS dataset on a remote machine not running LXD. The backing up bit should be easy enough but it is the restore process I’m not sure about as I’m really hoping to avoid having to create any tarballs for the rootfs because one of my containers root disk is about 165 GB so creating and restoring tarballs is quite a lengthy process.
Looking at the output of
lxc image import --help it appears that I might indeed be able to import a container from a directory/dataset without having to create a tarball of the rootfs first. Is this the case? I’m not sure because I don’t think that the help output for
lxc image import is correct anyway because it neglects to mention the need for the metadata tarball. As I understand it, the correct way to use lxc image import with tarballs is like so:
$ lxc image import <metadata tarball> <rootfs tarball>
I’m OK with having to use a metadata tarball to import my rootfs directory/dataset into LXD but I’m hoping there is no need to provide a rootfs tarball and that I will simply be able to point it to a directory (ZFS dataset) on my LXD server and it would restore all the snapshots correctly so that LXD is aware of them.
If this is not currently possible could this feature be added please or is there another way to pull this off without rootfs tarballs?