lxd icon indicating copy to clipboard operation
lxd copied to clipboard

Instance auto start dependencies

Open M1cha opened this issue 3 years ago • 6 comments

Being able to specify dependencies between containers would be a very useful feature in LXD. Before a container can start, all of it's dependencies must have started and sent the READY-event. We might also want to add support for "light" dependencies which only affect autostart, but won't prevent a container from starting, similar to systemd's After option in the service definition.

We already have:

  • boot.autostart to force startup on boot
  • boot.autostart.priority to specify startup order
  • boot.autostart.delay to make containers "wait" longer until others are up

In case you want to specify dependencies, the last two are kind of a workaround and would not be required if we could specify dependencies by name directly. This could look like this:

boot.autostart.dependenies:
  - container0
  - container1

Original post on discourse

M1cha avatar Sep 26 '22 11:09 M1cha

If this is purely a question of priorities but you're otherwise fine with adding that feature, I could also try to implement it. It can't hurt to get more familiar with LXDs code :grin:

M1cha avatar Sep 26 '22 11:09 M1cha

If @stgraber is open to the idea then would be happy to assign to you.

tomponline avatar Sep 26 '22 14:09 tomponline

Ive assigned it to you @M1cha as @stgraber added it to later tag, suggesting he approves of the idea. 😀

tomponline avatar Nov 15 '22 18:11 tomponline

Yeah, I'm not generally opposed to it. We just need to be somewhat careful with handling of projects and in avoiding loops.

stgraber avatar Nov 29 '22 22:11 stgraber