incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Lalancette <>
Subject Re: [PATCH] Canonicalize instance states.
Date Mon, 20 Sep 2010 17:35:28 GMT
On 09/10/10 - 04:44:09PM, David Lutterkort wrote:
> On Thu, 2010-09-09 at 15:30 -0400, Chris Lalancette wrote:
> > For some drivers, we were passing the raw string we got from
> > the cloud provider through as the instance state.  However,
> > that doesn't fit in with trying to make the drivers act consistent,
> > so make sure all of the drivers have a translation layer between
> > the cloud provider's states and the deltcloud API states.
> ACK to the patch; stylistically, it would be more rubyish if states were
> symbols internally, but that'll be a battle for another day.

Yeah, I actually tried to make them symbols at first, but it blew up in my
face.  I'm not quite sure why; it's probably some misunderstanding I have about
symbols in Ruby, but as you say, it's a minor optimization we can do later.

Can either you or Michal push this patch for me?  I still don't have commit

> >   After
> > this series, there are only 3 valid deltacloud states: "RUNNING",
> > "STOPPED", and "PENDING".  We may want to think about adding
> > additional states in the future, but these cover most of the
> > current use-cases.
> After not getting anywhere with writing this down, I took all the state
> machines from existing drivers and put them into a PDF (attached).

Heh.  I did exactly the same thing, which is what led me to this patch :).
I should have attached my PDF to save you the work; sorry about that.

> The only other state that seems important is 'Shutting_down' (e.g., RAX
> and Rimu)
> There are also plenty of errors in the state machines: e.g., EC2 has a
> Shutting_down state, but it's impossible to get to; RHEV-M transitions
> from pending to shutting_down on create.

I'm not 100% sure that this is the case.  Note that things can happen to the
instances behind our backs, so it is possible to get to those states.  For
instance, if you were to shut down an EC2 instance through the web interface,
during the shutdown stage the instance does indeed get set to "shutting-down".
So you can get there.

However, the problem we currently have (and what this patch is fixing) is that
we are conflating the cloud internal states with the states we represent to
the deltacloud consumers.  We probably need more detailed handling within
the individual drivers to handle the "backend" states more appropriately, but
we don't need to necessarily model them for the frontend consumers (continuing
with the EC2 example, if we see a "shutting-down" state, we don't necessarily
need to report it to the front-end since that is a sure sign the instance will
soon be in "stopped").

Chris Lalancette

View raw message