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 in a batch.
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 when the associated instance is released. Default value: null, which indicates that the current value remains unchanged. An error is returned if you set
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 setting is ignored and the disk is released together 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 remains unchanged. |
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 remains unchanged. Note
[Deprecated] This parameter is deprecated. The automatic snapshot policy feature 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 the 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 burst. Valid values:
Note
An error is returned if you specify any value for a disk that does not support the 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 malformed. | |
| 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 | The parameters DiskId and DiskIds are mutually exclusive. Please specify only one. | |
| 400 | BurstingEnabledForDiskCategoryUnsupported | The specified disk category does not support bursting enabled. | The specified disk type does not support the performance burst feature. |
| 400 | BurstingEnabledForMultiAttachDiskUnsupported | The multi attach disk does not support bursting enabled. | Multi-attach disks do not support the performance burst feature. |
| 400 | BurstingEnabledForModifyingDiskUnsupported | The modifying disk does not support bursting enabled. | Disks that are undergoing specification changes cannot have their burst feature modified. |
| 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. |
| 400 | InvalidParameter.DeleteWithInstance | The specified disk is an elastic ephemeral disk. Set "DeleteWithInstance" to true and try again. | |
| 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 the 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 malformed. | |
| 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.