Clearing instances from a “provisioning" state
Modified: 17 Jan 2023 21:28 UTC
It is possible that an instance will be stuck perpetually in the provisioning state. This will prevent you from deleting or modifying the instance. Once you have examined the failure and determined it's cause, you can use sdc-vmapi to force the instance into a failed state.
Procedure to force an instance into a failed state
This procedure requires access to the head node and uses the vmapi API. Please note that you should always investigate the failure to determine why the instance is stuck in a provisioning state. MNX support can assist as required with this task.
Step 1: Validate the state of the instance
# sdc-vmapi /vms/2b2c578f-cf77-46bf-85bc-b84478e64ac4 | json -Ha uuid alias state
2b2c578f-cf77-46bf-85bc-b84478e64ac4 test01 provisioning
Step 2: Force the job execution state to failed
# sdc sdc-vmapi /job_results -X POST --data '{ "vm_uuid": "2b2c578f-cf77-46bf-85bc-b84478e64ac4", "execution": "failed" }'
HTTP/1.1 200 OK
Date: Fri, 24 May 2013 23:59:53 GMT
Connection: keep-alive
Transfer-Encoding: chunked
Step 3: Validate the new state
# sdc-vmapi /vms/2b2c578f-cf77-46bf-85bc-b84478e64ac4 | json -Ha uuid alias state
2b2c578f-cf77-46bf-85bc-b84478e64ac4 test01 failed
At this point, the instance should show the correct state, which is failed.