reset-state instances with Api in openstack
hello Is there any Api for reset-state instance status to active or error on openstack api ?
Hello, $ openstack server set --state also see this https://docs.openstack.org/api-ref/compute/#reset-server-state-os-resetstate... Regards On Tue, Dec 26, 2023 at 6:41 PM Parsa Aminian <p.aminian.server@gmail.com> wrote:
hello Is there any Api for reset-state instance status to active or error on openstack api ?
Hey Parsa, There are two-ways to reset the state of instance by Openstack API; - Using the Nova reset-state; $ nova reset-state --active c6bbbf26-b40a-47e7-8d5c-eb17bf65c485 - Using the os-resetstate; POST /v2/{tenant_id}/servers/{server_id}/action { "os-resetState": { "state": "active" } } Best, Kerem Çeliker
Hope Horizon also has this feature. Sometimes we have to do things for customers which is annoying sometime :( On Tue, Dec 26, 2023 at 1:47 PM KEREM CELIKER <kmceliker@gmail.com> wrote:
Hey Parsa,
There are two-ways to reset the state of instance by Openstack API;
- Using the Nova reset-state;
$ nova reset-state --active c6bbbf26-b40a-47e7-8d5c-eb17bf65c485
- Using the os-resetstate;
POST /v2/{tenant_id}/servers/{server_id}/action { "os-resetState": { "state": "active" } }
Best, Kerem Çeliker
thanks but I have this error on Api Response : Policy doesn't allow os_compute_api:os-admin-actions:reset_state to be performed. On Thu, Dec 28, 2023 at 3:41 AM Satish Patel <satish.txt@gmail.com> wrote:
Hope Horizon also has this feature. Sometimes we have to do things for customers which is annoying sometime :(
On Tue, Dec 26, 2023 at 1:47 PM KEREM CELIKER <kmceliker@gmail.com> wrote:
Hey Parsa,
There are two-ways to reset the state of instance by Openstack API;
- Using the Nova reset-state;
$ nova reset-state --active c6bbbf26-b40a-47e7-8d5c-eb17bf65c485
- Using the os-resetstate;
POST /v2/{tenant_id}/servers/{server_id}/action { "os-resetState": { "state": "active" } }
Best, Kerem Çeliker
On Wed, 2024-01-03 at 15:48 +0330, Parsa Aminian wrote:
thanks but I have this error on Api Response : Policy doesn't allow os_compute_api:os-admin-actions:reset_state to be performed. reset-state is a adimin only server action because its generally unsafe. horizon hostorically has not exposed all the admin apis via its ui. if you go to the admin endpoint and navagate to the instance you may be able to use reset-state in horizon i have never tried that but reset-state should not be exposed in the normal horizon ui.
i would recomend uing hard-reboot instead of non adimins. hard-reboot is the recommend way to recover form error state as a first attempt.
On Thu, Dec 28, 2023 at 3:41 AM Satish Patel <satish.txt@gmail.com> wrote:
Hope Horizon also has this feature. Sometimes we have to do things for customers which is annoying sometime :(
On Tue, Dec 26, 2023 at 1:47 PM KEREM CELIKER <kmceliker@gmail.com> wrote:
Hey Parsa,
There are two-ways to reset the state of instance by Openstack API;
- Using the Nova reset-state;
$ nova reset-state --active c6bbbf26-b40a-47e7-8d5c-eb17bf65c485
- Using the os-resetstate;
POST /v2/{tenant_id}/servers/{server_id}/action { "os-resetState": { "state": "active" } }
these are both the same way. the nova client just dose a post to api the nova cli does not have database access and is just calling the rest api.
Best, Kerem Çeliker
participants (5)
-
Amit Uniyal
-
KEREM CELIKER
-
Parsa Aminian
-
Satish Patel
-
smooney@redhat.com