Create a disk

Last Updated: Jun 13, 2017

Description

Created disks must pass real-name authentication. If your real name has not been authenticated, visit Account Management for authentication.

This interface is used to create independent general cloud disks. System disk snapshots cannot be used to create data disks. During disk creation, auto snapshots are deleted by default during disk deletion (that is, DeleteAutoSnapshot=true). This parameter can be modified through Modify Disk Attributes. The billing method is by amount.

In the request parameters, either the Size or SnapshotId must be selected to specify the disk size or snapshot that can be used to create the disk.

Request parameters

Name Type Required Description
Action String Yes Operation interface name, value: CreateDisk.
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 and:
  • Must begin with an uppercase or lowercase English letter, or Chinese character.
  • Can contain digits, “.”, “_” and “-“
  • Cannot begin with http:// or https://
The disk name is displayed on the console. By default, the value of the disk name is blank.
Description String No Indicates the disk description. It can be 2 to 256 charactersin length and cannot begin with http:// or https://. The disk description is displayed on the console. By defualt, the value of the disk description is blank.
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 Yes Indicates the size of the system disk (GB). Optional values:
  • Cloud: 5 - 2000
  • cloud_efficiency: 20 - 2048
  • cloud_ssd: 20 - 2048
The value should 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 ensure 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 details, refer to How to Ensure Idempotence.

Return parameters

Name Type Description
DiskId String ID of the disk.

Error Code

Error Code Description Http status code Meaning
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.
InvalidRegionId.NotFound The specified region does not exist. 404 The specified RegionId does not exist.
InvalidZoneId.NotFound The specified zone does not exist. 404 The specified ZoneId does not exist.
InvalidSnapshotId.NotFound The specified snapshot does not exist. 404 The specified SnapshotId does not exist.
InvalidDiskName.Malformed The specified disk name is wrongly formed. 400 The specified DiskName format is invalid.
InvalidDescription.Malformed The specified description is wrongly formed. 400 The specified DescriptionName format is invalid.
InvalidParameter The specified parameter Size is not valid. 400 The Size parameter is invalid.
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.
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.
InvalidSnapshot.TooLarge The capacity of snapshot exceeds 2000GB. 403 The specified snapshot capacity exceeds the maximum capacity of the disk category.
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.
MissingParameter The input parameter either SnapshotId or Size should be specified. 400 The SnapshotId or Size parameter is not specified.
InvalidDiskCategory.ValueUnauthorized The disk category is not authorized. 403 The specified disk category is unauthorized.
InvalidSnapshotId.NotReady The specified snapshot has not completed yet. 403 The specified snapshot is not yet complete.
InvalidSnapshotId.NotDataDiskSnapshot The specified snapshot is system disk snapshot. 403 The specified snapshot is not a data disk snapshot and cannot be used to create a data disk.
InvalidSnapshotId.NotFound The specified snapshot does not exist. 404 Cannot find the specified snapshot.

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>

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