LXD pool on a 2 mirrored HDDs - How?

I have a 19.10 server running on SSD. I have 2 WD 1TB HDDs, which I want to get mirrored and to create 1 partition there, where I’ll put LXD pool with multiple containers. Should I create mirror with LVM first and then LXD pool there? Which filesystem to use?

Also, I need to be sure that if I’d like to move mirror to another server it won’t be super hard. Plus, if 1 hdd fails, I’d like to be able to connect another one to another PC with Windows to perform a backup.

Yeah, LXD API doesn’t let you configure that directly so you either need to add the second drive after the fact or configure the whole thing yourself and just tell LXD to use it.

So, is it a good idea to use lvm?
Which FS is better to use for this partition?
What combination is best for LXD?

If using LVM, you’d want to create a new VG with a PV on each disk and then give that VG for LXD to use directly using the lvm storage driver.

1 Like

Ah, so I can map to a VG directly! Very cool!
And is such config, in your opinion, reliable?

Yeah, giving an existing VG to the LXD LVM driver is perfectly fine.
Just make sure you never have anything else use that VG. It must be completely dedicated to LXD (we have a check for that at creation time but we can’t detect later tempering).

vgcreate blah PV1 PV2
lxc storage create default lvm source=blah

Is the gist of how to make that work.

LVM isn’t our favorite storage driver since it relies on a block device per container, making it a bit slower to create containers, also not quite as nice to migrate between systems (a full rsync is used). But it does support all our features and is actively tested.