lxc containers fail to autoboot in 14.04 trusty using 'lxc.start.auto = 1'

Posted by user273046 on Ask Ubuntu See other posts from Ask Ubuntu or by user273046
Published on 2014-04-23T13:33:21Z Indexed on 2014/08/22 16:36 UTC
Read the original article Hit count: 288

Filed under:
|
|

In trusty 14.04 containers fail to autoboot despite all settings being set as 14.04 requires. They show all as STOPPED

I have correctly configured 2 LXC containers:

calypso  
encelado

They run perfectly if I run
sudo lxc-autostart

then
sudo lxc-ls --fancy results in:

ubuntu@saturn:/etc/init$ sudo lxc-ls --fancy 
NAME      STATE    IPV4           IPV6  AUTOSTART 

calypso   RUNNING  192.168.1.161  -     YES        
encelado  RUNNING  192.168.1.162  -     YES 

The problem is trying to run them at boot.

I have at: /var/lib/lxc/calypso/config:

# Template used to create this container: /usr/share/lxc/templates/lxc-download 
# Parameters passed to the template:
# For additional config options, please look at lxc.conf(5)

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

# Container specific configuration
lxc.rootfs = /var/lib/lxc/calypso/rootfs 
lxc.utsname = calypso

# Network configuration
lxc.network.type = veth
lxc.network.flags = up
#lxc.network.link = lxcbr0
lxc.network.link = br0
lxc.network.hwaddr = 00:16:3e:64:0b:6e  

# Assegnazione IP Address
lxc.network.ipv4 = 192.168.1.161/24
lxc.network.ipv4.gateway = 192.168.1.1 

# Autostart
lxc.start.auto = 1
lxc.start.delay = 5
lxc.start.order = 100

and I have LXC_AUTO="false" as required inside /etc/default/lxc:

LXC_AUTO="false"
USE_LXC_BRIDGE="false"  # overridden in lxc-net
[ -f /etc/default/lxc-net ] && . /etc/default/lxc-net
LXC_SHUTDOWN_TIMEOUT=120

Any idea on why the containers don't start at boot? At reboot they are always in the STOPPED state:

ubuntu@saturn:~$ sudo lxc-ls --fancy
NAME      STATE    IPV4  IPV6  AUTOSTART 
calypso   STOPPED  -     -     YES       
encelado  STOPPED  -     -     YES   

and then again they can be started manually, using sudo lxc-autostart

© Ask Ubuntu or respective owner

Related posts about 14.04

Related posts about autostart