Let’s say there is server with a 32GB ssd drive hosting the core system (ubuntu 16.04 server) and 2 x 1TB drives forming a btrfs RAID1.
how would I ideally add an lxd storage pool to that scenario if I do not want to add another hard drive? LXD should be snap LXD.
from the top of my head …
create a loop drive on the RAID1
mount --bind /dev/loopX /var/snap/lxd/common/lxd/ (*1)
that would put all containers and images on the btrfs RAID, so I guess I need some location for the lxd storage pool. Maybe another loop device? getting lost
(*1) the equivalent of /var/lib/lxd when lxd runs from the snap package)
If your raid1 is formatted as btrfs, you could just create a subvolume on it, then mount that subvolume on /var/snap/lxd/common/lxd/.
Something like:
btrfs subvolume create /data/lxd/
mount --bind /data/lxd /var/snap/lxd/common/lxd/
In “lxd init”, you can then select “btrfs” as the storage pool backend, tell it not to create a new pool, then give it “/var/snap/lxd/common/lxd/storage-pools/default/” as the path to an existing subvolume.