Modifies the name, description, release behavior, automatic snapshot deletion policy, automatic snapshot policy, performance burst settings, and other attributes of one or more block storage devices.
Operation description
You can call the DiskId parameter to modify the name, description, release behavior, and other attributes of a single block storage device, or call the DiskIds.N parameter to modify the attributes of multiple block storage devices at a time.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:ModifyDiskAttribute |
update |
*Disk
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| DiskId |
string |
No |
The ID of the disk whose attributes you want to modify. Note
The DiskId and DiskIds.N parameters cannot be specified at the same time. Specify one of them as needed. |
d-bp1famypsnar20bv**** |
| DiskName |
string |
No |
The name of the disk. The name must be 2 to 128 characters in length and can contain letters, digits, and characters categorized as letter in Unicode, including Chinese characters. The name can contain colons (:), underscores (_), periods (.), and hyphens (-). |
MyDiskName |
| Description |
string |
No |
The description of the disk. The description must be 2 to 256 characters in length and cannot start with |
TestDescription |
| DeleteWithInstance |
boolean |
No |
Specifies whether to release the disk along with the instance. Default value: null, which indicates that the current value is not changed. This parameter is not supported for disks that have the multi-attach feature enabled. An error is returned if you set DeleteWithInstance to
Warning If you set DeleteWithInstance to false and the ECS instance to which the disk is attached is security-locked with "LockReason" : "security" in OperationLocks, the DeleteWithInstance attribute is ignored and the disk is released along with the instance. |
false |
| DeleteAutoSnapshot |
boolean |
No |
Specifies whether to delete the automatic snapshots of the disk when the disk is deleted. Valid values:
Default value: null, which indicates that the current value is not changed. |
false |
| EnableAutoSnapshot |
boolean |
No |
Specifies whether to enable the automatic snapshot policy for the disk. Valid values:
Default value: null, which indicates that the current value is not changed. Note
This parameter is deprecated. The automatic snapshot policy is enabled by default for disks after they are created. You only need to associate an automatic snapshot policy with the disk. |
true |
| RegionId |
string |
No |
The region ID. You can call DescribeRegions to query the most recent region list. |
cn-hangzhou |
| DiskIds |
array |
No |
The IDs of the disks whose attributes you want to modify. Valid values of N: 0 to 100. Note
The DiskId and DiskIds.N parameters cannot be specified at the same time. Specify one of them as needed. |
d-bp1famypsnar20bv**** |
|
string |
No |
The ID of a disk whose attributes you want to modify. Valid values of N: 0 to 100. Note
The DiskId and DiskIds.N parameters cannot be specified at the same time. Specify one of them as needed. |
d-bp1famypsnar20bv**** |
|
| BurstingEnabled |
boolean |
No |
Specifies whether to enable the performance burst feature for disks that support this feature. Valid values:
Note
An error is returned if you specify this parameter for a disk that does not support the performance burst feature. |
false |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
Examples
Success response
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. | |
| 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. | |
| 400 | InvalidBurstingEnabled.DiskSizeTooSmall | The disk size must be greater than 3 GiB to enable burst. | The disk size must be greater than 3 GiB to enable burst. |
| 403 | QuotaExceed.Snapshot | The snapshot quota exceeds. | |
| 403 | DiskNotPortable | The specified disk is not a portable disk. | |
| 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. | |
| 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. | |
| 404 | InvalidInstanceId.NotFound | Specified attached instance does not exist. | The specified instance does not exist. Check whether the instance ID is correct. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.