Modify disk properties

Last Updated: Jul 25, 2017

Description

In this interface, when the DeleteWithInstance property is set and the OperationLocks of instance indicates LockReason: security, the DeleteWithInstance property of disk will be ignored and the disk will be released along with the instance.

Request Parameters

Name Type Required Description
Action String Yes Operation interface name, required parameter, with a value: ModifyDiskAttribute.
DiskId String Yes ID of the disk.
DiskName String No The disk name. The existing name remains the same when there is no new value specified. The default value is blank. [2, 128] English or Chinese characters, must begin with an uppercase/lowercase letter or Chinese character. Can contain numbers, “.”, “_“ and “-“. The disk name will appear on the console.It cannot begin with http:// or https://.
Description String No The disk description. The existing name remains the same when there is no new value specified. The default value is blank. [2, 256] characters. The disk description will appear on the console. It cannot begin with http:// or https://.
DeleteWithInstance String No Whether or not the disk is released along with the instance:
  • True indicates that when the instance is released, this disk will be released with it.
  • False indicates that when the instance is released, this disk will be retained.
In the following conditions, an error is reported when this parameter is set to false:
  • When the category property of disk is ephemeral.
  • When the category property of disk is cloud and the Portable property is false.
Default value: None, indicates not modifying the current value.
DeleteAutoSnapshot String No Whether or not automatic snapshots are deleted when the disk is deleted.
  • True indicates the automatic snapshots are deleted with the disk.
  • False indicates the automatic snapshots are retained.
Default value: None, indicates not modifying the current value.
EnableAutoSnapshot String No Whether or not the disk executes an automatic snapshot policy (as a precondition the user’s overall automatic snapshot policy must be enabled):
  • True indicates the disk executes an automatic snapshot policy.
  • False indicates the disk does not execute an automatic snapshot policy.
Default value: None, indicates not modifying the current value.

Return Parameters

All are public return parameters. For details, see Public Return Parameters.

Error Code

Error Code Description Http status code Meaning
MissingParameter The input parameter DiskId that is mandatory for processing this request is not supplied. 400 DiskId not specified.
InvalidDiskId.NotFound The specified disk does not exist. 404 The specified disk does not exist.
InvalidDiskName.Malformed The specified disk name is wrongly formed. 400 The DiskName format is incorrect.
InvalidDescription.Malformed The specified description is wrongly formed. 404 The Description format is incorrect.
InvalidParameter The specified parameter DeleteWithInstance is not valid. 400 The specified DeleteWithInstance parameter is invalid.
NoAttributeToModify No attribute to be modified in this request. 400 No properties have been modified.
DiskNotPortable The specified disk is not a portable disk. 403 The disk cannot be detached.

Examples

Request Example

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

Return 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. }
Thank you! We've received your feedback.