CreateDisk

Last Updated: Dec 11, 2017

Description

You can use this interface to create a portable data disk. The disk category contains general cloud disk, efficiency cloud disk, and cloud SSD disk.

  • If you are creating a disk in a region of mainland China, such as cn-qingdao or cn-hangzhou, the created disks must pass real-name registration. Visit Account Management for authentication.
  • The DeleteAutoSnapshot attribute of the created disk is true, namely, automatic snapshots are deleted by default when you delete the data disk. You can use ModifyDiskAttribute to modify this attribute.
  • The created data disk is Portable by default, and the billing method is Pay-As-You-Go by default.
  • You must specify either the request parameter Size or SnapshotId. The Size specifies the volume capacity of the data disk, and the SnapshotId specifies a snapshot to create the data disk.

Request parameters

Name Type Required Description
Action String Yes The name of this interface. Value: CreateDisk.
Encrypted Boolean No Whether the disk is encrypted or not. Optional values:
  • true: encrypted
  • false: not encrypted
By default, the value of the encryption is false.
RegionId String Yes The region ID of an instance.
ZoneId String Yes ID of the zone.
DiskName String No Indicates the disk name.
  • The disk name can be 2 to 128 characters in length. Begin with an uppercase or lowercase English letter, or Chinese character.
  • Can contain digits, dots (.), underscores (_), and hyphens (-).
  • Cannot begin with http:// or https://.
  • The disk name is displayed in the console.
By default, the value of the disk name is null.
Description String No Indicates the disk description.
  • It can be 2 to 256 characters in length.
  • Cannot begin with http:// or https://.
  • The disk description is displayed in the console.
By default, the value of the disk description is null.
DiskCategory String No Indicates the category of the data disk. Optional values:
  • Cloud: General cloud disk
  • cloud_efficiency: Efficiency cloud disk
  • cloud_ssd: Cloud SSD
By default, the value is cloud.
Size Integer No Indicates the size of the system disk (GB). Optional values:
  • Cloud: [5, 2000]
  • cloud_efficiency: [20, 32768]
  • cloud_ssd: [20, 32768]
The value must be equal to or greater than the size of the specific SnapshotId.
SnapshotId String No Indicates the snapshot ID. Snapshots are used to create the data disk. After this parameter is specified, Size is ignored. The actual size of the created disk is the size of the specified snapshot. Snapshots generated on or before July 15, 2013 cannot be used to create a disk.
ClientToken String No Used to guarantee the idempotence of the request. The value is generated by a client. It must be unique among all requests and can contain a maximum of 64 ASCII characters.
For more information, see How to ensure idempotence.

Response parameters

Name Type Description
DiskId String ID of the disk

Examples

Request example

  1. https://ecs.aliyuncs.com/?Action=CreateDisk
  2. &RegionId=cn-qingdao
  3. &ZoneId=cn-qingdao-b
  4. &Size=200
  5. &DiskName=ThisIsDiskName
  6. &Description=ThisIsDescription&
  7. &<Public Request Parameters>

Response example

XML format

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

JSON format

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

Error codes

Error code Error message HTTP status code Meaning
EncryptedOption.Conflict Encryption value of disk conflicts with that of snapshot. 400 The encryption value of disk and snapshot should be the same.
InvalidDescription.Malformed The specified description is wrongly formed. 400 The specified DescriptionName format is invalid.
InvalidDiskName.Malformed The specified disk name is wrongly formed. 400 The specified DiskName format is invalid.
InvalidParameter The specified parameter Size is not valid. 400 The Size parameter is invalid.
InvalidParameter.Encrypted.KmsNotEnabled The encrypted disk need enable KMS. 400 No KMS service is available in your account, please enable the KMS service by yourself.
InvalidParameter.EncryptedIllegal The value of parameter encrypted is illegal. 400 The specified parameter encrypted is invalid.
InvalidParameter.EncryptedNotSupported Encrypted disk is not support in this region. 400 The specified region does not support encryption.
InvalidParameter.EncryptedNotSupported Corresponding data disk category does not support encryption. 400 The corresponding disk category does not support encryption.
MissingParameter The input parameter RegionId that is mandatory for processing this request is not supplied. 400 The RegionId parameter is not specified.
MissingParameter The input parameter ZoneId that is mandatory for processing this request is not supplied. 400 The ZoneId value is missing. It may also be that this user does not have permission to use this Zone.
MissingParameter The input parameter either SnapshotId or Size should be specified. 400 The SnapshotId or Size parameter is not specified.
InstanceDiskCategoryLimitExceed The total size of specified disk category in an instance exceeds. 403 The specified disk category exceeds the maximum capacity of a single instance.
InvalidDiskCategory.ValueUnauthorized The disk category is not authorized. 403 The specified disk category is unauthorized.
InvalidSnapshot.TooLarge The capacity of snapshot exceeds 2000GB. 403 The specified snapshot capacity exceeds the maximum capacity of the disk category.
InvalidSnapshot.TooOld This operation is forbidden because the specified snapshot is created before 2013-07-15. 403 The specified snapshot was created on or before July 15, 2013, so the disk cannot be created.
InvalidSnapshotId.NotReady The specified snapshot has not completed yet. 403 The specified snapshot is not yet complete.
OperationDenied The specified snapshot is not allowed to create disk. 403 The specified snapshot is not permitted to create a disk.
QuotaExceed.PortableCloudDisk The quota of portable cloud disk exceeds. 403 The portable general cloud disk quota has exceeded.
InvalidRegionId.NotFound The specified region does not exist. 404 The specified RegionId does not exist.
InvalidSnapshotId.NotFound The specified SnapshotId does not exist. 404 The specified SnapshotId does not exist.
InvalidSnapshotId.NotFound The specified SnapshotId does not exist. 404 Cannot find the specified snapshot.
InvalidZoneId.NotFound The specified zone does not exist. 404 The specified ZoneId does not exist.
Thank you! We've received your feedback.