State diagram for the Host object during provisioning

Howdy, -dev inhabitants :slight_smile:

I'm about to start doing some work on the provisioning parts of
Foreman, and we decided it might be a good idea to write down all the
states a server can get itself into during the install process. I'd
really like to get input from the community to be sure I've covered
all the possibilities before I start working on it. I don't want to
miss any possible transitions either.

Accordingly, I've uploaded a draft of the state diagram here:
http://imgur.com/xWqdC

A few notes. Some of the states and actions aren't yet implemented -
they're displayed in light red. For example, we'd like to be able to
detect the host running each stage of the install (got provision
script, running pre, running post, etc) but right now we can only say
that a host is in build mode or not - we don't update the Host object
when it retrieves it's provision template.

The complicated set of arrows on the right is intended to portray the
transition where a server requests any template it has already used -
this would imply a boot loop, which we should detect and warn about.

Looking forward to the input :slight_smile:

Greg

> Howdy, -dev inhabitants :slight_smile:
>
> I'm about to start doing some work on the provisioning parts of
> Foreman, and we decided it might be a good idea to write down all the
> states a server can get itself into during the install process. I'd
> really like to get input from the community to be sure I've covered
> all the possibilities before I start working on it. I don't want to
> miss any possible transitions either.
>
> Accordingly, I've uploaded a draft of the state diagram here:
> http://imgur.com/xWqdC
>
> A few notes. Some of the states and actions aren't yet implemented -
> they're displayed in light red. For example, we'd like to be able to
> detect the host running each stage of the install (got provision
> script, running pre, running post, etc) but right now we can only say
> that a host is in build mode or not - we don't update the Host object
> when it retrieves it's provision template.
>
> The complicated set of arrows on the right is intended to portray the
> transition where a server requests any template it has already used -
> this would imply a boot loop, which we should detect and warn about.
>
> Looking forward to the input :slight_smile:
>

a couple of items / questions?

  • what about vm provisioning, I'm guessing we can add a few more states?
  • what about image + ssh based provisioning ?

Ohad

路路路 On Thu, Oct 25, 2012 at 7:38 PM, Greg Sutcliffe wrote:

Greg

> a couple of items / questions?
>
> - what about vm provisioning, I'm guessing we can add a few more states?

What states did you have in mind? I can think of maybe one or two
before the vm boots up ("vm requested", "vm created") but after that
the flow should be the same as for a physical server. Guess I need to
go read the code path for libvirt :wink:

> - what about image + ssh based provisioning ?

Again, I see "vm requested" and "vm created" as possible states, and
then "ssh started" and "build complete". We already do this with the
EC2 provisioning - you can see it start the ssh process, and obviously
the final state is build complete when you get returned to the Host
page.

However, this would be a totally separate section of the diagram,
since it doesn't really relate to TFTP/[i]PXE/etc. The only two states
it would have in common is Host Created and Build Complete - is it
worth complicating up the diagram with this?

路路路 On 25 October 2012 20:30, Ohad Levy wrote:

this is all current state stuff? What about a re-provision case? How is
that done?

鈥 bk

路路路 On 10/26/2012 06:21 AM, Greg Sutcliffe wrote: > On 25 October 2012 20:30, Ohad Levy wrote: >> a couple of items / questions? >> >> - what about vm provisioning, I'm guessing we can add a few more states? > > What states did you have in mind? I can think of maybe one or two > before the vm boots up ("vm requested", "vm created") but after that > the flow should be the same as for a physical server. Guess I need to > go read the code path for libvirt ;) > >> - what about image + ssh based provisioning ? > > Again, I see "vm requested" and "vm created" as possible states, and > then "ssh started" and "build complete". We already do this with the > EC2 provisioning - you can see it start the ssh process, and obviously > the final state is build complete when you get returned to the Host > page. > > However, this would be a totally separate section of the diagram, > since it doesn't really relate to TFTP/[i]PXE/etc. The only two states > it would have in common is Host Created and Build Complete - is it > worth complicating up the diagram with this? >

We're tracking the state of the Host object - the physical server will
boot the appropriate [i]PXE file as it comes up. So, for a
reprovision, the transition is just "Enable Build" on the Host (either
by clicking the button or using the API) and then reboot the server. I
skipped that from the diagram as it's basically just a really long
arrow from the bottom to the top. I can add it if it adds clarity.

路路路 On 26 October 2012 13:41, Bryan Kearney wrote: > this is all current state stuff? What about a re-provision case? How is that > done?