[lxc-users] Trouble starting LXD when LXD_DIR is on a ZFS pool.
Daniel Gray
dng at disroot.org
Mon May 11 05:14:39 UTC 2020
I'm using Alpine Linux in diskless mode.
As a result the only persistent directory is my /etc, where the files
are tar'ed /media/usb/host.apkovl.tar.gz these configs are merged into
the system on reboot, and / is in tempfs.
I want to store my LXD_DIR on a ZFS dataset. This storage will be
persistent.
I've noticed that the LXD service won't start if I try to do so. The
error seems to be related to the failure to create:
srwx------ 1 root root 0 May 11 14:11 /var/lib/lxd/seccomp.socket
srw-rw---- 1 root root 0 May 11 14:11 /var/lib/lxd/unix.socket
I've already created a zpool with two datasets:
# zfs list
NAME USED AVAIL REFER MOUNTPOINT
POOL 8.37M 50.1T 239K /mnt/data
POOL/lxd 759K 50.1T 759K /var/lib/lxd
POOL/lxd_storage 341K 50.1T 341K /mnt/data/lxd_storage
# zfs mount POOL/lxd
# chmod 755 /var/lib/lxd
Then I try to start lxd:
Error: Failed to create dqlite server: raft_init(): io: create I/O
capabilities probe file: posix_allocate: operation not supported on
socket
If anyone has any other suggestions about how I should set this up in
relation to my pool, I'm open to suggestions.
The requirement is that POOL/lxd and POOL/lxd_storage be encrypted, and
for that I used:
# zfs create \
-o encryption=aes-256-gcm \
-o keyformat=raw \
-o keylocation=file:///mnt/mount/lxd \
-o mountpoint=/var/lib/lxd \
pool/lxd
# zfs create \
-o encryption=aes-256-gcm \
-o keyformat=raw \
-o keylocation=file:///mnt/mount/lxd \
pool/lxd_storage
I mount my encrypted storage, load my keys with:
# zfs load-keys -a
and then proceed to start lxd, manually. The idea is that if a power
loss occurs the lxd containers cannot be accessed until I provide my
keys.
--
Daniel Gray (dng) 0x41911F722B0F9AE3
More information about the lxc-users
mailing list