DeleteInstance

Last Updated: Apr 11, 2018

Description

Releases a Pay-As-You-Go instance.

  • You can only release an instance that is in the Stopped status.

  • After the instance is released, all the physical resources used by the instance are recycled, removed, and impossible to recover. The attached cloud disks with the property of DeleteWithInstance=True are also released. The automatic snapshots of these disks with the property of DeleteAutoSnapshot=False are retained, and automatic snapshots with the property of DeleteAutoSnapshot=True are released.

  • If the instance is under security control and OperationLocks indicates LockReason: security, we ignore the property DeleteWithInstance=False of its attached cloud disks and release them directly.

Request parameters

Name Type Required Description
Action String Yes The name of this interface. Value: DeleteInstance.
InstanceId String Yes ID of an instance.

Response parameters

For more information about all the common response parameters, see Common parameters.

Examples

Request example

  1. https://ecs.aliyuncs.com/?Action=DeleteInstance
  2. &InstanceId=i-instance1
  3. &<Common Request Parameters>

Response example

XML format

  1. <DeleteInstanceResponse>
  2. <RequestId>928E2273-5715-46B9-A730-238DC996A533</RequestId>
  3. </DeleteInstanceResponse>

JSON format

  1. {
  2. "RequestId": "928E2273-5715-46B9-A730-238DC996A533"
  3. }

Error codes

Error code Error message HTTP status code Meaning
DependencyViolation.RouteEntry Specified instance is used by route entry. 400 The specified instance is used by the service Route entry.
DependencyViolation.SLBConfiguring Specified operation is denied as your instance is using by another product. 400 The specified instance is used by the service Server Load Balancer.
InvalidParameter The input parameter InstanceId is invalid. 400 The specified InstanceId is invalid.
ChargeTypeViolation The operation is not permitted due to charge type of the instance. 403 You cannot release an subscribed instance.
IncorrectInstanceStatus The current status of the resource does not support this operation. 403 You can only release an instance that is in the Stopped status.
IncorrectInstanceStatus.Initializing The specified instance status does not support this operation. 403 The specified instance is being created. Please try again later.
InstanceLockedForSecurity The specified operation is denied as your instance is locked for security reasons. 403 Your instance is locked out of security.
InvalidInstanceId.NotFound The specified InstanceId does not exist. 404 The specified InstanceId does not exist.
Thank you! We've received your feedback.