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 totrue
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 totrue
and the billing method is pay-as-you-go.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CreateDisk | The operation that you want to perform. Set the value to CreateDisk. |
RegionId | String | Yes | cn-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. |
ZoneId | String | No | cn-hangzhou-g | The ID of the zone in which to create the pay-as-you-go disk.
|
SnapshotId | String | No | s-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
|
DiskName | String | No | testDiskName | 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 This parameter is empty by default. |
Size | Integer | No | 2000 | The size of the disk. Unit: GiB. This parameter is required. Valid values:
If the
|
DiskCategory | String | No | cloud_ssd | The category of the disk. Valid values:
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. |
Description | String | No | testDescription | The description of the disk. The description must be 2 to 256 characters in length and cannot start with This parameter is empty by default. |
Encrypted | Boolean | No | false | Specifies whether to encrypt the disk. Valid values:
Default value: false. |
ClientToken | String | No | 123e4567-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. |
InstanceId | String | No | i-bp18pnlg1ds9rky4**** | The ID of the instance to which the created subscription disk is automatically attached.
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. |
ResourceGroupId | String | No | rg-bp67acfmxazb4p**** | The ID of the resource group to which to assign the disk. |
KMSKeyId | String | No | 0e478b7a-4262-4802-b8cb-00d3fb40826X | The ID of the Key Management Service (KMS) key to use for the disk. |
PerformanceLevel | String | No | PL1 | The performance level of the ESSD. Valid values:
Default value: PL1. For more information about ESSD performance levels, see ESSDs. |
AdvancedFeatures | String | No | hide | This parameter is unavailable. |
StorageSetId | String | No | ss-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. |
EncryptAlgorithm | String | No | hide | This parameter is unavailable. |
StorageSetPartitionNumber | Integer | No | 3 | 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. |
StorageClusterId | String | No | dbsc-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. |
MultiAttach | String | No | Disabled | Specifies whether to enable the multi-attach feature for the disk. Valid values:
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.key | String | No | Test | 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.Key | String | No | TestKey | 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 |
Tag.N.Value | String | No | TestValue | 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 |
Tag.N.value | String | No | Test | 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.RoleType | String | No | hide | This parameter is unavailable. |
Arn.N.Rolearn | String | No | hide | This parameter is unavailable. |
Arn.N.AssumeRoleFor | Long | No | 1000000000 | This parameter is unavailable. |
ProvisionedIops | Long | No | 40000 | This parameter is unavailable. |
BurstingEnabled | Boolean | No | false | This parameter is unavailable. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
DiskId | String | d-bp131n0q38u3a4zi**** | The ID of the disk. |
RequestId | String | 473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** | The ID of the request. |
OrderId | String | 20413515388**** | 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 code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidSize.ValueNotSupported | The specified parameter Size is not valid. | The error message returned because the specified Size parameter is invalid. |
400 | InvalidDiskName.Malformed | The 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://. |
400 | InvalidDescription.Malformed | The 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://. |
400 | InvalidDiskCategory.NotSupported | The specified disk category is not support. | The error message returned because the specified DiskCategory parameter is invalid. |
400 | Account.Arrearage | Your account has an outstanding payment. | The error message returned because your account has unpaid orders. |
400 | InvalidDataDiskCategory.ValueNotSupported | %s | The error message returned because the specified DiskCategory parameter is invalid. %s is a variable. An error message is dynamically returned based on call conditions. |
400 | InvalidParameter.Conflict | %s | The 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. |
400 | RegionUnauthorized | %s | The 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. |
400 | Zone.NotOnSale | %s | The 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. |
400 | InvalidDataDiskSize.ValueNotSupported | %s | The error message returned because the specified Size parameter is invalid. %s is a variable. An error message is dynamically returned based on call conditions. |
400 | OperationDenied | The 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. |
400 | InvalidDiskSize.NotSupported | The specified parameter size is not valid. | The error message returned because the specified Size parameter is invalid. |
400 | InvalidDiskSizeOrCategory | The specified disk category or size is invalid. | The error message returned because the specified DiskCategory or Size parameter is invalid. |
400 | InvalidParameter.EncryptedIllegal | %s | The 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. |
400 | InvalidParameter.EncryptedNotSupported | %s | The error message returned because disk encryption is not supported by the specified disk category. |
400 | EncryptedOption.Conflict | %s | The 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. |
400 | InvalidParameter.EncryptedIllegal | The 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. |
400 | Duplicate.TagKey | The Tag.N.Key contain duplicate key. | The error message returned because the specified tag key already exists. Tag keys must be unique. |
400 | InvalidTagKey.Malformed | The specified Tag.n.Key is not valid. | The error message returned because the specified Tag.N.Key parameter is invalid. |
400 | InvalidTagValue.Malformed | The specified Tag.n.Value is not valid. | The error message returned because the specified Tag.N.Value parameter is invalid. |
400 | InvalidPerformanceLevel.Malformed | The specified parameter PerformanceLevel is not valid. | The error message returned because the specified PerformanceLevel parameter is invalid. |
400 | InvalidInstance.NotFoundSystemDisk | The 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. |
403 | InvalidDataDiskCategory.NotSupported | Specified disk category is not supported. | The error message returned because the specified DiskCategory parameter is invalid. |
403 | InstanceDiskCategoryLimitExceed | The 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. |
403 | InvalidSnapshot.NotReady | The specified snapshot creation is not completed yet. | The error message returned because the specified snapshot is not created. |
403 | InvalidSnapshot.TooOld | This 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. |
403 | InvalidSnapshot.TooLarge | The capacity of snapshot exceeds 2000GB. | The error message returned because the size of the specified snapshot exceeds 2,000 GB. |
403 | OperationDenied | The specified snapshot is not allowed to create disk. | The error message returned because the specified snapshot cannot be used to create disks. |
403 | QuotaExceed.PortableCloudDisk | The quota of portable cloud disk exceeds. | The error message returned because the maximum number of removable disks has been reached. |
403 | InvalidDiskCategory.ValueUnauthorized | The disk category is not authorized. | The error message returned because you are not authorized to manage the specified disk category. |
403 | InvalidSnapshotId.NotReady | The specified snapshot has not completed yet. | The error message returned because the specified snapshot is being created. |
403 | InvalidSnapshotId.NotDataDiskSnapshot | The specified snapshot is system disk snapshot. | The error message returned because the specified snapshot is a system disk snapshot. |
403 | InvalidDiskSize.TooSmall | Specified disk size is less than the size of snapshot. | The error message returned because the specified disk size is smaller than the snapshot size. |
403 | OperationDenied | The type of the disk does not support the operation. | The error message returned because the specified disk category does not support this operation. |
403 | InvalidDataDiskCategory.NotSupported | %s | The error message returned because the specified DiskCategory parameter is invalid. %s is a variable. An error message is dynamically returned based on call conditions. |
403 | InvalidAccountStatus.NotEnoughBalance | Your account does not have enough balance. | The error message returned because your account balance is insufficient. Add funds to your account and try again. |
403 | InvalidAccountStatus.SnapshotServiceUnavailable | Snapshot service has not been opened yet. | The error message returned because the operation is not supported while the snapshot service is not activated. |
403 | InvalidPayMethod | The specified pay method is not valid. | The error message returned because the specified payment method is invalid. |
403 | InvalidDiskCategory.NotSupported | The specified disk category is not supported. | The error message returned because the specified disk category does not support the operation. |
403 | InvalidDiskSize.NotSupported | The specified disk size is not supported. | The error message returned because the specified disk size is not supported. |
403 | UserNotInTheWhiteList | The 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. |
403 | QuotaExceed.PostPaidDisk | Living postPaid disks quota exceeded. | The error message returned because the maximum number of pay-as-you-go disks has been reached. |
403 | InvalidRegion.NotSupport | The 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. |
403 | UserNotInTheWhiteList | The 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. |
403 | InvalidParameter.KMSKeyId.CMKNotEnabled | The 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. |
403 | InvalidParameter.KMSKeyId.KMSUnauthorized | ECS service have no right to access your KMS. | The error message returned because ECS is not authorized to access your KMS resources. |
403 | SecurityRisk.3DVerification | We 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. |
403 | InvalidStatus.Upgrading | The instance is upgrading; please try again later. | The error message returned because the configurations of the specified instance are being upgraded. Try again later. |
403 | QuotaExceed.Tags | %s | The 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. |
403 | OperationDenied.SnapshotNotAllowed | The specified snapshot is not allowed to create disk. | The error message returned because the specified snapshot cannot be used to create disks. |
403 | LastTokenProcessing | The last token request is processing. | The error message returned because a token request is being processed. Try again later. |
403 | InvalidParameter.MultiAttach | The specified param MultiAttach is not valid. | The error message returned because the specified MultiAttach parameter is invalid. |
403 | InvalidParameter.MultiAttachAndInstanceIdConflict | The parameter MultiAttach and InstanceId are conflict. | The error message returned because the MultiAttach and InstanceId parameters are both specified. |
403 | InvalidParameter.DiskCategoryAndMultiAttachConflict | The 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. |
403 | InvalidParameter.DiskCategoryAndMultiAttachNotMatch | The 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. |
403 | OperationDenied.ZoneNotSupportMultiAttachDisk | The 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. |
403 | InvalidAccountStatus.CouponAmountNotEnough | Your coupon balance is insufficient or has expired. | The error message returned because your coupon balance is insufficient or because your coupons have expired. |
404 | InvalidRegionId.NotFound | The specified RegionId does not exist. | The error message returned because the specified RegionId parameter does not exist. |
404 | InvalidZoneId.NotFound | The specified zone does not exist. | The error message returned because the specified ZoneId parameter does not exist. |
404 | InvalidSnapshotId.NotFound | The specified SnapshotId does not exist. | The error message returned because the specified SnapshotId parameter does not exist. |
404 | InvalidResourceGroup.NotFound | The ResourceGroup provided does not exist in our records. | The error message returned because the specified resource group does not exist. |
404 | InvalidParameter.KMSKeyId.NotFound | The specified KMSKeyId does not exist. | The error message returned because the specified KMS key ID does not exist. |
404 | InvalidInstanceId.NotFound | The 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. |
404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. | The error message returned because the specified InstanceId parameter does not exist. |
500 | InternalError | The request processing has failed due to some unknown error. | The error message returned because an internal error has occurred. Try again later. |
500 | InternalError | The 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.