1

I am experimenting with LXD. Since LXD is supposed to be aware of the capabilities of ZFS (copy-on-write, etc.), I set up a ZFS pool (consisting of a single, dedicated partition) to hold the containers. I then installed LXD and ran "lxd init". In the init-process, I instructed LXD to use ZFS, and pointed it to the existing ZFS pool.

When I then created a new container, LXD created two directories in the ZFS pool: "containers" and images". However, these directories are completely empty. The actual files are stored in /var/lib/lxd (on an ext4 partition, should that be important).

Probably I'm missing something obvious, but: what am I missing here? Why is LXD not using the ZFS pool handed to it during the "init" process?

Brad Richards
  • 1,233
  • 3
  • 13
  • 23

2 Answers2

0

Can't comment on original but having the same sort of problem. During lxd init, I chose ZFS for the backend, and it even created the containers and images directory in my zfs dataset. The issue seems to be it's not using it and still being stored in /var/lib/lxd/containers

Edit: Found the issue, check https://github.com/lxc/lxd/issues/1690.

"zfs list -t all" and you'll see that everything is indeed stored in zfs. Need to pay attention to those mountpoints.

poxin
  • 1
  • 1
0

i think may be your lxd pool points to the same /var/lib/lxd in my case pool is pointing to /var/lib/lxd

can you please check the zfspool list

NAME   SIZE  ALLOC   FREE  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
lxd   87.5G  1.09G  86.4G         -     7%     1%  1.00x  ONLINE  -

this is in my case

drwx--x--x 4 root   root      4096 Sep  1 13:39 .
drwxr-xr-x 9 lxd    nogroup   4096 Sep  4 11:21 ..
lrwxrwxrwx 1 root   root        35 Sep  1 13:39 CDaemon -> /var/lib        /lxd/containers/CDaemon.zfs
drwxr-xr-x 4 231072  231072      5 Aug 18 13:25 CDaemon.zfs
lrwxrwxrwx 1 root   root        42 Sep  1 13:14 GraphiteServer -> /var/lib/lxd/containers/GraphiteServer.zfs
drwxr-xr-x 4 231072  231072      5 Aug 18 13:25 GraphiteServer.zfs
Shailesh
  • 59
  • 6