ModifyDiskAttribute

Last Updated: May 22, 2018

Description

Modifies the attribute of your cloud disk.

In this interface, when the DeleteWithInstance attribute is set to false and the OperationLocks of instance indicates LockReason: security, the DeleteWithInstance attribute of disk is ignored and the disk is released along with the instance.

Request parameters

Name Type Required Description
Action String Yes The name of this interface. Value: ModifyDiskAttribute.
DiskId String Yes ID of the target disk.
DiskName String No The disk name.
  • Can contain [2, 128] English letters.
  • Must begin with an uppercase or lowercase letter.
  • Can contain digits, colons(:), periods (.), underscores (_), and hyphens (-).
  • Cannot begin with http:// or https://.
Description String No The description of a disk. The description:
  • Can contain [2, 256] letters.
  • Cannot begin with http:// or https://.
DeleteWithInstance String No Whether the disk is released along with the instance or not. Optional values:
  • True: If the instance is released, this disk is also released.
  • False: If the instance is released, this disk is retained.
Default value: None.
In the following conditions, an error is returned when you set DeleteWithInstance to false.
  • When the Category attribute of disk is ephemeral.
  • When the Category attribute of disk is cloud and the Portable attribute is false.
DeleteAutoSnapshot String No Whether the automatic snapshots of a cloud disk are deleted or not when the disk is deleted.
  • True: If the disk is released, its automatic snapshots are also released.
  • False: If the disk is released, its automatic snapshots are retained.
Default value: None.
EnableAutoSnapshot String No If you have created an automatic snapshot policy, you can decide whether an automatic snapshot policy is applied to the disk or not. Optional values:
  • True: The disk runs an automatic snapshot policy.
  • False: The disk does not run an automatic snapshot policy.
Default value: None.

Response parameters

All are common return parameters. For more information, see Common parameters.

Examples

Request example

  1. https://ecs.aliyuncs.com/?Action=ModifyDiskAttribute
  2. &DiskId=d-23jbf2v5m
  3. &DiskName=MyDiskName
  4. &<Common Request Parameters>

Response example

XML format

  1. <ModifyDiskAttributeResponse>
  2. <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
  3. </ModifyDiskAttributeResponse>

JSON format

  1. {
  2. "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
  3. }

Error codes

Error code Error message HTTP status code Meaning
InvalidDiskName.Malformed The specified disk name is wrongly formed. 400 The format of the specified DiskName is incorrect.
NoAttributeToModify No attribute to be modified in this request. 400 Duplicate requests.
DiskNotPortable The specified disk is not a portable disk. 403 If the attribute Portable of the specified cloud disk is false, you cannot set the attribute DeleteWithInstance to false.
IncorrectDiskStatus The operation is not supported in this status. 403 The status of the cloud disk is incorrect. For more information, see Basic cloud disk status table.
InvalidDescription.Malformed The specified description is wrongly formed. 404 The format of specified Description is incorrect.
InvalidDiskId.NotFound The specified disk does not exist. 404 The specified DiskId does not exist.
Thank you! We've received your feedback.