<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">Disclaimer: I no longer use lxc. Mostly lxd nowadays.</div><div class="gmail_quote"><br></div><div class="gmail_quote">I can point you to some documentation on the web though, hopefully that helps</div><div class="gmail_quote"><br></div><div class="gmail_quote">On Fri, Nov 10, 2017 at 7:29 PM, Thouraya TH <span dir="ltr"><<a href="mailto:thouraya87@gmail.com" target="_blank">thouraya87@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi all,<br><br></div>I have used this command to fix cpu cores on which we have set running containers. <br><div><br><div>root@g-105:~# lxc-cgroup -n worker cpuset.cpus 0<br>root@g-105:~# lxc-cgroup -n worker cpuset.cpus 1<br>root@g-105:~# lxc-cgroup -n worker cpuset.cpus 2<br>root@g--105:~# lxc-cgroup -n worker cpuset.cpus 3</div><div><br></div><div>root@g-105:~# lxc-cgroup -n worker cpuset.cpus 4<br>lxc_container: cgmanager.c: do_cgm_set: 1022 Error setting cgroup value cpuset.cpus for cpuset:/lxc<br>lxc_container: cgmanager.c: do_cgm_set: 1023 call to cgmanager_set_value_sync failed: invalid request<br>lxc_container: lxc_cgroup.c: main: 103 failed to assign '4' value to 'cpuset.cpus' for 'worker'</div><div><br></div><div>--> i have only 4 cores<br></div></div></div></blockquote><div><br></div><div><br></div><div>... and what is your question here, if any? The cpuset cgroup is working as intended, since there's no 'cpu 4' on your system.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div></div><div><br>root@g-105:~# lxc-cgroup -n workerTest cpuset.cpus 0,1,2,3<br>root@g-105:~# lxc-cgroup -n workerTest cpuset.cpus 0,1,2 <br></div><div><br></div><div>Please, is there a command to display containers and list of cores used by each container ?</div></div></div></blockquote><div><br></div><div>Probably the combination of lxc-ls and lxc-cgroup.</div><div><br></div><div>'lxc-cgroup -n workerTest cpuset.cpus' will show you its current values. See </div><div>- <a href="http://man7.org/linux/man-pages/man1/lxc-cgroup.1.html">http://man7.org/linux/man-pages/man1/lxc-cgroup.1.html</a><br></div><div>- <a href="https://linuxcontainers.org/lxc/manpages/man1/lxc-ls.1.html">https://linuxcontainers.org/lxc/manpages/man1/lxc-ls.1.html</a></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>A second question please,  can i fix that only container 1 uses  cpu 2,3 <b>(exclusive use)</b> or not ? i.e container 2 CANNOT use cpu 2,3<br></div><div><br></div></div></div></blockquote><div><br></div><div><br></div><div>Try <a href="https://linuxcontainers.org/lxc/manpages/man5/lxc.container.conf.5.html">https://linuxcontainers.org/lxc/manpages/man5/lxc.container.conf.5.html</a>, 'control group' section. And <a href="https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt">https://www.kernel.org/doc/Documentation/cgroup-v1/cpusets.txt</a>, search for '<span style="color:rgb(0,0,0);white-space:pre-wrap">cpuset.cpu_exclusive'. You could probably try (in container 1's config)</span></div><div><span style="color:rgb(0,0,0);white-space:pre-wrap"><br></span></div><div><div><span style="color:rgb(0,0,0);white-space:pre-wrap">lxc.cgroup.cpuset.</span><span style="color:rgb(0,0,0);white-space:pre-wrap">cpu_exclusive = 1</span></div></div><div><font color="#000000"><span style="white-space:pre-wrap">lxc.cgroup.cpuset.cpus = 2,3</span></font><br></div><div><br></div><div>It might work if no other cgroups currently explicitly use cpu 2-3.</div><div><br></div><div>-- </div><div>Fajar</div></div></div></div>