[openstack-dev] [nova][searchlight] status of an instance on the REST API and in the instance notifications

Balazs Gibizer balazs.gibizer at ericsson.com
Wed Jul 19 15:27:59 UTC 2017


Hi,

Steve asked the following question on IRC [1]

< sjmc7> hi gibi. sorry, meant to bring this up in the notifications 
meeting but i had to step away for a bit. we were having a discussion 
last week about the field that the API returns as 'status' - do the 
notifications have an equivalent?

I will try to answer it here so others can chime in.

Internally in nova an instance has vm_state, task_state and 
power_state. On the REST API the instance has status which is 
calculated from vm_state and task_state. See the code doing the 
conversion here [2]. The instance notifications contain both the 
vm_state, task_state and power_state of the instance but do not contain 
the calculated status value [3]. The instance.update notification has 
extra state fields to signal possible state transitions [4].

Technically we can add the calculated status field to the notifications 
but it is not there at the moment. So if searchlight needs that info 
right now then it needs to be calculated on searchlight side based on 
the vm_state and the task_state from the notification.

Adding this field can be a continuation of the bp 
additional-notification-fields-for-searchlight [5] in Queens.


Cheers,
gibi

[1] 
http://eavesdrop.openstack.org/irclogs/%23openstack-nova/%23openstack-nova.2017-07-18.log.html#t2017-07-18T17:39:36
[2] 
https://github.com/openstack/nova/blob/a4a9733f4a9ead01356f0f76c1bb1f04f905fa4e/nova/api/openstack/common.py#L113
[3] 
https://github.com/openstack/nova/blob/2e4417d57cb6f74664c5746b43db9a96797f33e9/nova/notifications/objects/instance.py#L52-L54
[4] 
https://github.com/openstack/nova/blob/2e4417d57cb6f74664c5746b43db9a96797f33e9/nova/notifications/objects/instance.py#L352
[5] 
https://blueprints.launchpad.net/nova/+spec/additional-notification-fields-for-searchlight




More information about the OpenStack-dev mailing list