[lxc-users] Does cpu cgroup has been enabled in lxc/lxd

kemi kemi.wang at intel.com
Thu Nov 1 01:55:16 UTC 2018

Hi, Everyone
   I am new comer of LXC/LXD community, and want to run a container on a limited cpu set.
  The followings are 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.

More information about the lxc-users mailing list