Thanks Tycho,

I was able to install the nfs-kernel-server on the LXD container. I ran 
the steps for setting the default lxc profile and making the container as 
privileged on the host machine.
After this I deployed my charm and it worked fine.

Thanks and Regards,
Shilpa Kaul



From:   Tycho Andersen <tycho.ander...@canonical.com>
To:     John Meinel <j...@arbash-meinel.com>, Shilpa Kaul/India/IBM@IBMIN, 
juju@lists.ubuntu.com
Date:   06/22/2016 08:01 PM
Subject:        Re: Fwd: nfs kernel server installation failed in lxd 
container



Hi Shilpa,

[apologies, I wasn't subscribed to this list, so I can't reply to the
original message]

On Wed, Jun 22, 2016 at 05:49:35PM +0400, John Meinel wrote:
> ---------- Forwarded message ----------
> From: "Shilpa Kaul" <shilk...@in.ibm.com>
> Date: Jun 20, 2016 19:32
> Subject: nfs kernel server installation failed in lxd container
> To: <juju@lists.ubuntu.com>
> Cc:
>
> Hi,
> 
> I am using NFS for file sharing in my charm. To install 
nfs-kernel-server
> on LXC container(Juju 1.25), I had done the below steps on my host 
machine :
> *apt-get install nfs-common*
> 
> *modprobe nfsdmount -t nfsd nfsd /proc/fs/nfsd*
> Then edit /etc/apparmor.d/lxc/lxc-default and added the following lines 
to
> it and restart the apparmor
> 
> *mount fstype=nfs,*
> *mount fstype=nfs4,*
> *mount fstype=nfsd,*
> *mount fstype=rpc_pipefs,*

LXD doesn't use the `lxc-default` profile, but generates a separate
profile for each container for security reasons. IIRC juju uses the
default profile for LXD, so you could do something like:

lxc profile set default raw.apparmor "mount fstype=nfs,
mount fstype=nfs4,
mount fstype=nfsd,
mount fstype=rpc_pipefs,"

You'll also need to make sure the container is privileged, as
unprivileged mounting of nfs is not supported by the kernel right now:

lxc profile set default security.privileged true

Tycho

> By doing this and further steps of installing nfs server and nfs client, 
I
> was able to share files between the LXC containers.
> 
> Now when I run the same charm on Juju 2.0(LXD containers), my charm 
fails
> as the nfs-kernel-server installation fails. In the logs I see the below
> messages
> 
> 
> 
> 
> *A dependency job for nfs-server.service failed. See 'journalctl -xe' 
for
> details.invoke-rc.d: initscript nfs-kernel-server, action "start"
> failed.dpkg: error processing package nfs-kernel-server
> (--configure): subprocess installed post-installation script returned 
error
> exit status 1 *
> 
> On doing journalctl -xe, I see lots of *"Operation not permitted*" 
messages
> and *"Failed to mount NFSD configuration filesystem"*error messages.
> 
> Can anyone please help me in resolving the above issue and configuring 
NFS
> Server on LXD containers.
> 
> 
> Thanks and Regards,
> Shilpa Kaul
> 
> 
> --
> Juju mailing list
> Juju@lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju





-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju

Reply via email to