How re-install with new zfs configuration

I have a server with 8 disks which I would like to reconfigure into a lxd host with zfs.

Its currently running a few containers which I would like to move out, re-install the host, then import them back using the new configuration.

What would a process look like to “backup” the containers and get them back again after the “re-installation” of the host? I have a separate computer which I might be able to use to “upload”/“migrate” to if that is the easiest way. How will my zfs situation need to look like for that to work?

Easiest if that other computer has LXD is to add it as a remote with lxc remote add, then stop your containers and lxc move them over. It will work better (faster) if that other computer also uses ZFS though it doesn’t matter exactly how that’s setup, can be the stock loop file.

Alternatively you could use lxc export --optimized to get tarballs of each containers, but that will take more time and resources, though will work even if the other computer isn’t running LXD as you’ll just have a bunch of files to keep safe until you have LXD back up and running.

1 Like