Lxc export on remote machine

Hi,

I run many LXD containers and VMs in a local ZFS partition and the containers and VMs can sometimes be 200GB+. The Ubuntu ext4 root partition is up to 30GB.

When I try to export CTs or VMs remotely it uses my EXT4 partition on the host instead of the ZFS pool on the host.

lxc remote switch <servername>
lxc export <CT> CT-backup-$(date +'%m-%d-%Y').tar.xz --optimized-storage

I would like it to use my 1TB ZFS Pool for the export (temp data) instead of the / 30GB EXT4 partition.

How can I do this? Would be much easier than lxc copy in the backup process.

Does setting storage.backups_volume help?

Maybe… The ZFS pool is dedicated for LXD.

zfs list

NAME                                                                          USED  AVAIL     REFER  MOUNTPOINT
LXD                                                                           777M   821G       96K  legacy
LXD/buckets                                                                    96K   821G       96K  legacy
LXD/containers                                                               29.8M   821G       96K  legacy
LXD/containers/lc-backup-01                                                  29.7M   186G      757M  legacy
LXD/custom                                                                     96K   821G       96K  legacy
LXD/deleted                                                                   576K   821G       96K  legacy
LXD/deleted/buckets                                                            96K   821G       96K  legacy
LXD/deleted/containers                                                         96K   821G       96K  legacy
LXD/deleted/custom                                                             96K   821G       96K  legacy
LXD/deleted/images                                                             96K   821G       96K  legacy
LXD/deleted/virtual-machines                                                   96K   821G       96K  legacy
LXD/images                                                                    739M   821G       96K  legacy
LXD/images/ad...                                                           739M   821G      739M  legacy
LXD/virtual-machines                                                           96K   821G       96K  legacy

zpool list

NAME   SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP    HEALTH  ALTROOT
LXD    848G   777M   847G        -         -     0%     0%  1.00x    ONLINE  -

Can I use the default LXD pool for this? Or do I need a second pool for this? That’s the point right now.

You need to specify a volume - so I don’t see a reason why you can’t create a volume in any pool you wish to use and specify that one.
Or are you asking about recommendations on what makes most sense to make sure the backups aren’t lost? In that case, keeping them in the local pool is probably not the best idea.

You can indeed use any pool for the backup volume.