OSAPI: A server with DB state of 'shutdown' shows as 'ACTIVE'.

Bug #758871 reported by Dan Prince
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Alex Meade

Bug Description

Nova trunk 2011.2~gamma2~ (981):

Using the OSAPI a server with a DB state of 'shutdown' shows up as 'ACTIVE' in the API.

mysql> select id, state, state_description from instances;
+----+-------+-------------------+
| id | state | state_description |
+----+-------+-------------------+
| 1 | 5 | shutdown |
+----+-------+-------------------+

root@nova1:~# nova list
+----+------+--------+-----------+------------+
| ID | Name | Status | Public IP | Private IP |
+----+------+--------+-----------+------------+
| 1 | Yo Dawg | ACTIVE | | 172.19.1.2 |
+----+------+--------+-----------+------------+

root@nova1:~# euca-describe-instances
RESERVATION r-lo6v517h admin default
INSTANCE i-00000001 ami-00000003 172.19.1.2 172.19.1.2 shutdown None (admin, xen-compute) 0 m1.tiny 2011-04-12T15:20:03Z nova

Related branches

Dan Prince (dan-prince)
Changed in nova:
assignee: nobody → Titan (rackspace-titan)
Revision history for this message
Paul Voccio (pvo) wrote :

This has always been a difference in how the actual state of the vm reflected the difference in what is essentially a billing status. The vm is technically active and could be restarted as it is available for customer interaction.

If the status of 'shutdown' or 'rebooting' or any other possible action on a vm is to be reflected in the state should it be another field in the api? The vm could be in ACTIVE status and shutdown. That seems reasonable.

Revision history for this message
Dan Prince (dan-prince) wrote :

Sure. The issue I have here is where a catastrophic failure of happened and the node still shows up as being 'Active'.

In my case:

 -No VM was created
 -I have a stack trace in nova-compute explaining why
 -The openstack API shows a status of 'ACTIVE'.

In this case I would actually expect to see a state of 'ERROR' in the status log but I don't. Looking at the code there are a couple things going on here that seem problematic. On a catestrophic failure we seem to set the state to 'SHUTDOWN' instead of 'ERROR'. Additionally even if we did set the state to 'ERROR' in the virt layer there is a function in the compute manager called _poll_instance_states which will change the DB status of 'ERROR' to 'SHUTOFF' if the instance doesn't match what is in the DB. All of this leaves you with a node which marked as 'ACTIVE' in the OS API which implies the node is in a usable state.

Alex Meade (alex-meade)
Changed in nova:
assignee: Titan (rackspace-titan) → Alex Meade (alex-meade)
Revision history for this message
Alex Meade (alex-meade) wrote :

I'm changing it to more accurately represent the instances power state for the time being. This is definitely something that needs to be determined in the future. I don't necessary think the user should be bombarded with a bunch of power states but I do think what it says needs to be meaningful. Or like Paul said, lets show both the billing status and power state.

Dan Prince (dan-prince)
Changed in nova:
status: New → In Progress
Alex Meade (alex-meade)
Changed in nova:
status: In Progress → Fix Committed
Alex Meade (alex-meade)
Changed in nova:
status: Fix Committed → In Progress
Thierry Carrez (ttx)
Changed in nova:
importance: Undecided → Medium
Revision history for this message
Jay Pipes (jaypipes) wrote :

Hi, what's the reason this is in In Progress? AFAIK, the fix was merged, no?

Dan Prince (dan-prince)
Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → diablo-1
Thierry Carrez (ttx)
Changed in nova:
milestone: diablo-1 → 2011.3
status: Fix Committed → Fix Released
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.