[lxc-users] ZVOL and zfs support inside a container

Stéphane Graber stgraber at ubuntu.com
Sun Apr 2 18:55:57 UTC 2017


On Sun, Apr 02, 2017 at 06:51:30PM +0000, Spike wrote:
> Hi,
> 
> I'm playing with various combinations of virtualization and backends to
> find the best way to manage some samba and nfs exports and one of the
> options I'm considering is the following:
> 
> - run a lxd container backed up by zfs
> - create a ZVOL on zfs
> - export the VZOL to the container as a block device
> - create a zpool from that device inside the container
> - export that
> 
> however I can't seem to be able to make the container see and manage zfs
> stuff. firs off it seems that the container needs to be privileged, which
> is ok, it's not hosting anything or providing any public services. Second,
> I got the impression that I need to expose the /dev/zfs from the host to
> the container? is that the case? is there no way to create a second one
> with access just to the ZVOL?
> 
> thanks for any help,
> 
> Spike

ZFS unfortunately doesn't work in containers.

All ZFS configuration goes through /dev/zfs and that device isn't
namespace aware, so granting access to it in the container would let the
container see and manage the host zpool.

I've been told a couple of years ago by the ZFS on Linux maintainer that
they were looking at making ZFS on Linux container aware (in a way
similar to Solaris' implementation) but I don't believe this has
resulted to any code being merged at this point.


-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20170402/62862adb/attachment.sig>


More information about the lxc-users mailing list