<div dir="ltr"><div>The container created from scratch seems to work fine, but container whose rootfs is mounted from a dir is not working....</div><div><br></div><div>Here are my logs...Please let me know</div><div>My hostmachine name is test05</div><div>I created a container by mounting the rootfs (by untaring a image)..This is not showing the container stats..it showing the host stats</div><div><br></div><div>root@test05:~# grep MemTotal /proc/meminfo</div><div>MemTotal:       264132048 kB</div><div>root@test05:~# lxc-ls -f</div><div>NAME                       STATE    IPV4         IPV6  GROUPS  AUTOSTART  </div><div>------------------------------------------------------------------------</div><div>rootfs-from-tar-container  RUNNING  10.7.200.23  -     -       NO         </div><div>     </div><div>root@test05:~# lxc-cgroup -n rootfs-from-tar-container memory.limit_in_bytes 1G</div><div>root@test05:~# lxc-cgroup -n rootfs-from-tar-container memory.limit_in_bytes</div><div>1073741824</div><div>root@test05:~# lxc-attach -n rootfs-from-tar-container</div><div>root@rootfs-from-tar-container:~# grep MemTotal /proc/meminfo</div><div>MemTotal:       264132048 kB                     <<<========================= This should be 1GB???</div><div>root@rootfs-from-tar-container:~# exit</div><div>exit</div><div>root@test05:~# dpkg -l | grep lxc</div><div>ii  liblxc1                             1.1.0+master~20150224-0139-0ubuntu1~trusty amd64        Linux Containers userspace tools (library)</div><div>ii  lxc                                 1.1.0+master~20150224-0139-0ubuntu1~trusty amd64        Linux Containers userspace tools</div><div>ii  lxc-templates                       1.1.0+master~20150224-0139-0ubuntu1~trusty amd64        Linux Containers userspace tools (templates)</div><div>ii  lxcfs                               0.6-0ubuntu1~ubuntu14.04.1~ppa1            amd64        FUSE based filesystem for LXC</div><div>ii  python3-lxc                         1.1.0+master~20150224-0139-0ubuntu1~trusty amd64        Linux Containers userspace tools (Python 3.x bindings)</div><div><br></div><div><br></div><div>Now I created a new container by downloading the template and this seems to show the stats fine...</div><div>lxc-create -t ubuntu -n robin-ubuntu-template1</div><div>lxc-start -n robin-ubuntu-template1</div><div><br></div><div>root@test05:/var/lib/lxc# lxc-ls -f</div><div>NAME                       STATE    IPV4         IPV6  GROUPS  AUTOSTART  </div><div>------------------------------------------------------------------------</div><div><a href="http://rootfs-from-tar-container.robinsystems.com">rootfs-from-tar-container.robinsystems.com</a>  RUNNING  10.7.200.25  -     -       NO         </div><div>robin-ubuntu-template1     RUNNING  10.7.202.5   -     -       NO        </div><div> </div><div>root@test05:/var/lib/lxc# lxc-cgroup -n robin-ubuntu-template1 memory.limit_in_bytes</div><div>18446744073709551615</div><div>root@test05:/var/lib/lxc# grep MemTotal /proc/meminfo</div><div>MemTotal:       264132048 kB</div><div>root@test05:/var/lib/lxc# lxc-cgroup -n robin-ubuntu-template1 memory.limit_in_bytes 1G</div><div>root@test05:/var/lib/lxc# </div><div>root@test05:/var/lib/lxc# </div><div>root@test05:/var/lib/lxc# lxc-cgroup -n robin-ubuntu-template1 memory.limit_in_bytes</div><div>1073741824</div><div>root@test05:/var/lib/lxc# </div><div>root@test05:/var/lib/lxc# </div><div>root@test05:/var/lib/lxc# lxc-attach -n robin-ubuntu-template1</div><div>root@robin-ubuntu-template1:/# grep MemTotal /proc/meminfo</div><div>MemTotal:        1048576 kB                         <<<<==========================This looks good..Shows the memory of 1GB</div><div><br></div><div>I see lxcfs being mounted on this container which (while it wasnt on the firstone)</div><div><br></div><div>root@robin-ubuntu-template1:/# mount | grep lxcfs</div><div>lxcfs on /proc/cpuinfo type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)</div><div>lxcfs on /proc/meminfo type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)</div><div>lxcfs on /proc/stat type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)</div><div>lxcfs on /proc/uptime type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)</div><div>lxcfs on /sys/fs/cgroup/blkio type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)</div><div>lxcfs on /sys/fs/cgroup/cpu type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)</div><div>lxcfs on /sys/fs/cgroup/cpuacct type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)</div><div>lxcfs on /sys/fs/cgroup/cpuset type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)</div><div>lxcfs on /sys/fs/cgroup/devices type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)</div><div>lxcfs on /sys/fs/cgroup/freezer type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)</div><div>lxcfs on /sys/fs/cgroup/hugetlb type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)</div><div>lxcfs on /sys/fs/cgroup/memory type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)</div><div>lxcfs on /sys/fs/cgroup/systemd type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)</div><div>lxcfs on /sys/fs/cgroup/perf_event type fuse.lxcfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other)</div><div><br></div><div><br></div><div>while the other container I created was by mounting the rootfs (by untaring a image)? Do you think I need to add any steps as I dont see any of the lxcfs mount points on my this container</div><div><br></div><div>root@test05:/var/lib/lxc# lxc-attach -n <a href="http://rootfs-from-tar-container.robinsystems.com">rootfs-from-tar-container.robinsystems.com</a></div><div><br></div><div>root@rootfs-from-tar-container:/# mount | grep lxcfs                       <<<====================No LXCFS mounts</div><div>root@rootfs-from-tar-container:/# mount</div><div>/dev/mapper/localGroup-capsuleVolume on / type ext4 (rw)</div><div>none on /proc type proc (rw,noexec,nosuid,nodev)</div><div>none on /sys type sysfs (rw,noexec,nosuid,nodev)</div><div>none on /dev type tmpfs (rw,mode=0755)</div><div>none on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)</div><div>/dev/disk/by-uuid/b0e9ea78-cc3c-4550-86b2-a790ac7f0897 on /shared type ext4 (rw,relatime,errors=remount-ro,data=ordered)</div><div>devpts on /dev/console type devpts (rw,noexec,nosuid,relatime,mode=600,ptmxmode=000)</div><div>none on /sys/fs/cgroup type tmpfs (rw)</div><div>none on /sys/fs/fuse/connections type fusectl (rw)</div><div>none on /sys/kernel/debug type debugfs (rw)</div><div>none on /sys/kernel/security type securityfs (rw)</div><div>none on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)</div><div>none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)</div><div>none on /run/shm type tmpfs (rw,nosuid,nodev)</div><div>none on /run/user type tmpfs (rw,noexec,nosuid,nodev,size=104857600,mode=0755)</div><div>cm_processes on /run/cloudera-scm-agent/process type tmpfs (rw,mode=0751)</div><div><br></div><div>Please let me know.</div><div><br></div><div>Thanks</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 5, 2015 at 1:56 AM, Fajar A. Nugraha <span dir="ltr"><<a href="mailto:list@fajar.net" target="_blank">list@fajar.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">(shrug)<br>
<br>
Works for me with ppa:ubuntu-lxc/daily<br>
<br>
# grep MemTotal /proc/meminfo<br>
MemTotal:       12197888 kB<br>
<br>
# lxc-cgroup -n c7 memory.limit_in_bytes 1G<br>
<br>
# lxc-cgroup -n c7 memory.limit_in_bytes<br>
1073741824<br>
<br>
# lxc-attach -n c7 -- grep MemTotal /proc/meminfo<br>
MemTotal:        1048576 kB<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Fajar<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Thu, Mar 5, 2015 at 2:38 PM, Rajasekar Darapuram<br>
<<a href="mailto:raj@robinsystems.com">raj@robinsystems.com</a>> wrote:<br>
> Thanks for the reply..However<br>
> How come when i create 2 containers (I'm running the command lxc-create -f<br>
> config -n name1 -t none, and my config has the option lxc.rootfs =<br>
> /containers/container-name )  and run the cpuinfo, meminfo, uptime commands<br>
> on each container, they both are returning the same values and they match<br>
> the host machine values..<br>
><br>
> Did I miss anything?<br>
><br>
> From: "Fajar A. Nugraha" <<a href="mailto:list@fajar.net">list@fajar.net</a>><br>
> To: LXC users mailing-list <<a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a>><br>
> Cc:<br>
> Date: Thu, 5 Mar 2015 06:00:00 +0700<br>
> Subject: Re: [lxc-users] newbee to LXC and LXCFS<br>
><br>
> On Thu, Mar 5, 2015 at 1:02 AM, Rajasekar Darapuram<br>
> <<a href="mailto:raj@robinsystems.com">raj@robinsystems.com</a>> wrote:<br>
>> 1. Should I explicitly bind the host /var/lib/lxcfs/cgroup/proc to the<br>
>> container /proc (or something like /container_proc)<br>
><br>
> Not if you update lxc to 1.1. See<br>
> <a href="https://github.com/lxc/lxcfs/blob/master/README.md" target="_blank">https://github.com/lxc/lxcfs/blob/master/README.md</a><br>
><br>
> --<br>
> Fajar<br>
</div></div></blockquote></div><br></div>