Libvirt Autostart

Hey folks,

Currently libvirt hosts created with Foreman do not autostart and Foreman
has no ability to enable autostart. This seems like a poor default to me.
The merge itself should be very simple, just adding ':autostart =>
true/false' to the new host hash.

Would it be better to have hosts autostart by default, or to add a checkbox
for autostart in the host creation page?

Robert Birnie
rbirnie@gmail.com

+1 for adding it to the form, if it's that easy - to preserve existing
behaviour though, I would default to unchecked.

Greg

··· On 8 March 2014 00:42, Robert wrote: > Hey folks, > > Currently libvirt hosts created with Foreman do not autostart and Foreman > has no ability to enable autostart. This seems like a poor default to me. > The merge itself should be very simple, just adding ':autostart => > true/false' to the new host hash. > > Would it be better to have hosts autostart by default, or to add a checkbox > for autostart in the host creation page?

So it doesn't look like it will be possible. I worked on this some and
setting :autostart => true in the new host's hash is ignored when fog
actually creates the host. I'm unsure why but guessing that since its a new
host there's still no xml file to by symlinked by libvirt till after the
host is fully created. I also can't send the ":autostart => true" after the
host's already created as Fog doesn't let you save libvirt hosts a second
time for fear of duplicates.

I'm working on adding this functionality using foreman_hooks and will write
up a blog post on it later so folks can add it manually if they wish.

Robert Birnie
rbirnie@gmail.com

··· On Sat, Mar 8, 2014 at 4:57 AM, Greg Sutcliffe wrote:

On 8 March 2014 00:42, Robert rbirnie@gmail.com wrote:

Hey folks,

Currently libvirt hosts created with Foreman do not autostart and Foreman
has no ability to enable autostart. This seems like a poor default to me.
The merge itself should be very simple, just adding ‘:autostart =>
true/false’ to the new host hash.

Would it be better to have hosts autostart by default, or to add a
checkbox
for autostart in the host creation page?

+1 for adding it to the form, if it’s that easy - to preserve existing
behaviour though, I would default to unchecked.

Greg


You received this message because you are subscribed to the Google Groups
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

I created a blog on how to setup autostart for libvirt VMs using
Foreman-hooks. http://www.uberobert.com/autostart-libvirt-vms-in-foreman/

If you've got any recommendations to improve the script let me know.

Robert Birnie
rbirnie@gmail.com

··· On Mon, Mar 10, 2014 at 1:34 PM, Robert wrote:

So it doesn’t look like it will be possible. I worked on this some and
setting :autostart => true in the new host’s hash is ignored when fog
actually creates the host. I’m unsure why but guessing that since its a new
host there’s still no xml file to by symlinked by libvirt till after the
host is fully created. I also can’t send the “:autostart => true” after the
host’s already created as Fog doesn’t let you save libvirt hosts a second
time for fear of duplicates.

I’m working on adding this functionality using foreman_hooks and will
write up a blog post on it later so folks can add it manually if they wish.

Robert Birnie
rbirnie@gmail.com

On Sat, Mar 8, 2014 at 4:57 AM, Greg Sutcliffe greg.sutcliffe@gmail.comwrote:

On 8 March 2014 00:42, Robert rbirnie@gmail.com wrote:

Hey folks,

Currently libvirt hosts created with Foreman do not autostart and
Foreman
has no ability to enable autostart. This seems like a poor default to
me.
The merge itself should be very simple, just adding ‘:autostart =>
true/false’ to the new host hash.

Would it be better to have hosts autostart by default, or to add a
checkbox
for autostart in the host creation page?

+1 for adding it to the form, if it’s that easy - to preserve existing
behaviour though, I would default to unchecked.

Greg


You received this message because you are subscribed to the Google Groups
"foreman-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

That's great, thanks for sharing! I've added it to the foreman_hooks
README.

··· -- Dominic Cleal Red Hat Engineering

On 26/03/14 21:11, Robert wrote:

I created a blog on how to setup autostart for libvirt VMs using
Foreman-hooks. http://www.uberobert.com/autostart-libvirt-vms-in-foreman/

If you’ve got any recommendations to improve the script let me know.

Robert Birnie
rbirnie@gmail.com mailto:rbirnie@gmail.com

On Mon, Mar 10, 2014 at 1:34 PM, Robert <rbirnie@gmail.com > mailto:rbirnie@gmail.com> wrote:

So it doesn't look like it will be possible. I worked on this some
and setting :autostart => true in the new host's hash is ignored
when fog actually creates the host. I'm unsure why but guessing that
since its a new host there's still no xml file to by symlinked by
libvirt till after the host is fully created. I also can't send the
":autostart => true" after the host's already created as Fog doesn't
let you save libvirt hosts a second time for fear of duplicates. 

I'm working on adding this functionality using foreman_hooks and
will write up a blog post on it later so folks can add it manually
if they wish.


Robert Birnie
rbirnie@gmail.com <mailto:rbirnie@gmail.com>


On Sat, Mar 8, 2014 at 4:57 AM, Greg Sutcliffe >     <greg.sutcliffe@gmail.com <mailto:greg.sutcliffe@gmail.com>> wrote:

    On 8 March 2014 00:42, Robert <rbirnie@gmail.com >         <mailto:rbirnie@gmail.com>> wrote:
    > Hey folks,
    >
    > Currently libvirt hosts created with Foreman do not autostart
    and Foreman
    > has no ability to enable autostart. This seems like a poor
    default to me.
    > The merge itself should be very simple, just adding ':autostart =>
    > true/false' to the new host hash.
    >
    > Would it be better to have hosts autostart by default, or to
    add a checkbox
    > for autostart in the host creation page?

    +1 for adding it to the form, if it's that easy - to preserve
    existing
    behaviour though, I would default to unchecked.

    Greg

    --
    You received this message because you are subscribed to the
    Google Groups "foreman-dev" group.
    To unsubscribe from this group and stop receiving emails from
    it, send an email to foreman-dev+unsubscribe@googlegroups.com
    <mailto:foreman-dev%2Bunsubscribe@googlegroups.com>.
    For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google
Groups “foreman-dev” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to foreman-dev+unsubscribe@googlegroups.com
mailto:foreman-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.