Instance states are reported incorrectly after stop/destroy operation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Hi,
Today we have discovered a bug in the OpenStack Nova API where executing a 'stop' or 'destroy' operation does not make the effect on the Instance state immediately.
Instance state is reported as 'RUNNING' for the short period of time, which unfortunately force clients to pool the Instance state to be sure that the instance is STOPPED.
Log from Deltacloud API:
127.0.0.1 - - [25/Sep/2012 16:09:37] "POST /api/instances/
127.0.0.1 - - [25/Sep/2012 16:09:38] "GET /api/instances/
[#<Instance:
The instance state should be reported as 'STOPPING' or 'PENDING' rather than RUNNING. Note, the state attribute is reported directly from the Nova API, Deltacloud is just forwarding that.
If this is not possible OpenStack should provide a link to 'monitor' or 'task' to monitor progress of that operation in the response after the action, or at least return 202 rather than 200.
Environment:
OpenStack Essex (2012.1.1)
Fedora 17
Sorry for taking so long to reply Michal
There is an "Extended Instance Status" API extension which exposes what you're looking for, I think
Some docs here: http:// api.openstack. org/api- ref.html
But, basically - when you issue a delete you should see task_state=DELETING in the response and task_state=STOPPING for a stop action
Let us know whether that's sufficient