Like the title says

Create the dataset

$ sudo zfs create host1-nvme1/encrypted/lxd-pool1

$ sudo lxc storage create zfs-nvme1-lxd-pool1 zfs source=host1-nvme1/encrypted/lxd-pool1 Storage pool zfs-nvme1-lxd-pool1 created

$ lxc storage list +———————+——–+————————————–+————-+———+———+ | NAME | DRIVER | SOURCE | DESCRIPTION | USED BY | STATE | +———————+——–+————————————–+————-+———+———+ | lxd2_btrfs | btrfs | b68eea46-f489-4a6f-a90d-4aef0b4d0dd5 | | 10 | CREATED | +———————+——–+————————————–+————-+———+———+ | zfs-nvme1-lxd-pool1 | zfs | host1-nvme1/encrypted/lxd-pool1 | | 0 | CREATED | +———————+——–+————————————–+————-+———+———+

Migrate your container

$ lxc snapshot mirror-alpn transfer

$ lxc copy mirror-alpn/transfer –storage zfs-nvme1-lxd-pool1 mirror-alpn2 Transferring instance: mirror-alpn: 265.98MB (8.33MB/s)

Inspect

$ sudo ls -l /media/host1-nvme1/encrypted/lxd-pool1 total 0

$ zfs list -ro space host1-nvme1/encrypted/lxd-pool1

NAME AVAIL USED USEDSNAP USEDDS USEDREFRESERV USEDCHILD host1-nvme1/encrypted/lxd-pool1 473G 1.64G 0B 192K 0B 1.64G host1-nvme1/encrypted/lxd-pool1/buckets 473G 192K 0B 192K 0B 0B host1-nvme1/encrypted/lxd-pool1/containers 473G 1.63G 0B 192K 0B 1.63G host1-nvme1/encrypted/lxd-pool1/containers/mirror-alpn2 473G 1.63G 0B 1.63G 0B 0B host1-nvme1/encrypted/lxd-pool1/custom 473G 192K 0B 192K 0B 0B host1-nvme1/encrypted/lxd-pool1/deleted 473G 1.12M 0B 192K 0B 960K host1-nvme1/encrypted/lxd-pool1/deleted/buckets 473G 192K 0B 192K 0B 0B host1-nvme1/encrypted/lxd-pool1/deleted/containers 473G 192K 0B 192K 0B 0B host1-nvme1/encrypted/lxd-pool1/deleted/custom 473G 192K 0B 192K 0B 0B host1-nvme1/encrypted/lxd-pool1/deleted/images 473G 192K 0B 192K 0B 0B host1-nvme1/encrypted/lxd-pool1/deleted/virtual-machines 473G 192K 0B 192K 0B 0B host1-nvme1/encrypted/lxd-pool1/images 473G 192K 0B 192K 0B 0B host1-nvme1/encrypted/lxd-pool1/virtual-machines 473G 192K 0B 192K 0B 0B

$ lxc storage info zfs-nvme1-lxd-pool1 info: description: "" driver: zfs name: zfs-nvme1-lxd-pool1 space used: 1.64GiB total space: 474.16GiB used by: instances:

  • mirror-alpn2

Add a storage volume

$ sudo zfs create host1-nvme1/encrypted/lxd-volume-testing

$ lxc storage volume create zfs-nvme1-lxd-pool1 testing-vol1 --type=filesystem
Storage volume testing-vol1 created

$ sudo zfs list -r host1-nvme1/encrypted/lxd-pool1
NAME                                                          USED  AVAIL     REFER  MOUNTPOINT
host1-nvme1/encrypted/lxd-pool1                              3.29G   471G      192K  legacy
host1-nvme1/encrypted/lxd-pool1/buckets                       192K   471G      192K  legacy
host1-nvme1/encrypted/lxd-pool1/containers                   3.29G   471G      192K  legacy
host1-nvme1/encrypted/lxd-pool1/containers/gitea-alpn         463M   471G      463M  legacy
host1-nvme1/encrypted/lxd-pool1/containers/mirror-alpn       1.63G   471G     1.63G  legacy
host1-nvme1/encrypted/lxd-pool1/containers/wallabag2         1.21G   471G     1.21G  legacy
host1-nvme1/encrypted/lxd-pool1/custom                        384K   471G      192K  legacy
host1-nvme1/encrypted/lxd-pool1/custom/default_testing-vol1   192K   471G      192K  legacy
host1-nvme1/encrypted/lxd-pool1/deleted                      1.12M   471G      192K  legacy
host1-nvme1/encrypted/lxd-pool1/deleted/buckets               192K   471G      192K  legacy
host1-nvme1/encrypted/lxd-pool1/deleted/containers            192K   471G      192K  legacy
host1-nvme1/encrypted/lxd-pool1/deleted/custom                192K   471G      192K  legacy
host1-nvme1/encrypted/lxd-pool1/deleted/images                192K   471G      192K  legacy
host1-nvme1/encrypted/lxd-pool1/deleted/virtual-machines      192K   471G      192K  legacy
host1-nvme1/encrypted/lxd-pool1/images                        192K   471G      192K  legacy
host1-nvme1/encrypted/lxd-pool1/virtual-machines              192K   471G      192K  legacy

Notice this line: host1-nvme1/encrypted/lxd-pool1/custom/default_testing-vol1