Hi Lava Team I am trying to mount a directory of worker (host computer) to LXC instance running on it with job. I have added this entry in lxc default configuration file of worker computer. Default Configuration file path is : /etc/lxc/default.conf Entry is :- lxc.mount.entry = /var/lib/nfsdir var/nfsmnt none bind,create=dir 0 0
After restart lxc service. I executed lava job then this directory "/var/lib/nfsdir" of worker machine is not mounting on LXC instance in directory "/var/nfsmnt".
But if i manually create and start lxc instance on worker, then this directory "/var/lib/nfsdir" of worker machine is mounted on LXC instance.
Can anyone assist me on this issue, that how i can resolve this issue.
On Wednesday 26 July 2017 02:31 PM, Chetan Sharma wrote:
Default Configuration file path is : /etc/lxc/default.conf Entry is :- lxc.mount.entry = /var/lib/nfsdir var/nfsmnt none bind,create=dir 0 0
You are missing a forward slash before 'var/nfsmnt' above.
After restart lxc service. I executed lava job then this directory
How did you restart lxc service?
"/var/lib/nfsdir" of worker machine is not mounting on LXC instance in directory "/var/nfsmnt".
A fresh LXC created and started during the job execution will not have the directory /var/nfsmnt hence it will not work.
You may try 'mkdir /var/nfsmnt; mount /var/nfsmnt' before accessing the directory.
But if i manually create and start lxc instance on worker, then this directory "/var/lib/nfsdir" of worker machine is mounted on LXC instance.
What are the things you did after starting lxc? Did you create '/var/nfsmnt' directory?
Thank You.
Thanks Senthil But still its not working with Lava job. Can we debug LXC-instance with more logs.
On Wed, Jul 26, 2017 at 3:36 PM, Senthil Kumaran S < senthil.kumaran@linaro.org> wrote:
On Wednesday 26 July 2017 02:31 PM, Chetan Sharma wrote:
Default Configuration file path is : /etc/lxc/default.conf Entry is :- lxc.mount.entry = /var/lib/nfsdir var/nfsmnt none bind,create=dir
0 0
You are missing a forward slash before 'var/nfsmnt' above. [chetan] No Senthil, we need not to provide forward slash, as its defined in this version of lxc.
https://wiki.debian.org/LXC#bind_mounts_inside_the_container
After restart lxc service. I executed lava job then this directory
How did you restart lxc service?
[chetan] /etc/init.d/lxc-net restart, /etc/init.d/lxc restart
"/var/lib/nfsdir" of worker machine is not mounting on LXC instance in directory "/var/nfsmnt".
[chetan] directory is created automatically on LXC instance with name
/var/nfsmnt but content of worker machine directory is not synced/mounted in this directory.
A fresh LXC created and started during the job execution will not have the directory /var/nfsmnt hence it will not work.
You may try 'mkdir /var/nfsmnt; mount /var/nfsmnt' before accessing the directory.
[chetan] this step is not required. I have followed these steps simply with additional parameters. https://wiki.debian.org/LXC#bind_mounts_inside_the_container
But if i manually create and start lxc instance on worker, then this
directory "/var/lib/nfsdir" of worker machine is mounted on LXC instance.
What are the things you did after starting lxc? Did you create '/var/nfsmnt' directory? [chetan] I just did config change and created a new lxc instance with name lxc-ubuntu and then start instance. By attaching to instance, i am able to access /var/nfsmnt path on LXC.
Thank You.
Senthil Kumaran S http://www.stylesen.org/ http://www.sasenthilkumaran.com/
Hi Chetan,
On Wednesday 26 July 2017 03:53 PM, Chetan Sharma wrote:
But still its not working with Lava job. Can we debug
LXC-instance with more logs.
I tried this on my local setup and it just works from within a LAVA test job.
See the complete test job log here - http://paste.debian.net/978242/ The job definition is here - http://paste.debian.net/978243/
You can see 'ls -alh /var/iso' called in the test definition lists the contents of the directory which is mounted from the entry as defined below:
$ cat /etc/lxc/default.conf lxc.network.type = veth lxc.network.flags = up lxc.network.link = virbr0
lxc.cgroup.memory.limit_in_bytes = 2G lxc.mount.entry = /mnt/iso var/iso none bind,create=dir 0 0 $ ls -alh /mnt/iso/ total 1.2M dr-xr-xr-x 1 root root 4.0K Nov 22 2016 . drwxr-xr-x 3 root root 4.0K Mar 1 21:00 .. -r--r--r-- 1 root root 146 Nov 22 2016 autorun.inf dr-xr-xr-x 1 root root 2.0K Nov 22 2016 boot dr-xr-xr-x 1 root root 2.0K Nov 22 2016 css lr-xr-xr-x 1 root root 1 Nov 22 2016 debian -> . dr-xr-xr-x 1 root root 2.0K Nov 22 2016 .disk dr-xr-xr-x 1 root root 2.0K Nov 22 2016 dists dr-xr-xr-x 1 root root 2.0K Nov 22 2016 doc dr-xr-xr-x 1 root root 2.0K Nov 22 2016 efi dr-xr-xr-x 1 root root 2.0K Nov 22 2016 firmware -r--r--r-- 1 root root 177K Nov 21 2016 g2ldr -r--r--r-- 1 root root 8.0K Nov 21 2016 g2ldr.mbr dr-xr-xr-x 1 root root 2.0K Nov 22 2016 install dr-xr-xr-x 1 root root 2.0K Nov 22 2016 install.amd dr-xr-xr-x 1 root root 4.0K Nov 22 2016 isolinux -r--r--r-- 1 root root 80K Nov 22 2016 md5sum.txt dr-xr-xr-x 1 root root 4.0K Nov 22 2016 pics dr-xr-xr-x 1 root root 2.0K Nov 22 2016 pool -r--r--r-- 1 root root 8.6K Nov 22 2016 README.html -r--r--r-- 1 root root 187K Nov 21 2016 README.mirrors.html -r--r--r-- 1 root root 102K Nov 21 2016 README.mirrors.txt -r--r--r-- 1 root root 437 Nov 22 2016 README.source -r--r--r-- 1 root root 5.3K Nov 22 2016 README.txt -r--r--r-- 1 root root 615K Nov 21 2016 setup.exe dr-xr-xr-x 1 root root 2.0K Nov 22 2016 tools -r--r--r-- 1 root root 233 Nov 22 2016 win32-loader.ini $
/mnt/iso is a loop mount of debian testing iso image.
Thank You.