Best practice to configure storage pool on iscsi drive


What is the best way to configure an lxd storage pool on an iscsi drive?

I’ve got a large Synology NAS connected to my Ubuntu 20.04 server with dedicated 10 gigabit networking which I would like to use as a storage pool for lxd.

I can run lxd init and have it format this attached drive with zfs. I experimented with this and it worked. However, it isn’t durable on system reboot.

Should I take the partitions created by lxd init and add them to fstab to make them durable? Does anyone have a working example? Or is there some other way to do this that is better?


Hmm, that’s odd, the ZFS pool should have persisted. Well, you’d need the iscsi block device to be active on the system at the time LXD starts up, but so long as that’s the case, I would have expected things to work.

It’s useful knowing that it should work. Let me try it again and make sure that iscsi starts first. Thanks for your help.

Basically LXD runs zpool import NAME on startup, ZFS will look for labeled block devices and load the pool at that stage.

So it should only really fail if the block device isn’t present in /dev at that time.

It works as you described. I must not have enabled the iscsid to start automatically or had a timing issue/failure on the restart. I did end up using btrfs as zfs didn’t show up as an option when I ran lxd init.

Thanks again.