Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

display the current task value in the status option #89

Closed
f2brossi opened this issue Sep 5, 2014 · 5 comments
Closed

display the current task value in the status option #89

f2brossi opened this issue Sep 5, 2014 · 5 comments
Assignees
Milestone

Comments

@f2brossi
Copy link
Contributor

f2brossi commented Sep 5, 2014

It would be useful to display in the status option, the task value of the instance :

RUNNING
SUSPENDING
RESUMING
SPAWNING
NONE

This feature is interesting especially for transition tasks that take time like SUSPENDING, RESUMING.

@f2brossi
Copy link
Contributor Author

For doing that we need the nova API v2.1 http://developer.openstack.org/api-ref-compute-v2.1.html

Especially the end point /v2.1/servers/details that return notably :
"os-extended-status:locked_by": null,
"os-extended-status:power_state": 1,
"os-extended-status:task_state": null,
"os-extended-status:vm_state": "active",
"progress": 0,owever we
"status": "ACTIVE",
"tenant_id": "openstack",
"updated": "2013-09-16T03:07:10Z",
"user_id": "fake"
The V2.1 API is experimental and not enabled by default in Juno.

However we could check that the endpoint exist and if yes display the information. Feature

@f2brossi
Copy link
Contributor Author

Also already available in api v2 extensions http://developer.openstack.org/api-ref-compute-v2-ext.html

with endpoint get /v2/​{tenant_id}​/servers/detail

In fact, v2.1 is the same as v2 extensions without xml support and with strong input validation with jsonshema. http://chris.yeoh.info/2014/09/09/nova-v2-1-api/

I will check that.

@f2brossi
Copy link
Contributor Author

I have just tested on my cloud provider the following command :
get {{novaUrl}}/{{tenant_id}}/servers/detail

I can confirm that we have the transition task_state in the response
For sample, OS-EXT-STS:task_state: "suspending"

So when task_state is not null we can
1° display this information in status option
2° And also preventing from resuming a vm suspending

@f2brossi
Copy link
Contributor Author

So after a > vagrant suspend

vagrant status
Current machine states:
default State: active - Task: suspending (openstack)

then
Current machine states:
default State: suspended - Task: none (openstack)

And then :
Current machine states:
default State: suspended - Task: resuming (openstack)

And finally
Current machine states:
default State: active - Task: none (openstack)

NB: All tasks transition states are defined here https://github.com/openstack/nova/blob/master/nova/compute/task_states.py

@julienvey
Copy link
Collaborator

Work in progress by @f2brossi here #157

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants