13.12. Deleting virtual machines¶
Delete a server with the specified ID.
By default, the instance is going to be hard-deleted immediately from
the system, but you can set
reclaim_instance_interval > 0 to make
the API soft-delete the instance, so that the instance will not be
deleted until the
reclaim_instance_interval has expired since the
instance was soft-deleted. The instance marked as
be recovered via
restore action before it is really deleted from the
- The server must exist.
- Anyone can delete a server when the status of the server is not locked and when the policy allows.
- If the server is locked, you must have administrator privileges to delete the server.
- With correct permissions, you can see the server status as
- The ports attached to the server, which Nova created during the server create process or when attaching interfaces later, are deleted.
- The server does not appear in the list servers response.
- If hard delete, the server managed by OpenStack Compute is deleted on the compute node.
- If server status remains to be
deletingor another error, the request failed. Ensure that you meet the preconditions. Then, investigate the compute back end.
- The request returns the HTTP 409 response code when the server is locked even if you have correct permissions. Ensure that you meet the preconditions then investigate the server status.
- The server managed by OpenStack Compute is not deleted from the compute node.
||path||string||The UUID of the server.|
# curl -ks -X DELETE -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' \ https://<node_IP_addr>:8774/v2.1/f5d834d636c642c7bfe8af86139c6f26/servers/642b7726-bc3b-4824-872b-124097d2d20c
184.108.40.206. Status codes¶
||The server has fulfilled the request.|
||User must authenticate before making a request.|
||Policy does not allow current user to do this operation.|
||The requested resource could not be found.|
||This operation conflicted with another operation on this resource.|