<div dir="ltr"><div>Hi Martin,<br><br></div>thank you for your reply. Please check my comments.<br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 23, 2015 at 10:50 AM, Martin Kletzander <span dir="ltr"><<a href="mailto:mkletzan@redhat.com" target="_blank">mkletzan@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Sep 22, 2015 at 07:33:30AM +0200, Marek Lukács wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
It will be nice feature to have configuration option<br>
ALWAYS_START="$uri:$name $uri:name ..." in libvirt-guests<br>
configuration file.<br>
<br>
If ON_BOOT is "start" and if ALWAYS_START is not empty, it iterates<br>
over the ALWAYS_START and starts guests with same conditions (delays<br>
etc.) before it starts guests from LISTFILE.<br>
<br>
</blockquote>
<br></span>
To be honest, I don't think that's _exactly_ what you want _just_ from<br>
libvirt itself; let me explain.<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Benefits:<br>
- guests are started with delays<br>
</blockquote>
<br></span>
Delays that are done due to the guests are not something we should<br>
handle.  Guests and mainly the applications inside them should handle<br>
this gracefully.  Just delaying the starts is still error-prone.<span class=""><br></span></blockquote><div><br></div><div>I fully understand this and fully agree with you. Production application has to handle this gracefully. But still I see a space for doing it in environments where it is not so necessary to configure application so gracefully, like development or testing environments. Delays are fine for many not production environments, where applications are not in production state.<br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- guests are started after host failure<br>
</blockquote>
<br></span>
That's what libvirt-guests does already.  And if you want some domains<br>
to be started on every start, there's the 'autostart' parameter for<br>
domains.<span class=""><br></span></blockquote><div><br></div><div>No, libvirt-guests only starts those domains which has been running before "service" libvirt-guests has been stopped. In case of host failure, there is no LISTFILE in filesystem, as it has not been generated by libvirt-guests stop mechanism.<br><br></div><div>But probably I do not understand "script" libvirt-guests correctly and why it is in libvirt. I will be happy, if you will give me more details, why there is this script, even if libvirt has 'autostart' parameter for domains.<br><br>- For what usage is libvirt-guests designed?<br>- Why it supports delays?<br></div><div>- Why to have libvirt-guests if there is 'autostart' domain parameter?<br></div><div>- For who is libvirt-guests and who should use 'autostart' domain parameter?<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
- guests are started in specific order (for example complex<br>
environment, when DB should be started before other guest, etc.)<br>
<br>
</blockquote>
<br></span>
Again, same as the first point.  This should be handled gracefully in<br>
the application itself or at least worked around in the guest (not<br>
starting DB-related app before DB is accessible).<br>
<br>
Anyway, if you *really* want this, then the easiest thing to do is<br>
creating a service that starts before libvirt-guests, but after<br>
libvirt, which is just something similar to "local", so it just runs a<br>
script that does:<br>
<br>
 for i in domain_one some_other_domain database_dom<br>
 do<br>
   virsh start "$i"<br>
   sleep 60 # or you can try connecting to make sure it started<br>
 done<br>
<br>
or something similar.  However, you might still propose a simple patch<br>
for the feature you described.<br></blockquote><div><br></div><div>For me it is no problem to design my own script to handle my needs. I have spent some time googling, if there is already a tool for it. I found only similar questions, so I got feeling, that I am not the only one with similar requirements.<br><br></div><div>Script libvirt-guests in my eyes handles very similar task. It starts domains with delays, it starts domains what has been running at previous stop, but do not handle situation in case of host failure and do not starts domain in specific order. I prefer and I think, that it is better to not create new script no one knows about, but to modify existing one everybody knows about. But again, maybe I do not understand why and for what libvirt-guests is.<br></div><div><br></div><div>Anyway, much easier in case of testing and development environments is to set start sequence in /etc/rc.local and forget about script like libvirt-guests, if it does not have features I described.<br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Regards,<br>
<br>
Marek Lukács<span class="HOEnZb"><font color="#888888"><br>
<br>
--<br>
libvir-list mailing list<br>
<a href="mailto:libvir-list@redhat.com" target="_blank">libvir-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/libvir-list" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/libvir-list</a><br>
</font></span></blockquote>
</blockquote></div><br></div></div>