Reset state of server(VM) using REST API

asked 2018-06-21 11:58:30 -0500

selvaraj.chennappan gravatar image

When Server(VM) status is in ERROR How to reset the status back to Active using REST API .

CLI For .e.g nova reset-state --active <vm resourceid="">

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
1

answered 2018-07-06 17:16:21 -0500

tze gravatar image

updated 2018-07-06 17:16:56 -0500

In my case i need two command to restore the server in correct state, 1) reset state to active (openstack server set --state active {server_id} ) 2) to stop server (openstack server stop {server_id} ) So in rest api you need: 1) POST on /servers/{server_id}/action with payload {"os-resetState": {"state": "active"}} 2) POST on /servers/{server_id}/action with payload {"os-stop" : null }

edit flag offensive delete link more

Comments

This worked. More info: https://docs.openstack.org/api-ref/compute/?expanded=show-hypervisor-details-detail,list-hypervisors-detail,show-hypervisor-statistics-detail,list-servers-detail,reset-server-state-os-resetstate-action-detail#reset-server-state-os-resetstate-action (https://docs.openstack.org/api-ref/co...)

Joris gravatar imageJoris ( 2020-06-30 13:07:55 -0500 )edit
0

answered 2018-06-21 16:55:33 -0500

updated 2018-06-21 16:55:46 -0500

edit flag offensive delete link more
0

answered 2018-06-22 12:34:55 -0500

Aref gravatar image

use POST: /servers/{server_id}/action

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2018-06-21 11:58:30 -0500

Seen: 902 times

Last updated: Jul 06 '18