Instance states are reported incorrectly after stop/destroy operation

Bug #1056297 reported by Michal Fojtik
12
This bug affects 1 person
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/28caf43f-96b2-4ba5-bf3e-17e745500fcd/stop HTTP/1.1" 202 1356 0.5069

127.0.0.1 - - [25/Sep/2012 16:09:38] "GET /api/instances/28caf43f-96b2-4ba5-bf3e-17e745500fcd HTTP/1.1" 200 1356 0.2876

[#<Instance:0x007fcf5352e098 @id="28caf43f-96b2-4ba5-bf3e-17e745500fcd", @image_id="41d25563-7d09-45eb-8717-f6fe01dff66f", @actions=[:reboot, :stop], @public_addresses=[], @private_addresses=[192.168.0.2], @realm_id="default", @owner_id="mfojtik", @name="test-repro", @state="RUNNING", @instance_profile=1, @username="root", @password="", @keyname="", @create_image=true>]

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

Revision history for this message
Mark McLoughlin (markmc) wrote :

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

Changed in nova:
status: New → Incomplete
Revision history for this message
Davanum Srinivas (DIMS) (dims-v) wrote :

 Feel free to reopen the bug by providing the requested information (See Mark's comment) and set the bug status back to ''New''.

Changed in nova:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.