LXD on Intel NUC — storage?

Hello,

I’ve had in mind to deploy LXD locally on an Inel NUC for some time. But one thing has held me back: I don’t understand how to configure storage.

My NUC has two drives: 1) A 1 TB NMVe SSD with OS; 2) A 1TB SSD spinning drive.

My inclination is to use ZFS mirrored across the two drives. But I don’t understand how to configure it.

— is this suitable or is there a better way?

— If so, please provide or point me to specific configuration steps.

Many thanks,

LRP

Going with a mirrored pool sounds like a good idea. You can do this by partitioning the NVME and the SSD to have an OS partition and another for the zpool. This is exactly what I do on my machines; I use btrfs for the OS partition to have a mirrored rootfs and a I give LXD a mirrored zpool.

FYI, when you lxd init, you can only provide it one block device/partition to use for the zpool. You will need to turn that single dev zpool into a mirrored one. This is easily done after the fact, see man 8 zpool-attach for the details.

Either that or setup the pool first and then tell lxd to use it by giving it the zpool name.

1 Like

Many thanks, Simon

Please excuse my inexperience and ignorance.

At the moment I have a plain-vanilla Ubuntu 22.04 install with content in the file system. I like your idea of mirrored OS based on btrfs. Do I need to reinstall the OS from scratch to achieve this? Or is there a way to re-host the OS onto btrfs without losing content?

That done, if I understand correctly, I can init LXD with a zpool and mirror after the fact.

Thanks again,

Lloyd

If your OS is already installed on btrfs you can easily easily mirror it (see Using Btrfs with Multiple Devices - btrfs Wiki) but if it uses another file system, that’s much more involved.

A full reinstall is probably the easiest. If you have data you’d like to keep, you can reinstall on the other disk, copy your data, blank the old disk and then use it for mirroring.