In some cases, virtual machines in an LXD cluster are not created because there are no root datasets in the ZFS pool.
Diagnostics
- Connect to the server with the ZFS storage via SSH.
-
Enter the command:
zfs list
Examples of responses for the zfs0 pool:
Root datasets are createdNAME USED AVAIL REFER MOUNTPOINT zfs0 1.97G 36.3G 24K legacy zfs0/containers 24K 36.3G 24K legacy zfs0/custom 24K 36.3G 24K legacy zfs0/deleted 120K 36.3G 24K legacy zfs0/deleted/containers 24K 36.3G 24K legacy zfs0/deleted/custom 24K 36.3G 24K legacy zfs0/deleted/images 24K 36.3G 24K legacy zfs0/deleted/virtual-machines 24K 36.3G 24K legacy zfs0/images 1.97G 36.3G 24K legacy zfs0/virtual-machines 24K 36.3G 24K legacy
No root datasetsNAME USED AVAIL REFER MOUNTPOINT zfs0 1.97G 36.3G 24K legacy
Solution
If there are no root datasets in the pool, create them manually:
- Connect to the server with the ZFS storage via SSH.
-
Run the commands:
zfs create -o mountpoint=legacy zfs0/containers zfs create -o mountpoint=legacy zfs0/custom zfs create -o mountpoint=legacy zfs0/deleted zfs create -o mountpoint=legacy zfs0/deleted/containers zfs create -o mountpoint=legacy zfs0/deleted/custom zfs create -o mountpoint=legacy zfs0/deleted/images zfs create -o mountpoint=legacy zfs0/deleted/virtual-machines zfs create -o mountpoint=legacy zfs0/images zfs create -o mountpoint=legacy zfs0/virtual-machines
Comments to the commands