[lxc-users] LXD dependencies in embedded environment (Yocto)

Massimiliano Malisan max.malisan.uk at gmail.com
Tue Apr 18 15:16:37 UTC 2017


Hi all,



I am fairly new to LXC/LXD, having just tested it for a week or so on an
Ubuntu machine. I wanted to try to run it on an embedded system (running on
a x86_64 CPU) and I built both LXC and LXD with Yocto (using a go
toolchain).

As a note, this system at the moment lacks apparmor and criu.

The system is IPv6 enabled.

All the building process seemed to go quite smoothly and I managed to start
manually the LXD daemon (with “start-stop-daemon -S -p /var/run/lxd.pid -x
/usr/bin/lxd -- --verbose”) but I think there is something amiss or in my
configuration or in some dependencies as I experience various issues:

·         If I start the daemon with the default sysvinit script that’s in
the Ubuntu package it seems to start but then exits on the timeout (but as
said, if I run it manually with the command above it runs without evident
issues)

·         When I run the daemon init (lxd init), if I have it configure a
network I get the following error:


error: Failed to list ipv6 rules for lxdbr0 (table )


and I don't see any bridge created.

Every subsequent run of the the daemon, I get the following error:


Failed to bring up network               err="Failed to list ipv6 rules for
lxdbr0 (table )" name=lxdbr0


·         When I try to create&start a container with “lxc launch” the
container it fails with the following error (poetic-stork in the example is
a ubuntu/xenial image from images: ):


error: Failed to run: /usr/bin/lxd forkstart
poetic-stork/var/lib/lxd/containers
/var/log/lxd/poetic-stork/lxc.conf:


and in the server/daemon log I see:


INFO[04-18|14:42:49] Starting container                       action=start
created=2017-04-18T14:28:26+0000 ephemeral=false name=poetic-stork
stateful=false
used=2017-04-18T14:38:03+0000
EROR[04-18|14:42:49] stop hook failed                         container=
poetic-stork err="Container is already running a start operation"


Just after the image creation it warns that the image has been created
without a network attached to it..


·         The log when the container (from “lxc info --show-log
poetic-stork”) is:



Name: poetic-stork

Remote: unix:/var/lib/lxd/unix.socket

Architecture: x86_64

Created: 2017/04/18 14:51 UTC

Status: Stopped

Type: persistent

Profiles: default

Log:



            lxc 20170418145150.125 INFO     lxc_start -
start.c:lxc_check_inherited:235 - Closed inherited fd: 3.

            lxc 20170418145150.126 INFO     lxc_start -
start.c:lxc_check_inherited:235 - Closed inherited fd: 7.

            lxc 20170418145150.130 INFO     lxc_container -
lxccontainer.c:do_lxcapi_start:804 - Attempting to set proc title to [lxc
monitor] /var/lib/lxd/containers poetic-stork

            lxc 20170418145150.130 INFO     lxc_utils -
utils.c:setproctitle:1519 - setting cmdline failed - Invalid argument

            lxc 20170418145150.131 INFO     lxc_start -
start.c:lxc_check_inherited:235 - Closed inherited fd: 7.

            lxc 20170418145150.131 INFO     lxc_conf -
conf.c:run_script_argv:424 - Executing script "/usr/bin/lxd callhook
/var/lib/lxd 3 start" for container "poetic-stork", config section "lxc".

            lxc 20170418145150.133 INFO     lxc_start -
start.c:lxc_check_inherited:235 - Closed inherited fd: 3.

            lxc 20170418145150.133 INFO     lxc_start -
start.c:lxc_check_inherited:235 - Closed inherited fd: 7.

            lxc 20170418145150.137 INFO     lxc_monitor -
monitor.c:lxc_monitor_sock_name:185 - Using monitor socket name
"lxc/d78a9d7e97b4b375//var/lib/lxd/containers".

            lxc 20170418145150.231 INFO     lxc_start -
start.c:lxc_init:475 - Container "poetic-stork" is initialized.

            lxc 20170418145150.232 INFO     lxc_cgroup -
cgroup.c:cgroup_init:68 - cgroup driver cgroupfs-ng initing for poetic-stork

            lxc 20170418145150.234 INFO     lxc_confile -
confile.c:config_idmap:1531 - read uid map: type u nsid 0 hostid 1000000
range 1000000000

            lxc 20170418145150.234 INFO     lxc_confile -
confile.c:config_idmap:1531 - read uid map: type g nsid 0 hostid 1000000
range 1000000000

            lxc 20170418145150.234 INFO     lxc_start -
start.c:lxc_spawn:1154 - Cloned CLONE_NEWUSER.

            lxc 20170418145150.235 INFO     lxc_start -
start.c:lxc_spawn:1154 - Cloned CLONE_NEWNS.

            lxc 20170418145150.235 INFO     lxc_start -
start.c:lxc_spawn:1154 - Cloned CLONE_NEWPID.

            lxc 20170418145150.235 INFO     lxc_start -
start.c:lxc_spawn:1154 - Cloned CLONE_NEWUTS.

            lxc 20170418145150.235 INFO     lxc_start -
start.c:lxc_spawn:1154 - Cloned CLONE_NEWIPC.

            lxc 20170418145150.240 ERROR    lxc_start -
start.c:lxc_spawn:1171 - Failed to set up id mapping.

            lxc 20170418145150.240 ERROR    lxc_start -
start.c:__lxc_start:1346 - Failed to spawn container "poetic-stork".

            lxc 20170418145150.260 INFO     lxc_conf -
conf.c:run_script_argv:424 - Executing script "/usr/bin/lxd callhook
/var/lib/lxd 3 stop" for container "poetic-stork", config section "lxc".

            lxc 20170418145150.292 ERROR    lxc_conf -
conf.c:run_buffer:405 - Script exited with status 1.

            lxc 20170418145150.292 ERROR    lxc_start -
start.c:lxc_fini:546 - Failed to run lxc.hook.post-stop for container
"poetic-stork".

            lxc 20170418145150.292 WARN     lxc_commands -
commands.c:lxc_cmd_rsp_recv:172 - Command get_cgroup failed to receive
response: Connection reset by peer.

            lxc 20170418145150.293 WARN     lxc_commands -
commands.c:lxc_cmd_rsp_recv:172 - Command get_cgroup failed to receive
response: Connection reset by peer.

            lxc 20170418145150.298 ERROR    lxc_conf -
conf.c:userns_exec_1:4453 - Error setting up child mappings

            lxc 20170418145150.298 ERROR    lxc_cgfsng -
cgfsng.c:recursive_destroy:1270 - Error destroying
/sys/fs/cgroup/cpuset//lxc/poetic-stork

            lxc 20170418145150.304 ERROR    lxc_conf -
conf.c:userns_exec_1:4453 - Error setting up child mappings

            lxc 20170418145150.304 ERROR    lxc_cgfsng -
cgfsng.c:recursive_destroy:1270 - Error destroying
/sys/fs/cgroup/cpu//lxc/poetic-stork

            lxc 20170418145150.309 ERROR    lxc_conf -
conf.c:userns_exec_1:4453 - Error setting up child mappings

            lxc 20170418145150.309 ERROR    lxc_cgfsng -
cgfsng.c:recursive_destroy:1270 - Error destroying
/sys/fs/cgroup/cpuacct//lxc/poetic-stork

            lxc 20170418145150.315 ERROR    lxc_conf -
conf.c:userns_exec_1:4453 - Error setting up child mappings

            lxc 20170418145150.315 ERROR    lxc_cgfsng -
cgfsng.c:recursive_destroy:1270 - Error destroying
/sys/fs/cgroup/blkio//lxc/poetic-stork

            lxc 20170418145150.320 ERROR    lxc_conf -
conf.c:userns_exec_1:4453 - Error setting up child mappings

            lxc 20170418145150.320 ERROR    lxc_cgfsng -
cgfsng.c:recursive_destroy:1270 - Error destroying
/sys/fs/cgroup/memory//lxc/poetic-stork

            lxc 20170418145150.325 ERROR    lxc_conf -
conf.c:userns_exec_1:4453 - Error setting up child mappings

            lxc 20170418145150.325 ERROR    lxc_cgfsng -
cgfsng.c:recursive_destroy:1270 - Error destroying
/sys/fs/cgroup/devices//lxc/poetic-stork

            lxc 20170418145150.330 ERROR    lxc_conf -
conf.c:userns_exec_1:4453 - Error setting up child mappings

            lxc 20170418145150.330 ERROR    lxc_cgfsng -
cgfsng.c:recursive_destroy:1270 - Error destroying
/sys/fs/cgroup/freezer//lxc/poetic-stork

            lxc 20170418145150.335 ERROR    lxc_conf -
conf.c:userns_exec_1:4453 - Error setting up child mappings

            lxc 20170418145150.335 ERROR    lxc_cgfsng -
cgfsng.c:recursive_destroy:1270 - Error destroying
/sys/fs/cgroup/net_cls//lxc/poetic-stork

            lxc 20170418145150.340 ERROR    lxc_conf -
conf.c:userns_exec_1:4453 - Error setting up child mappings

            lxc 20170418145150.340 ERROR    lxc_cgfsng -
cgfsng.c:recursive_destroy:1270 - Error destroying
/sys/fs/cgroup/perf_event//lxc/poetic-stork

            lxc 20170418145150.346 ERROR    lxc_conf -
conf.c:userns_exec_1:4453 - Error setting up child mappings

            lxc 20170418145150.346 ERROR    lxc_cgfsng -
cgfsng.c:recursive_destroy:1270 - Error destroying
/sys/fs/cgroup/net_prio//lxc/poetic-stork

            lxc 20170418145150.351 ERROR    lxc_conf -
conf.c:userns_exec_1:4453 - Error setting up child mappings

            lxc 20170418145150.351 ERROR    lxc_cgfsng -
cgfsng.c:recursive_destroy:1270 - Error destroying
/sys/fs/cgroup/hugetlb//lxc/poetic-stork

            lxc 20170418145150.356 ERROR    lxc_conf -
conf.c:userns_exec_1:4453 - Error setting up child mappings

            lxc 20170418145150.356 ERROR    lxc_cgfsng -
cgfsng.c:recursive_destroy:1270 - Error destroying
/sys/fs/cgroup/pids//lxc/poetic-stork

            lxc 20170418145150.362 ERROR    lxc_conf -
conf.c:userns_exec_1:4453 - Error setting up child mappings

            lxc 20170418145150.362 ERROR    lxc_cgfsng -
cgfsng.c:recursive_destroy:1270 - Error destroying
/sys/fs/cgroup/debug//lxc/poetic-stork

            lxc 20170418145150.368 ERROR    lxc_conf -
conf.c:userns_exec_1:4453 - Error setting up child mappings

            lxc 20170418145150.368 ERROR    lxc_cgfsng -
cgfsng.c:recursive_destroy:1270 - Error destroying
/sys/fs/cgroup/systemd//lxc/poetic-stork

            lxc 20170418145441.943 INFO     lxc_confile -
confile.c:config_idmap:1531 - read uid map: type u nsid 0 hostid 1000000
range 1000000000

            lxc 20170418145441.943 INFO     lxc_confile -
confile.c:config_idmap:1531 - read uid map: type g nsid 0 hostid 1000000
range 1000000000

            lxc 20170418145441.954 INFO     lxc_confile -
confile.c:config_idmap:1531 - read uid map: type u nsid 0 hostid 1000000
range 1000000000

            lxc 20170418145441.954 INFO     lxc_confile -
confile.c:config_idmap:1531 - read uid map: type g nsid 0 hostid 1000000
range 1000000000



>From the log it seems my kernel lacks some cgroup support, but according to
my check (via menuconfig) all the cgroup settings are there: is there a way
to check that everything needed is present? (e.g. I know docker had a
script that checks the presence of all the necessary kernel
configuration/modules).


Any ideas?


Regards,

    Max
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20170418/892aa71b/attachment-0001.html>


More information about the lxc-users mailing list