[Lxc-users] start order

Jäkel, Guido G.Jaekel at dnb.de
Tue Dec 11 08:34:38 UTC 2012


Hi all,

here my 5ct on auto start and start order: Because i'm using a farm of LXC hosts where my containers may be spread over, i also need to persist the "preferred host" of a container. This is currently stored in a separate configuration file. Because this information should be easy accessible by the Container also for some special reasons, it is stored in the containers root file system. 

If a LXC host boots, it will scan for this information and start it's "assigned" containers -- but only if they are not already started on other non-preferred hosts by failover mechanisms. This is detected by some heuristic inspections like a ping to the containers management network address. For sure a LXC host farm is an advanced feature, but in this case for an lxc-internal autostart feature one need a hook script to control if an autostart-tagged container should really be started.


For a start order configuration mechanism I would prefer some kind of a local "before/after" paradigm over a concrete and total enumeration: Within the lxc configuration of a container A it should be mentioned that it depends on B (should be started "after B") and/or provide something for C (should be started "before C"). The autoboot-feature then have to calculate a concrete boot order based on this restrictions. With this, one have just to write down the real important dependencies (, which will be a small one at most).

This kind of description also covers the possible extension to start some set of (so calculated) independent containers in (an configured amount of) parallel way. This will be useful for powerful hosts with a large number of containers.


with greetings
Guido


More information about the lxc-users mailing list