All Products
Search
Document Center

Elastic Compute Service:ModifyDiskAttribute

Last Updated:Mar 26, 2024

Modifies the attributes of one or more block storage devices (disks). The attributes include names, descriptions, and whether the attributes are released together with the associated instances.

Operation description

  • When you call this operation to modify the attributes of a disk, if you set the DeleteWithInstance parameter to false and the instance to which the disk is attached is locked for security reasons, the DeleteWithInstance parameter of the disk is ignored and the disk is released together with the instance. If "LockReason" : "security" is included in the response when you query the information about an instance, the instance is locked for security reasons.
  • You can use the DiskIds.N parameter to specify multiple disks. This way, you can modify the attributes of the disks at the same time, including names, descriptions, and whether to release the disks together with the associated instances.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
DiskIdstringNo

The ID of the disk.

Note You can specify the DiskId parameter or the DiskIds.N parameter, but you cannot specify both parameters at the same time.
d-bp1famypsnar20bv****
DiskNamestringNo

The name of the disk. The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-).

MyDiskName
DescriptionstringNo

The description of the disk. The description must be 2 to 256 characters in length. It cannot start with http:// or https://.

TestDescription
DeleteWithInstancebooleanNo

Specifies whether to release the disk along with its associated instance. This parameter is empty by default, which indicates that the current value remains unchanged.

An error is returned if you set DeleteWithInstance to false in one of the following cases:

  • The disk is a local disk.
  • The disk is a basic disk and is not removable. If the Portable attribute of a disk is set to false, the disk is not removable.
false
DeleteAutoSnapshotbooleanNo

Specifies whether to delete the automatic snapshots of the disk when the disk is released. This parameter is empty by default, which indicates that the current value remains unchanged.

false
EnableAutoSnapshotbooleanNo

Specifies whether to enable the automatic snapshot policy feature for the cloud disk.

  • true: enables the automatic snapshot policy feature for the cloud disk.
  • false: disables the automatic snapshot policy feature for the cloud disk.

This parameter is empty by default, which indicates that the current value remains unchanged.

Note By default, the automatic snapshot policy feature is enabled for new disks. You need to only apply an automatic snapshot policy to a disk for the policy to take effect.
true
RegionIdstringYes

The region ID of the command. You can call the DescribeRegions operation to query the most recent list of regions.

cn-hangzhou
DiskIdsarrayNo

The ID of disk N. Valid values of N: 0 to 100.

Note You can specify the DiskId parameter or the DiskIds.N parameter, but you cannot specify both parameters at the same time.
stringNo

The ID of disk N. Valid values of N: 0 to 100.

Note You can specify the DiskId parameter or the DiskIds.N parameter, but you cannot specify both parameters at the same time.
d-bp1famypsnar20bv****
BurstingEnabledbooleanNo

Specifies whether to enable the performance burst feature for data disk N. Valid values:

  • true: encrypts the disk.
  • false: does not encrypt the disk.
false

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

Examples

Sample success responses

JSONformat

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidDiskName.MalformedThe specified disk name is wrongly formed.The disk name is invalid. The name must be 2 to 128 characters in length and start with a letter. It can contain letters, digits, periods (.), underscores (_), and hyphens (-) and cannot start with http:// or https.
400NoAttributeToModifyNo attribute to be modified in this request.No attributes are modified.
400IncompleteParamterSome fields can not be null in this request.Some required parameters are not specified.
400InvalidRegionId.MalFormedThe specified RegionId is not valid-
400MissingParameter.DiskIdOrDiskIdsSpecified parameter DiskId or DiskIds is missing.-
400ParameterConflict.DiskIdAndDiskIdsSpecified parameter DiskId and DiskIds conflict, only one can be chosen.-
400BurstingEnabledForDiskCategoryUnsupportedThe specified disk category does not support bursting enabled.-
400BurstingEnabledForMultiAttachDiskUnsupportedThe multi attach disk does not support bursting enabled.-
400BurstingEnabledForModifyingDiskUnsupportedThe modifying disk does not support bursting enabled.-
403QuotaExceed.SnapshotThe snapshot quota exceeds.The maximum number of snapshots has been reached. Delete snapshots that are no longer needed and try again.
403DiskNotPortableThe specified disk is not a portable disk.The specified disk is not removable.
403IncorrectDiskStatusThe operation is not supported in this status.The disk is in a state that does not support the current operation. Make sure that the disk is available and that your account has no overdue payments.
403UserNotInTheWhiteListThe user is not in disk white list.You are not authorized to manage the disk. Try again when you are authorized.
403DeleteWithInstance.ConflictThe specified image is from the image market, you cannot set DeleteWithInstance attribute to false.-
403DeleteWithInstance.ConflictMulti attach disk cannot be set to DeleteWithInstance attribute.Disks for which the multi-attach feature is enabled do not support the DeleteWithInstance attribute.
404InvalidDiskId.NotFoundThe specified disk does not exist.The specified disk does not exist. Check whether the disk ID is correct.
404InvalidDescription.MalformedThe specified description is wrongly formed.The resource description is invalid. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
404InvalidInstanceId.NotFoundSpecified attached instance does not exist.The specified instance does not exist. Check whether the instance ID is correct.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-08-25The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 400 change
    delete Error Codes: 403
    delete Error Codes: 404