[lxc-users] Autostart lxc containers in a CentOS7 host

Michael H. Warfield mhw at WittsEnd.com
Thu Oct 30 16:17:11 UTC 2014


On Wed, 2014-10-29 at 06:46 +0000, C. L. Martinez wrote:
> Hi all,
> 
>  I have installed some lxc containers under a CentOS7 host (5 CentOS
> based and 3 Ubuntu). All works ok, but I need to start automatically
> some of these containers when host reboots or it is restarted.
> 
>  Are these the correct steps?

> a) Enable lxc service: systemctl enable lxc.service

> b) Reconfigure lxc container config file with the following options:

> # Autostart
> lxc.start.auto = 1
> lxc.start.delay = 5

> lxc.start.order = 100

lxc.start.order is not required unless you are doing strict prioritized
ordering.

Also be careful about lxc.group.  If your container is a member of any
group, it must also be a member of the "onboot" group or it will be
ignored by the scripts by default.  By default, the helper scripts will
start members of the "onboot" group first and then any containers that
are not a member of any group.  That too is configurable.

I would add...

lxc.group = onboot

Just to be sure.

I know it seems to be somewhat redundant to specify "lxc.start.auto = 1"
and "lxc.group = onboot" but it's there for some corner cases with group
memberships.

> Am I right??

Regards,
Mike
-- 
Michael H. Warfield (AI4NB) | (770) 978-7061 |  mhw at WittsEnd.com
   /\/\|=mhw=|\/\/          | (678) 463-0932 |  http://www.wittsend.com/mhw/
   NIC whois: MHW9          | An optimist believes we live in the best of all
 PGP Key: 0x674627FF        | possible worlds.  A pessimist is sure of it!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 465 bytes
Desc: This is a digitally signed message part
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20141030/e6bfec0a/attachment.sig>


More information about the lxc-users mailing list