ModifyDiskAttribute

更新时间:
复制 MD 格式

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ecs:ModifyDiskAttribute

update

*Disk

acs:ecs:{#regionId}:{#accountId}:disk/{#diskId}

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 http:// or https://.

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 false in either of the following cases:

  • The category of the disk is local disk (ephemeral).

  • The category of the disk is basic disk (cloud) and the disk is not detachable (Portable=false).

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:

  • true: Enabled.

  • false: Disabled.

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:

  • true: Enabled.

  • false: Disabled.

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:

  • true: Enabled.

  • false: Disabled.

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.