You can call this operation to release a pay-as-you-go data disk. The data disk can be a basic disk, an ultra disk, a standard SSD, or an enhanced SSD (ESSD).

Description

When you call this operation, take note of the following points:

  • Manual snapshots of the disk will be retained.
  • You can call the ModifyDiskAttribute operation to configure whether automatic snapshots are retained or released with the disk. We recommend that you delete unnecessary snapshots to ensure enough snapshot quota for the periodical automatic snapshot policy.
  • The disk must be in the Unattached state.
  • If the specified disk does not exist, the request will be ignored.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String No DeleteDisk

The operation that you want to perform. Set the value to DeleteDisk.

DiskId String Yes d-23jbf2***

The ID of the disk to be released.

Response parameters

Parameter Type Example Description
RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

Examples

Sample requests

https://ecs.aliyuncs.com/?Action=DeleteDisk
&DiskId=d-23jbf2***
&<Common request parameters>

Sample success responses

XML format

<DeleteDiskResponse>
      <RequestId>CEF72CEB-54B6-4AE8-B225-F876FF7BA984</RequestId>
</DeleteDiskResponse>

JSON format

{
    "RequestId": "CEF72CEB-54B6-4AE8-B225-F876FF7BA984"
}

Error codes

HTTP status code Error code Error message Description
403 IncorrectDiskStatus The current disk status does not support this operation. The error message returned because the operation is not supported while the disk is in the current state. Ensure that the disk is available and has no overdue payments.
500 InternalError The request processing has failed due to some unknown error. The error message returned because an internal error has occurred. Try again later. If the problem persists, submit a ticket.
403 DiskNotPortable The specified disk is not a portable disk. The error message returned because the specified disk is not removable.
403 DiskTypeViolation The specified disk is a system disk and cannot support the operation. The error message returned because the specified disk is a system disk and cannot be detached.
403 DiskCreatingSnapshot The operation is denied due to a snapshot of the specified disk is not completed yet. The error message returned because a snapshot of the specified disk is being created.
403 IncorrectDiskStatus.Initializing The current disk status does not support this operation. The error message returned because the operation is not supported while the disk is in the current state. Ensure that the disk is available and has no overdue payments.
404 InvalidDiskId.NotFound The specified disk does not exist. The error message returned because the specified DiskId parameter does not exist. Check whether the disk ID is correct.
403 DiskStillAttached The disk is still attached to the disk. The error message returned because the disk to be released is still attached to an instance.
403 UserNotInTheWhiteList The user is not in disk white list. The error message returned because you are not in the whitelist to manage the disk. Try again when you are in the whitelist.
400 InvalidRegionId.MalFormed The specified parameter RegionId is not valid. The error message returned because the specified RegionId parameter is invalid.

For a list of error codes, visit the API Error Center.