[lxc-users] using cgroups

rob e redgerhoo at yahoo.com.au
Fri Jul 1 03:40:20 UTC 2016


On 01/07/16 10:58, Serge E. Hallyn wrote:
> Quoting rob e (redgerhoo at yahoo.com.au):
>>
>> thanks Serge,
>> I tried that. Same result. Additionally, even when I comment out the
>> CPU controls, leaving only Memory limits, it still fails.
>>
>> To confirm, I have 3 uses for cgroups -
>> 1)  Resource control on CPU, Memory, Disk, Network etc eg.
>>              lxc.cgroup.cpuset.cpus = 1-3
>>              lxc.cgroup.memory.limit_in_bytes = 4G
> Let's address them one at a time.  For starters,
>
> if you only leave in the
>     lxc.cgroup.cpuset.cpus = 1-3
> does that now work?  If not, please post the log output to show exactly
> how it fails.
> And if you only have
>     lxc.cgroup.memory.limit_in_bytes = 4G
> how does that fail, exactly?
>
> Also, what is /proc/self/cgroup now when you login?
>
> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users
hi Serge,
thanks for the response, data follows - CPU limits set this time

--------------------------------------
 From "my" session
$ cat /proc/self/cgroup
11:blkio:/user.slice
10:hugetlb:/
9:freezer:/user/redger/2
8:pids:/user.slice/user-1000.slice
7:memory:/user/redger/2
6:cpu,cpuacct:/user.slice
5:net_cls,net_prio:/
4:perf_event:/
3:cpuset:/user/redger/2
2:devices:/user.slice
1:name=systemd:/user.slice/user-1000.slice/session-11.scope

--------------------------------------
Lines from PAM (original commented and new line inserted)
#session        optional        pam_cgfs.so -c freezer,memory,name=systemd
session optional        pam_cgfs.so -c freezer,memory,name=systemd,cpuset

--------------------------------------
current config for test system - Note CPU limit (only), no other cgroup 
usage
# Template used to create this container: 
/usr/share/lxc/templates/lxc-download
# Parameters passed to the template: -d ubuntu -r trusty -a amd64
# For additional config options, please look at lxc.container.conf(5)

# Distribution configuration
lxc.include = /usr/share/lxc/config/ubuntu.common.conf
lxc.include = /usr/share/lxc/config/ubuntu.userns.conf
lxc.arch = x86_64

# Container specific configuration
lxc.id_map = u 0 100000 65536
lxc.id_map = g 0 100000 65536
lxc.rootfs = /mnt/lxc_images/containers/xenial_test_01/rootfs
lxc.rootfs.backend = dir
lxc.utsname = xenial_test_01

# Network configuration
lxc.network.type = veth
lxc.network.link = lxcbr0
lxc.network.flags = up
lxc.network.hwaddr = 00:16:3e:19:3c:15

## Set resource limits   ----- Cause problems in Xenial
lxc.cgroup.cpuset.cpus = 1-3


--------------------------------------
And the result of starting (copied and pasted from konsole)
$ lxc-start -n xenial_test_01 -F -o lxc_test_cpu_160701a.log -l debug
lxc-start: cgfsng.c: cgfsng_setup_limits: 1645 No devices cgroup setup 
for xenial_test_01
lxc-start: start.c: lxc_spawn: 1226 failed to setup the devices cgroup 
for 'xenial_test_01'
lxc-start: start.c: __lxc_start: 1353 failed to spawn 'xenial_test_01'
                                       lxc-start: lxc_start.c: main: 344 
The container failed to start.
lxc-start: lxc_start.c: main: 348 Additional information can be obtained 
by setting the --logfile and --logpriority options.

--------------------------------------
Last few lines of the log file
       lxc-start 20160701033803.685 DEBUG    lxc_conf - 
conf.c:setup_caps:2056 - drop capability 'sys_rawio' (17)
       lxc-start 20160701033803.685 DEBUG    lxc_conf - 
conf.c:setup_caps:2065 - capabilities have been setup
       lxc-start 20160701033803.685 NOTICE   lxc_conf - 
conf.c:lxc_setup:3839 - 'xenial_test_01' is setup.
       lxc-start 20160701133803.685 ERROR    lxc_cgfsng - 
cgfsng.c:cgfsng_setup_limits:1645 - No devices cgroup setup for 
xenial_test_01
       lxc-start 20160701133803.685 ERROR    lxc_start - 
start.c:lxc_spawn:1226 - failed to setup the devices cgroup for 
'xenial_test_01'
       lxc-start 20160701133803.685 ERROR    lxc_start - 
start.c:__lxc_start:1353 - failed to spawn 'xenial_test_01'
       lxc-start 20160701133803.721 INFO     lxc_conf - 
conf.c:run_script_argv:367 - Executing script 
'/usr/share/lxcfs/lxc.reboot.hook' for container 'xenial_test_01', 
config section 'lxc'
       lxc-start 20160701133804.232 ERROR    lxc_start_ui - 
lxc_start.c:main:344 - The container failed to start.
       lxc-start 20160701133804.233 ERROR    lxc_start_ui - 
lxc_start.c:main:348 - Additional information can be obtained by setting 
the --logfile and --logpriority options.

I can attach the logfile if that helps, tho it may delay the email due 
to size




More information about the lxc-users mailing list