Question about storage configuration

Hey, I recently install and start to use LXD as system container for deep learning training. I’m confused about the storage configuration.

  1. I see the storage pool saves files in /var/lib/lxd/storage-pools, so do I need to make sure that this dir on a btrfs or zfs partition?
  2. It seems that I could create a btrfs loop-backed pool on a ext4 partition too, but I have to specify the size. Is there any IO performance issue?
  3. It is said that:
  • Uses a subvolume per container, image and snapshot, creating btrfs snapshots when creating a new object.

about btrfs. It’s not clear. Do I need to create btrfs subvolume manual for each container, image or snapshot? Or LXD automatically handles this for users?

LXD handles it all for you.

If using btrfs loop, there is indeed an overhead (no clear measurements though) as a fully flushed write to btrfs will also need a matching write to ext4 for the loop device, so things can quickly get slow.

For production environments, using a dedicated disk or partition for your storage pool is certainly preferred.

So I could still use an ext4 or an xfs partition? I install LXD on a system that /var/lib is on an ext4 or xfs partition. Unfortunately, I have no extra unused partition for LXD.

Yep, that’s fine, you’ll just take a hit due to the double write with the loop, but the underlying filesystem can be anything.