Creates a pay-as-you-go or subscription data disk.

Description

  • You can enable the multi-attach (MultiAttach) feature when you create a disk. We recommend that you understand the multi-attach feature and its limits before you enable the feature. For more information, see NVMe protocol and Use the multi-attach feature.

  • You must complete real-name verification before you can create a disk. Complete real-name verification on the Real-name Verification page in the Alibaba Cloud Management Console.

  • The disk can be a basic disk, an ultra disk, a standard SSD, or an enhanced SSD (ESSD).

  • When you create disks, you may be charged for the resources used. We recommend that you understand the Elastic Compute Service (ECS) billing methods before you create a disk. For more information, see Billing overview.
  • By default, the DeleteAutoSnapshot parameter is set to true when a disk is created. This indicates that when the disk is released, the automatic snapshots of the disk are also deleted. You can call the ModifyDiskAttribute operation to modify the parameter.
  • If you do not configure the performance level when you create an ESSD, the performance level for the ESSD is PL1 by default. You can call the ModifyDiskSpec operation to modify the performance level of the ESSD.
  • By default, for a disk that is created by calling this operation, the Portable attribute is set to true and the billing method is pay-as-you-go.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

ParameterTypeRequiredExampleDescription
ActionStringYesCreateDisk

The operation that you want to perform. Set the value to CreateDisk.

RegionIdStringYescn-hangzhou

The ID of the region in which to create the disk. You can call the DescribeRegions operation to query the most recent region list.

ZoneIdStringNocn-hangzhou-g

The ID of the zone in which to create the pay-as-you-go disk.

  • If the InstanceId parameter is not specified, the ZoneId parameter is required.
  • You cannot specify ZoneId and InstanceId at the same time.
SnapshotIdStringNos-bp67acfmxazb4p****

The ID of the snapshot used to create the disk. Snapshots that were created on or before July 15, 2013 cannot be used to create disks.

The following limits apply to the SnapshotId and Size parameters:

  • If the size of the snapshot specified by the SnapshotId parameter is greater than the specified Size value, the size of the created disk is equal to the specified snapshot size.
  • If the size of the snapshot specified by the SnapshotId parameter is smaller than the specified Size value, the size of the created disk is equal to the specified Size value.
DiskNameStringNotestDiskName

The name of the disk. The name must be 2 to 128 characters in length. It must start with a letter but cannot start with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-).

This parameter is empty by default.

SizeIntegerNo2000

The size of the disk. Unit: GiB. This parameter is required. Valid values:

  • Valid values when DiskCategory is set to cloud: 5 to 2,000
  • Valid values when DiskCategory is set to cloud_efficiency: 20 to 32,768
  • Valid values when DiskCategory is set to cloud_ssd: 20 to 32,768
  • Valid values when DiskCategory is set to cloud_essd: depends on the PerformanceLevel value.
    • Valid values when PerformanceLevel is set to PL0: 40 to 32,768
    • Valid values when PerformanceLevel is set to PL1: 20 to 32,768
    • Valid values when PerformanceLevel is set to PL2: 461 to 32,768
    • Valid values when PerformanceLevel is set to PL3: 1,261 to 32,768

If the SnapshotId parameter is specified, the following limits apply to the SnapshotId and Size parameters:

  • If the size of the snapshot specified by the SnapshotId parameter is greater than the specified Size value, the size of the created disk is equal to the specified snapshot size.
  • If the size of the snapshot specified by the SnapshotId parameter is smaller than the specified Size value, the size of the created disk is equal to the specified Size value.
DiskCategoryStringNocloud_ssd

The category of the disk. Valid values:

  • cloud: basic disk
  • cloud_efficiency: ultra disk
  • cloud_ssd: standard SSD
  • cloud_essd: ESSD

Note ESSD AutoPL is in invitational preview in the China (Ulanqab) and China (Heyuan) regions. To use ESSD AutoPL disks, go to the invitational preview page to submit an application.

Default value: cloud.

DescriptionStringNotestDescription

The description of the disk. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

This parameter is empty by default.

EncryptedBooleanNofalse

Specifies whether to encrypt the disk. Valid values:

  • true: encrypts the disk.
  • false: does not encrypt the disk.

Default value: false.

ClientTokenStringNo123e4567-e89b-12d3-a456-426655440000

The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must make sure that the value is unique among different requests. The ClientToken value can only contain ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.

InstanceIdStringNoi-bp18pnlg1ds9rky4****

The ID of the instance to which the created subscription disk is automatically attached.

  • After you specify the instance ID, the specified ResourceGroupId, Tag.N.Key, Tag.N.Value, ClientToken, and KMSKeyId parameters are ignored.
  • You cannot specify ZoneId and InstanceId at the same time.

This parameter is empty by default. This indicates that a pay-as-you-go disk is created. The RegionId and ZoneId parameters specify where the disk resides.

ResourceGroupIdStringNorg-bp67acfmxazb4p****

The ID of the resource group to which to assign the disk.

KMSKeyIdStringNo0e478b7a-4262-4802-b8cb-00d3fb40826X

The ID of the Key Management Service (KMS) key to use for the disk.

PerformanceLevelStringNoPL1

The performance level of the ESSD. Valid values:

  • PL0: A single ESSD can deliver up to 10,000 random read/write IOPS.
  • PL1: A single ESSD can deliver up to 50,000 random read/write IOPS.
  • PL2: A single ESSD can deliver up to 100,000 random read/write IOPS.
  • PL3: A single ESSD can deliver up to 1,000,000 random read/write IOPS.

Default value: PL1.

For more information about ESSD performance levels, see ESSDs.

AdvancedFeaturesStringNohide

This parameter is unavailable.

StorageSetIdStringNoss-bp67acfmxazb4p****

The ID of the storage set.

Note You can specify only one of the storage set-related parameters (StorageSetId and StorageSetPartitionNumber) and dedicated block storage cluster-related parameter (StorageClusterId). If you specify more than one of the preceding parameters, the call fails.
EncryptAlgorithmStringNohide

This parameter is unavailable.

StorageSetPartitionNumberIntegerNo3

The number of partitions in the storage set. The value must be greater than or equal to 2 but cannot exceed the quota obtained by calling the DescribeAccountAttributes operation.

Default value: 2.

StorageClusterIdStringNodbsc-j5e1sf2vaf5he8m2****

The ID of the dedicated block storage cluster. To create a disk in a specific dedicated block storage cluster, specify this parameter. For more information about dedicated block storage clusters, see What is Dedicated Block Storage Cluster?

Note You can specify only one of the storage set-related parameters (StorageSetId and StorageSetPartitionNumber) and dedicated block storage cluster-related parameter (StorageClusterId). If you specify more than one of the preceding parameters, the call fails.
MultiAttachStringNoDisabled

Specifies whether to enable the multi-attach feature for the disk. Valid values:

  • Disabled: disables the multi-attach feature.
  • Enabled: enables the multi-attach feature. Set the value to Enabled only for ESSDs.

Default value: Disabled.

Note Disks for which the multi-attach feature is enabled support only the pay-as-you-go billing method. When the MultiAttach parameter is set to Enabled, you cannot specify the InstanceId parameter. You can call the AttachDisk operation to attach disks to instances after the disks are created. Disks for which the multi-attach feature is enabled can be attached only as data disks.
Tag.N.keyStringNoTest

The key of tag N to add to the disk.

Note We recommend that you use the Tag.N.Value parameter to ensure furture compatibility.
Tag.N.KeyStringNoTestKey

The key of tag N to add to the disk. Valid values of N: 1 to 20. The tag key cannot be an empty string. It can be up to 128 characters in length and cannot contain http:// or https://. The tag key cannot start with acs: or aliyun.

Tag.N.ValueStringNoTestValue

The value of tag N to add to the disk. Valid values of N: 1 to 20. The tag value can be an empty string. It can be up to 128 characters in length. It cannot start with acs: or contain http:// or https://.

Tag.N.valueStringNoTest

The value of tag N to add to the disk.

Note We recommend that you use the Tag.N.Value parameter to ensure furture compatibility.
Arn.N.RoleTypeStringNohide

This parameter is unavailable.

Arn.N.RolearnStringNohide

This parameter is unavailable.

Arn.N.AssumeRoleForLongNo1000000000

This parameter is unavailable.

ProvisionedIopsLongNo40000

This parameter is unavailable.

BurstingEnabledBooleanNofalse

This parameter is unavailable.

Response parameters

ParameterTypeExampleDescription
DiskIdStringd-bp131n0q38u3a4zi****

The ID of the disk.

RequestIdString473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

The ID of the request.

OrderIdString20413515388****

The ID of the order.

Note This parameter is returned only when you create a subscription disk.

Examples

Sample requests

https://ecs.aliyuncs.com/?Action=CreateDisk
&RegionId=cn-hangzhou
&ZoneId=cn-hangzhou-g
&SnapshotId=s-bp67acfmxazb4p****
&DiskName=testDiskName
&Size=2000
&DiskCategory=cloud_ssd
&Description=testDescription
&Encrypted=false
&ClientToken=123e4567-e89b-12d3-a456-426655440000
&Tag.1.Key=TestKey
&Tag.1.Value=TestValue
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateDiskResponse>
    <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3****</RequestId>
    <DiskId>d-bp131n0q38u3a4zi****</DiskId>
</CreateDiskResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
  "DiskId" : "d-bp131n0q38u3a4zi****"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidSize.ValueNotSupportedThe specified parameter Size is not valid.The error message returned because the specified Size parameter is invalid.
400InvalidDiskName.MalformedThe specified disk name is wrongly formed.The error message returned because the specified DiskName parameter is invalid. The name must be 2 to 128 characters in length, and can contain letters, digits, periods (.), underscores (_), and hyphens (-). The name must start with a letter and cannot start with http:// or https://.
400InvalidDescription.MalformedThe specified description is wrongly formed.The error message returned because the specified Description parameter is invalid. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
400InvalidDiskCategory.NotSupportedThe specified disk category is not support.The error message returned because the specified DiskCategory parameter is invalid.
400Account.ArrearageYour account has an outstanding payment.The error message returned because your account has unpaid orders.
400InvalidDataDiskCategory.ValueNotSupported%sThe error message returned because the specified DiskCategory parameter is invalid. %s is a variable. An error message is dynamically returned based on call conditions.
400InvalidParameter.Conflict%sThe error message returned because a specified parameter is invalid. Check whether parameter conflicts exist. %s is a variable. An error message is dynamically returned based on call conditions.
400RegionUnauthorized%sThe error message returned because you are not authorized to perform the operation in the specified region. %s is a variable. An error message is dynamically returned based on call conditions.
400Zone.NotOnSale%sThe error message returned because the requested resources are unavailable in the specified zone. %s is a variable. An error message is dynamically returned based on call conditions.
400InvalidDataDiskSize.ValueNotSupported%sThe error message returned because the specified Size parameter is invalid. %s is a variable. An error message is dynamically returned based on call conditions.
400OperationDeniedThe specified Zone is not available or not authorized.The error message returned because the specified zone is unavailable or because you are not authorized to access the zone.
400InvalidDiskSize.NotSupportedThe specified parameter size is not valid.The error message returned because the specified Size parameter is invalid.
400InvalidDiskSizeOrCategoryThe specified disk category or size is invalid.The error message returned because the specified DiskCategory or Size parameter is invalid.
400InvalidParameter.EncryptedIllegal%sThe error message returned because the specified parameter is invalid. Check whether your encryption operation is valid. %s is a variable. An error message is dynamically returned based on call conditions.
400InvalidParameter.EncryptedNotSupported%sThe error message returned because disk encryption is not supported by the specified disk category.
400EncryptedOption.Conflict%sThe error message returned because the parameter used to encrypt disks is not supported. %s is a variable. An error message is dynamically returned based on call conditions.
400InvalidParameter.EncryptedIllegalThe specified parameter Encrypted must be true when kmsKeyId is not empty.The error message returned because the encryption feature is not enabled after a KMS key ID is specified.
400Duplicate.TagKeyThe Tag.N.Key contain duplicate key.The error message returned because the specified tag key already exists. Tag keys must be unique.
400InvalidTagKey.MalformedThe specified Tag.n.Key is not valid.The error message returned because the specified Tag.N.Key parameter is invalid.
400InvalidTagValue.MalformedThe specified Tag.n.Value is not valid.The error message returned because the specified Tag.N.Value parameter is invalid.
400InvalidPerformanceLevel.MalformedThe specified parameter PerformanceLevel is not valid.The error message returned because the specified PerformanceLevel parameter is invalid.
400InvalidInstance.NotFoundSystemDiskThe specified instance has no system disk.The error message returned because the specified instance has no system disk attached. Make sure that the specified instance has a system disk attached. You can call the DescribeInstances operation to query the details of the specified instance.
403InvalidDataDiskCategory.NotSupportedSpecified disk category is not supported.The error message returned because the specified DiskCategory parameter is invalid.
403InstanceDiskCategoryLimitExceedThe total size of specified disk category in an instance exceeds.The error message returned because the total size of disks of the specified category exceeds the maximum capacity allowed for an instance.
403InvalidSnapshot.NotReadyThe specified snapshot creation is not completed yet.The error message returned because the specified snapshot is not created.
403InvalidSnapshot.TooOldThis operation is forbidden because the specified snapshot is created before 2013-07-15.The error message returned because the specified snapshot was created on or before July 15, 2013 and cannot be used to create disks.
403InvalidSnapshot.TooLargeThe capacity of snapshot exceeds 2000GB.The error message returned because the size of the specified snapshot exceeds 2,000 GB.
403OperationDeniedThe specified snapshot is not allowed to create disk.The error message returned because the specified snapshot cannot be used to create disks.
403QuotaExceed.PortableCloudDiskThe quota of portable cloud disk exceeds.The error message returned because the maximum number of removable disks has been reached.
403InvalidDiskCategory.ValueUnauthorizedThe disk category is not authorized.The error message returned because you are not authorized to manage the specified disk category.
403InvalidSnapshotId.NotReadyThe specified snapshot has not completed yet.The error message returned because the specified snapshot is being created.
403InvalidSnapshotId.NotDataDiskSnapshotThe specified snapshot is system disk snapshot.The error message returned because the specified snapshot is a system disk snapshot.
403InvalidDiskSize.TooSmallSpecified disk size is less than the size of snapshot.The error message returned because the specified disk size is smaller than the snapshot size.
403OperationDeniedThe type of the disk does not support the operation.The error message returned because the specified disk category does not support this operation.
403InvalidDataDiskCategory.NotSupported%sThe error message returned because the specified DiskCategory parameter is invalid. %s is a variable. An error message is dynamically returned based on call conditions.
403InvalidAccountStatus.NotEnoughBalanceYour account does not have enough balance.The error message returned because your account balance is insufficient. Add funds to your account and try again.
403InvalidAccountStatus.SnapshotServiceUnavailableSnapshot service has not been opened yet.The error message returned because the operation is not supported while the snapshot service is not activated.
403InvalidPayMethodThe specified pay method is not valid.The error message returned because the specified payment method is invalid.
403InvalidDiskCategory.NotSupportedThe specified disk category is not supported.The error message returned because the specified disk category does not support the operation.
403InvalidDiskSize.NotSupportedThe specified disk size is not supported.The error message returned because the specified disk size is not supported.
403UserNotInTheWhiteListThe user is not in disk white list.The error message returned because you are not authorized to manage the disk. Try again when you are authorized.
403QuotaExceed.PostPaidDiskLiving postPaid disks quota exceeded.The error message returned because the maximum number of pay-as-you-go disks has been reached.
403InvalidRegion.NotSupportThe specified region does not support byok.The error message returned because the Bring Your Own Key (BYOK) feature is not supported in the specified region.
403UserNotInTheWhiteListThe user is not in byok white list.The error message returned because you are not authorized to use the BYOK feature. Try again when you are authorized.
403InvalidParameter.KMSKeyId.CMKNotEnabledThe CMK needs to be enabled.The error message returned because the customer master key (CMK) is not enabled when a KMS key ID is specified for the disk. You can call the DescribeKey operation of KMS to query the information about the specified CMK.
403InvalidParameter.KMSKeyId.KMSUnauthorizedECS service have no right to access your KMS.The error message returned because ECS is not authorized to access your KMS resources.
403SecurityRisk.3DVerificationWe have detected a security risk with your default credit or debit card. Please proceed with verification via the link in your email.The error message returned because risks are detected in your default credit card or debit card. Click the URL in the email for verification.
403InvalidStatus.UpgradingThe instance is upgrading; please try again later.The error message returned because the configurations of the specified instance are being upgraded. Try again later.
403QuotaExceed.Tags%sThe error message returned because the number of specified tags exceeds the upper limit. %s is a variable. An error message is dynamically returned based on call conditions.
403OperationDenied.SnapshotNotAllowedThe specified snapshot is not allowed to create disk.The error message returned because the specified snapshot cannot be used to create disks.
403LastTokenProcessingThe last token request is processing.The error message returned because a token request is being processed. Try again later.
403InvalidParameter.MultiAttachThe specified param MultiAttach is not valid.The error message returned because the specified MultiAttach parameter is invalid.
403InvalidParameter.MultiAttachAndInstanceIdConflictThe parameter MultiAttach and InstanceId are conflict.The error message returned because the MultiAttach and InstanceId parameters are both specified.
403InvalidParameter.DiskCategoryAndMultiAttachConflictThe specified disk category does not support multi attach set.The error message returned because the MultiAttach parameter is specified for the Shared Block Storage device.
403InvalidParameter.DiskCategoryAndMultiAttachNotMatchThe specified disk category does not support multi attach enabled.The error message returned because the specified disk category does not support the multi-attach feature.
403OperationDenied.ZoneNotSupportMultiAttachDiskThe specified zone does support multi attach disk.The error message returned because disks for which the multi-attach feature is enabled cannot be created in the specified zone.
403InvalidAccountStatus.CouponAmountNotEnoughYour coupon balance is insufficient or has expired.The error message returned because your coupon balance is insufficient or because your coupons have expired.
404InvalidRegionId.NotFoundThe specified RegionId does not exist.The error message returned because the specified RegionId parameter does not exist.
404InvalidZoneId.NotFoundThe specified zone does not exist.The error message returned because the specified ZoneId parameter does not exist.
404InvalidSnapshotId.NotFoundThe specified SnapshotId does not exist.The error message returned because the specified SnapshotId parameter does not exist.
404InvalidResourceGroup.NotFoundThe ResourceGroup provided does not exist in our records.The error message returned because the specified resource group does not exist.
404InvalidParameter.KMSKeyId.NotFoundThe specified KMSKeyId does not exist.The error message returned because the specified KMS key ID does not exist.
404InvalidInstanceId.NotFoundThe InstanceId provided does not exist in our records.The error message returned because the specified instance does not exist. Check whether the instance ID is correct.
404InvalidInstanceId.NotFoundThe specified InstanceId does not exist.The error message returned because the specified InstanceId parameter does not exist.
500InternalErrorThe request processing has failed due to some unknown error.The error message returned because an internal error has occurred. Try again later.
500InternalErrorThe request processing has failed due to some unknown error, exception or failure.The error message returned because an internal error has occurred. Try again later.

For a list of error codes, see Service error codes.