[libvirt] [libvirt-guests] New feature ALWAYS_START

Martin Kletzander mkletzan at redhat.com
Wed Sep 23 08:50:58 UTC 2015

On Tue, Sep 22, 2015 at 07:33:30AM +0200, Marek Lukács wrote:
>It will be nice feature to have configuration option
>ALWAYS_START="$uri:$name $uri:name ..." in libvirt-guests
>configuration file.
>If ON_BOOT is "start" and if ALWAYS_START is not empty, it iterates
>over the ALWAYS_START and starts guests with same conditions (delays
>etc.) before it starts guests from LISTFILE.

To be honest, I don't think that's _exactly_ what you want _just_ from
libvirt itself; let me explain.

>- guests are started with delays

Delays that are done due to the guests are not something we should
handle.  Guests and mainly the applications inside them should handle
this gracefully.  Just delaying the starts is still error-prone.

>- guests are started after host failure

That's what libvirt-guests does already.  And if you want some domains
to be started on every start, there's the 'autostart' parameter for

>- guests are started in specific order (for example complex
>environment, when DB should be started before other guest, etc.)

Again, same as the first point.  This should be handled gracefully in
the application itself or at least worked around in the guest (not
starting DB-related app before DB is accessible).

Anyway, if you *really* want this, then the easiest thing to do is
creating a service that starts before libvirt-guests, but after
libvirt, which is just something similar to "local", so it just runs a
script that does:

  for i in domain_one some_other_domain database_dom
    virsh start "$i"
    sleep 60 # or you can try connecting to make sure it started

or something similar.  However, you might still propose a simple patch
for the feature you described.

>Marek Lukács
>libvir-list mailing list
>libvir-list at redhat.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150923/462dc271/attachment-0001.sig>

More information about the libvir-list mailing list