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
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
DiskId | string | No | 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**** |
DiskName | string | No | 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 | MyDiskName |
Description | string | No | The description of the disk. The description must be 2 to 256 characters in length. It cannot start with | TestDescription |
DeleteWithInstance | boolean | No | 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
| false |
DeleteAutoSnapshot | boolean | No | 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 |
EnableAutoSnapshot | boolean | No | Specifies whether to enable 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 |
RegionId | string | Yes | The region ID of the command. You can call the DescribeRegions operation to query the most recent list of regions. | cn-hangzhou |
DiskIds | array | No | 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.
| |
string | No | 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**** | |
BurstingEnabled | boolean | No | Specifies whether to enable the performance burst feature for data disk N. Valid values:
| false |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidDiskName.Malformed | The 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. |
400 | NoAttributeToModify | No attribute to be modified in this request. | No attributes are modified. |
400 | IncompleteParamter | Some fields can not be null in this request. | Some required parameters are not specified. |
400 | InvalidRegionId.MalFormed | The specified RegionId is not valid | - |
400 | MissingParameter.DiskIdOrDiskIds | Specified parameter DiskId or DiskIds is missing. | - |
400 | ParameterConflict.DiskIdAndDiskIds | Specified parameter DiskId and DiskIds conflict, only one can be chosen. | - |
400 | BurstingEnabledForDiskCategoryUnsupported | The specified disk category does not support bursting enabled. | - |
400 | BurstingEnabledForMultiAttachDiskUnsupported | The multi attach disk does not support bursting enabled. | - |
400 | BurstingEnabledForModifyingDiskUnsupported | The modifying disk does not support bursting enabled. | - |
403 | QuotaExceed.Snapshot | The snapshot quota exceeds. | The maximum number of snapshots has been reached. Delete snapshots that are no longer needed and try again. |
403 | DiskNotPortable | The specified disk is not a portable disk. | The specified disk is not removable. |
403 | IncorrectDiskStatus | The 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. |
403 | UserNotInTheWhiteList | The user is not in disk white list. | You are not authorized to manage the disk. Try again when you are authorized. |
403 | DeleteWithInstance.Conflict | The specified image is from the image market, you cannot set DeleteWithInstance attribute to false. | - |
403 | DeleteWithInstance.Conflict | Multi attach disk cannot be set to DeleteWithInstance attribute. | Disks for which the multi-attach feature is enabled do not support the DeleteWithInstance attribute. |
404 | InvalidDiskId.NotFound | The specified disk does not exist. | The specified disk does not exist. Check whether the disk ID is correct. |
404 | InvalidDescription.Malformed | The 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://. |
404 | InvalidInstanceId.NotFound | Specified 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 time | Summary of changes | Operation | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
2023-08-25 | The Error code has changed | see changesets | ||||||||
|