[Engine-devel] Hot-plug of disks and nics

Eoghan Glynn eglynn at redhat.com
Wed Apr 11 09:02:37 UTC 2012



> * Inconsistent with other flows. We do not normally update status
> fields to perform actions. For example to run a VM, we do not update
> it's status to 'activated', we run an action (start).

I think this point is the crux of the matter.

IMO the consistency between activation implemented as direct state
manipulation versus the state change occurring as a side-effect
of an action, would be a deal-breaker.

IIRC one of the reasons we avoided that kind of direct state
manipulation first time round is that it doesn't lend itself to
multi-state transitions, e.g. activation that traversed multiple
intermediate states, say:

  quiescent->pending->activating->activated

That example is a bit contrived and unrealistic, but in any case
the principal is that the client-visible state machine for a resource
may not necessarily transition directly from the initial to the terminal
state.

Also an action as opposed to a direct state manipulation makes it more
natural to express side-effects of the activation, and to implement 
in-progress status querying or cancelation.

For those reasons, I'm thinking that using actions consistently accross
the board is better than exposing an action in one case while allowing
a direct state manipulation in another.

So my vote would be for option #2.

Cheers,
Eoghan




More information about the Devel mailing list