Modifies the attributes of one or more block storage devices, including their names, descriptions, and whether to release the devices along with their associated instances.
Description
- When you call this operation to modify the attributes of a disk, if you set DeleteWithInstance
to false and the instance to which the disk is attached is locked for security reasons,
the DeleteWithInstance settings of the disk are ignored and the disk will be released
along with the instance. If
"LockReason" : "security"
is displayed in the response when you query the information of an instance, the instance is locked for security reasons. - You can use the
DiskIds.N
parameter to specify multiple block storage devices so that you can modify the attributes of these devices at a time, including their names, descriptions, and whether to release the devices along with their associated instances.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | ModifyDiskAttribute |
The operation that you want to perform. Set the value to ModifyDiskAttribute. |
DiskId | String | No | d-bp1famypsnar20bv**** |
The ID of the disk. Note
DiskId or DiskIds.N are mutually exclusive. Specify one of them based on your needs.
|
DiskName | String | No | MyDiskName |
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 |
Description | String | No | TestDescription |
The description of the disk. The description must be 2 to 256 characters in length
and cannot start with |
DeleteWithInstance | Boolean | No | false |
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
|
DeleteAutoSnapshot | Boolean | No | false |
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. |
EnableAutoSnapshot | Boolean | No | true |
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 cloud disks. You
only need to associate an automatic snapshot policy with a cloud disk before you can
use the policy.
|
RegionId | String | Yes | cn-hangzhou |
The region ID of the disk. You can call the DescribeRegions operation to query the most recent region list. |
DiskIds.N | String | No | d-bp1famypsnar20bv**** |
The ID of disk N. Valid values of N: 0 to 100. Note
DiskId or DiskIds.N are mutually exclusive. Specify one of them based on your needs.
|
BurstingEnabled | Boolean | No | false |
Specifies whether to enable the performance burst feature. Valid values:
|
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=ModifyDiskAttribute
&RegionId=cn-hangzhou
&DiskId=d-bp1famypsnar20bv****
&DiskName=MyDiskName
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<ModifyDiskAttributeResponse>
<RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
</ModifyDiskAttributeResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"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 error message returned because the specified DiskName parameter is invalid. The name must be 2 to 128 characters in length and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter and cannot start with http:// or https://. |
400 | NoAttributeToModify | No attribute to be modified in this request. | The error message returned because no attributes of the specified block storage device are modified. |
400 | IncompleteParamter | Some fields can not be null in this request. | The error message returned because a required parameter is not specified. |
400 | InvalidRegionId.MalFormed | The specified RegionId is not valid | The error message returned because the specified RegionId parameter is invalid. |
403 | QuotaExceed.Snapshot | The snapshot quota exceeds. | The error message returned because the maximum number of snapshots has been reached. To store new snapshots, delete snapshots that you no longer need. |
403 | DiskNotPortable | The specified disk is not a portable disk. | The error message returned because the specified disk is not removable. |
403 | IncorrectDiskStatus | The operation is not supported in this status. | The error message returned because the operation is not supported while the disk is in the current state. Make sure that the disk is usable and that you have no overdue payments for it. |
403 | UserNotInTheWhiteList | The user is not in disk white list. | The error message returned because you are not authorized to manage the disk. Try again when you are authorized. |
403 | DeleteWithInstance.Conflict | Multi attach disk cannot be set to DeleteWithInstance attribute. | The error message returned because cloud 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 error message returned because the specified disk does not exist. Check whether the disk ID is correct. |
404 | InvalidDescription.Malformed | The specified description is wrongly formed. | The error message returned because the specified Description parameter 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 error message returned because the specified instance does not exist. Check whether the instance ID is correct. |
For a list of error codes, visit the API Error Center.