[lxc-devel] Does cpu cgroup has been enabled in lxc/lxd
Wang, Kemi
kemi.wang at intel.com
Wed Oct 31 12:39:24 UTC 2018
Hi, Developers
I am new comer of LXC/LXD community, and want to run a container on limited cpu set.
The following is my steps:
a) lxd init
b) lxc launch Ubuntu:18.04 first
c) lxc stop first
d) lxc config set first limits.cpu 0 // set container running on CPU 0
e) lxc start first
f) lxc exec first -- bash
g) nproc // the expected result would be 1, however, it still equals to cpu number of host
h) ls /sys/devices/system/cpu // the expected result should only include cpu0 directory, however, it's not
So, it seems that CPU cgroup has not been enabled in LXC/LXD, right? The version of lxc is 2.0.11 on Ubuntu 16.04.
Anyone can help me on that, thx very much.
B.R
Kemi Wang
SSG OTC kernel team
More information about the lxc-devel
mailing list