You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by Chris Lalancette <cl...@redhat.com> on 2011/01/03 17:46:32 UTC

Re: which states?

On 12/31/10 - 04:14:15PM, Adrian Cole wrote:
> Hi, team.
> 
> In the docs (and rackspace driver), I've noticed the states:
>     * :begin
>     * :pending
>     * :running
>     * :shutting_down
>     * :stopped
>     * :end
> 
> However, in the mock driver, the states are:
>     * :start
>     * :pending
>     * :running
>     * :stopped
>     * :finish
> 
> Which states are correct?

It is actually a very confusing issue, one that I've been hoping to get
resolved and haven't yet.

There are actually two notion of state in the deltacloud drivers; the backend
states that an instance can go through, and the frontend states that we
expose to the user.  At present, we only expose PENDING, RUNNING, and
TERMINATED as frontend states (though we also want to expose STOPPED pretty
soon).

The backend state machine is a reflection of what can go on in the actual
cloud.  For instance, an EC2 instance might go
pending->running->shutting_down->terminated (states returned from EC2 itself),
but we only expose PENDING, RUNNING, and TERMINATED to the front-end.

In the end, there is not really a problem exposing new states to the frontend
user, but it has to be done in a way that is consistent across all of the
drivers.  Otherwise you create a situation where a client cannot generically
use the deltacloud APIs.

-- 
Chris Lalancette

Re: which states?

Posted by David Lutterkort <lu...@redhat.com>.
On Mon, 2011-01-03 at 11:46 -0500, Chris Lalancette wrote:
> The backend state machine is a reflection of what can go on in the actual
> cloud.  For instance, an EC2 instance might go
> pending->running->shutting_down->terminated (states returned from EC2 itself),
> but we only expose PENDING, RUNNING, and TERMINATED to the front-end.

It seems that we forgot to update the instance_states collection, i.e.
the FSM describing possible state transitions, when the set of states
that can be reported for an instance was clamped down.

One side-effect of this is that we'll report the wrong actions for
instances, as those are computed from the FSM using instance_action_for.

David