You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is about reviving the discussion in https://github.com/lxc/lxd/issues/4184 from back in 2018, to take into account recent changes in the features provided by OpenZFS.
Namely what openzfs/zfs#12263 has brought since September 2022, and which is to be included in the yet to be released OpenZFS 2.2: "Linux namespace delegation support".
#!/bin/sh -eu
# FIXME find a way to programatically find the parent dataset name
ZFS_DATASET=default/containers/${LXC_NAME}
if [ ${LXC_HOOK_TYPE} = start-host ]; then
zfs set zoned=on ${ZFS_DATASET}
zfs zone /proc/${LXC_PID}/ns/user ${ZFS_DATASET}
elif [ ${LXC_HOOK_TYPE} = post-stop ]; then
zfs set zoned=off ${ZFS_DATASET}
fi
installing the openzfs-zfsutils package in a Debian 12 container
enjoying being able to manage ZFS in the container (via K3s / OpenEBS ZFS LocalPV to be precise) 😄
The only limitation/issue that I've seen so far, is the inability to do actions on the host like lxc push or lxc edit which have an effect on the rootfs directory while the container is running, as the ZFS dataset is not accessible at that time.
But that's a limitation I'm more than ready to accept.
So the question is: instead of messing around which manually configured hooks, what do you think of integrating the support for ZFS delegation in LXD itself?
Where the feature could be activated at the container/profile level via a dedicated setting for example.
Would you have pointers to share if someone (me?) wants to have a try at the implementation?
PS: I've noted a couple of places in the documentation would be changed if ZFS delegation was to be officially supported:
This issue is about reviving the discussion in https://github.com/lxc/lxd/issues/4184 from back in 2018, to take into account recent changes in the features provided by OpenZFS.
Namely what openzfs/zfs#12263 has brought since September 2022, and which is to be included in the yet to be released OpenZFS 2.2: "Linux namespace delegation support".
As as I explained in https://github.com/lxc/lxd/issues/4184#issuecomment-1560552412, I've successfully managed to delegate ZFS management to a container by:
master
branch on the hostzfsutils-linux
foropenzfs-zfsutils
in: https://github.com/lxc/lxd/blob/123231d27121223f20f11a65499ce8a5e35d704b/lxd/storage/drivers/driver_zfs_utils.go#L259openzfs-zfsutils
package in a Debian 12 containerThe only limitation/issue that I've seen so far, is the inability to do actions on the host like
lxc push
orlxc edit
which have an effect on therootfs
directory while the container is running, as the ZFS dataset is not accessible at that time.But that's a limitation I'm more than ready to accept.
So the question is: instead of messing around which manually configured hooks, what do you think of integrating the support for ZFS delegation in LXD itself?
Where the feature could be activated at the container/profile level via a dedicated setting for example.
Would you have pointers to share if someone (me?) wants to have a try at the implementation?
PS: I've noted a couple of places in the documentation would be changed if ZFS delegation was to be officially supported:
The text was updated successfully, but these errors were encountered: