Creates a portable data disk. The disk category contains basic cloud disk, efficiency cloud disk, and cloud SSD disk.

Description

  • Creating a disk involves resource billing. Know the billing methods of ECS in advance. For more information, see Pay-As-You-Go (PostPaid).

  • The DeleteAutoSnapshot attribute of the created disk is true, and automatic snapshots are deleted by default when you delete the data disk. You can use ModifyDiskAttribute to modify this attribute.

  • By default, the Portable attribute of the created data disk is true, and the billing method is Pay-As-You-Go.

  • 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.
RegionId String Yes The ID of the region to which an instance belongs. For more information, call DescribeRegions to obtain the latest region list.
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. It must begin with an uppercase or lowercase English letter, or Chinese character. It can contain digits, periods (.), colons (:), underscores (_), and hyphens (-).
  • The disk name is displayed in the console.
  • It cannot begin with http:// or https://.
  • 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.
  • The disk description is displayed in the console.
  • It cannot begin with http:// or https://.
  • By default, the value of the disk description is null.
Encrypted Boolean No Whether the disk is encrypted or not. Optional values:
  • true
  • false
By default, the value of the encryption is false.
DiskCategory String No Indicates the category of the data disk. Optional values:
  • cloud: Basic 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 (GiB). The value must be equal to or greater than the size of the specific SnapshotId. Optional values:
  • cloud: [5, 2000].
  • cloud_efficiency: [20, 32768].
  • cloud_ssd: [20, 32768].
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.
Tag.n.Key String Yes The key of a tag of which n is from 1 to 20. Once you use this parameter, it cannot be a null string. It can be up to 64 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://".
Tag.n.Value String Yes The value of a tag of which n is a number from 1 to 20. Once you use this parameter, it can be a null string. It can be up to 128 characters in length. It cannot begin with "aliyun", "acs:", "http://", or "https://".
ClientToken String No

Guarantees the idempotence of the request.  The value is generated by a client and must be globally unique. Only ASCII characters are allowed. It 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
https://ecs.aliyuncs.com/?Action=CreateDisk
&RegionId=cn-qingdao
&ZoneId=cn-qingdao-b
&Size=200
&DiskName=ThisIsDiskName
&Description=ThisIsDescription
&<Common Request Parameters>
Response example

XML format

<CreateDiskResponse>
    <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
    <DiskId>d-bp131n0q38u3a4ziXXXXX</DiskId>
</CreateDiskResponse>
JSON format

    "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
    "DiskId": "d-bp131n0q38u3a4ziXXXXX"

Error codes

Error codes specific to this interface are as follows. For more information, see API Error Center.

Error code Error message HTTP status code Meaning
Account.Arrearage Your account has an outstanding payment. 400 Your account balance is insufficient. Update your account status and try again.
InvalidDescription.Malformed The specified description is wrongly formed. 400 The specified DescriptionName format is invalid.
InvalidDiskCategory.NotSupported The specified disk category is not support. 400 The specified disk category is not supported.
InvalidDiskCategory.ValueNotSupported The specified parameter DiskCategory is not valid. 400 The specified DiskCategory is invalid.
InvalidDiskName.Malformed The specified disk name is wrongly formed. 400 The specified DiskName format is invalid.
EncryptedOption.Conflict Encryption value of disk conflicts with that of snapshot. 400 The encryption value of disk and snapshot must be the same.
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.
InvalidSize.ValueNotSupported The specified parameter Size is not valid. 400 The specified Size is not invalid.
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.
InvalidAccountStatus.NotEnoughBalance Your account does not have enough balance. 403 The account balance is insufficient.
InvalidAccountStatus.SnapshotServiceUnavailable Snapshot service has not been opened yet. 403 The Snapshot service is not activated.
InvalidDataDiskCategory.NotSupported Specified disk category is not supported. 403 The specified disk category is not supported.
InvalidDataDiskCategory.NotSupported diskCategory is CLOUD_SSD, but the supported DiskCategory is [io1, io4, io3]. 403 The specified disk category is not supported.
InvalidDiskCategory.ValueUnauthorized The disk category is not authorized. 403 The specified disk category is unauthorized.
InvalidDiskSize.NotSupported disk size is not supported. 403 The specified disk size is not supported.
InvalidDiskSize.TooSmall Specified disk size is less than the size of snapshot. 403 The size of the specified disk is smaller than the specified snapshot.
InvalidSnapshot.NotReady The specified snapshot creation is not completed yet. 403 The specified snapshot is not yet complete.
InvalidSnapshot.TooLarge The capacity of snapshot emissions 2000 GB. 403 The size of the specified snapshot exceeds the maximum value of the disk type.
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.
OperationDenied The type of the disk does not support the operation. 403 The specified disk type does not support this operation.
QuotaExceed.PortableCloudDisk The quota of portable cloud disk exceeds. 403 The portable general cloud disk quota has exceeded.
InvalidRegionId.NotFound The specified RegionId does not exist. 404 The specified RegionId does not exist.
InvalidRegionId.NotFound The specified RegionId 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.
InvalidZoneId.NotFound The specified zone does not exist. 404 The specified ZoneId does not exist.