All Products
Search
Document Center

:CreateDisk

最終更新日:Jan 03, 2024

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

Usage notes

  • You can enable the multi-attach (MultiAttach) feature when you create a disk. We recommend that you understand the multi-attach feature and the limits before you enable the feature. For more information, see NVMe disks and Enable multi-attach.
  • You can create the following categories of disks: basic disks, ultra disks, standard SSDs, enhanced SSDs (ESSDs), and ESSD AutoPL disks.
  • 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.
  • When you create disks, you may be charged for the resources used. We recommend that you familiarize yourself with the Elastic Compute Service (ECS) billing methods before you proceed. 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 the CreateDisk 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

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 data 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.

  • If InstanceId is not specified, ZoneId is required.
  • You cannot specify ZoneId and InstanceId at the same time.
SnapshotId String No s-bp67acfmxazb4p****

The ID of the snapshot to use 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 larger than the value of the Size parameter, 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 value of the Size parameter, the size of the created disk is equal to the value of Size.
DiskName String No testDiskName

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

This parameter is empty by default.

Size Integer No 2000

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

  • Valid values when DiskCategory is set to cloud: 5 to 2000.
  • Valid values when DiskCategory is set to cloud_efficiency: 20 to 32768.
  • Valid values when DiskCategory is set to cloud_ssd: 20 to 32768.
  • Valid values when DiskCategory is set to cloud_essd: depend on the PerformanceLevel value.
    • Valid values when PerformanceLevel is set to PL0: 40 to 32768.
    • Valid values when PerformanceLevel is set to PL1: 20 to 32768.
    • Valid values when PerformanceLevel is set to PL2: 461 to 32768.
    • Valid values when PerformanceLevel is set to PL3: 1261 to 32768.
  • Valid values when DiskCategory is set to cloud_auto: 40 to 32768.
  • Valid values when DiskCategory is set to cloud_essd_entry: 10 to 32768.

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 larger than the value of the Size parameter, 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 value of the Size parameter, the size of the created disk is equal to the value of the Size parameter.
DiskCategory String No cloud_ssd

The category of the data disk. Valid values:

  • cloud: basic disk
  • cloud_efficiency: ultra disk
  • cloud_ssd: standard SSD
  • cloud_essd: ESSD
  • cloud_auto: ESSD AutoPL disk
  • cloud_essd_entry: ESSD Entry disk

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 http:// or https://.

This parameter is empty by default.

Encrypted Boolean No false

Specifies whether to encrypt the disk. Valid values:

  • true
  • false

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 token, but you must make sure that the token is unique among different requests. The token can contain only 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 to attach the created subscription disk.

  • After you specify this parameter, ResourceGroupId, Tag.N.Key, Tag.N.Value, ClientToken, and KMSKeyId 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, and 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:

  • PL0: A single ESSD can deliver up to 10000 random read/write IOPS.
  • PL1: A single ESSD can deliver up to 50000 random read/write IOPS.
  • PL2: A single ESSD can deliver up to 100000 random read/write IOPS.
  • PL3: A single ESSD can deliver up to 1000000 random read/write IOPS.

Default value: PL1.

For information about ESSD performance levels, see ESSDs.

AdvancedFeatures String No hide

This parameter is not publicly available.

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 not publicly available.

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, you must specify this parameter.

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:

  • Disabled
  • Enabled 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.key String No Test

The key of tag N to add to the disk.

Note We recommend that you use the Tag.N.Key parameter to ensure future 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. The tag key 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.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. The tag value can be up to 128 characters in length and cannot contain http:// or https://. The tag value cannot start with acs.

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 future compatibility.
Arn.N.RoleType String No hide

This parameter is not publicly available.

Arn.N.Rolearn String No hide

This parameter is not publicly available.

Arn.N.AssumeRoleFor Long No 1000000000

This parameter is not publicly available.

ProvisionedIops Long No 40000

The provisioned read/write IOPS of the ESSD AutoPL disk. Valid values: 0 to min{50,000, 1,000 × Capacity - Baseline IOPS}

Baseline IOPS = min{1,800 + 50 × Capacity, 50,000}

Note This parameter is available only if DataDisk.N.Category is set to cloud_auto. For more information, see ESSD AutoPL disks.
BurstingEnabled Boolean No false

Specifies whether to enable the performance burst feature. Valid values:

  • true
  • false
Note This parameter is available only if DiskCategory is set to cloud_auto. For more information, see ESSD AutoPL disks.

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. Invalid Size value.
400 InvalidDiskName.Malformed The specified disk name is wrongly formed. Invalid DiskName format. 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. Invalid Description format. 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. Invalid DiskCategory value.
400 Account.Arrearage Your account has an outstanding payment. Your account has unpaid orders.
400 InvalidDataDiskCategory.ValueNotSupported %s Invalid DataDiskCategory value. %s is a variable. An error message is dynamically returned based on call conditions.
400 InvalidParameter.Conflict %s 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 You are not authorized to perform the operation in the region. %s is a variable. An error message is dynamically returned based on call conditions.
400 Zone.NotOnSale %s 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 Invalid Size value. %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 specified zone is unavailable or you are not authorized to access the specified zone.
400 InvalidDiskSize.NotSupported The specified parameter size is not valid. Invalid Size value.
400 InvalidDiskSizeOrCategory The specified disk category or size is invalid. Invalid DiskCategory or Size value.
400 InvalidParameter.EncryptedIllegal %s Invalid parameter value. Check whether your encryption operation is supported. %s is a variable. An error message is dynamically returned based on call conditions.
400 InvalidParameter.EncryptedNotSupported %s The specified parameter is invalid, and your encryption operation is not supported. %s is a variable. An error message is dynamically returned based on call conditions.
400 EncryptedOption.Conflict %s The parameter that is 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 encryption feature is disabled after a KMS key ID is specified.
400 Duplicate.TagKey The Tag.N.Key contain duplicate key. The tag key already exists. Tag keys must be unique.
400 InvalidTagKey.Malformed The specified Tag.n.Key is not valid. Invalid Tag.N.Key value.
400 InvalidTagValue.Malformed The specified Tag.n.Value is not valid. Invalid Tag.N.Value value.
400 InvalidPerformanceLevel.Malformed The specified parameter PerformanceLevel is not valid. Invalid PerformanceLevel value.
400 InvalidStorageClusterId.CapacityNotEnough The remaining capacity of the current dedicated storage cluster is less than the size of disk. The remaining capacity of the dedicated block storage cluster to which the disk belongs is insufficient.
400 InvalidInstance.NotFoundSystemDisk The specified instance has no system disk. 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 instance.
400 ProvisionedIopsForDiskCategoryUnsupported The specified disk category does not support provisioned iops. The disk category does not support provisioned IOPS.
400 BurstingEnabledForDiskCategoryUnsupported The specified disk category does not support bursting enabled. The disk category does not support the performance burst feature.
400 BurstingEnabledForMultiAttachDiskUnsupported The multi attach disk does not support bursting enabled. Disks for which the multi-attach feature is enabled do not support the performance burst feature.
400 ProvisionedIopsForDiskCategoryRequired The provisioned iops is required for this disk category. Provisioned IOPS is required for disks of this disk category.
400 NotSupportSnapshotEncrypted.ShareImage Shared snapshot creating encrypted disks with native snapshot encrypt is not supported. When you create encrypted disks based on a shared image, only the encryption key provided by the shared image can be used for these disks and you cannot specify encryption keys for the disks.
400 NotSupportSnapshotEncrypted.DiskCategory The specified disk category does not support creating encrypted disks with native snapshot encrypt. Disks of the disk category cannot be created based on encrypted snapshots.
400 QuotaExceed.DiskCapacity The used capacity of disk type has exceeded the quota in the zone, %s. The capacity of disks that belong to the specified disk category exceeds the quota limit for the zone. You can go to the Quota Center to view and increase the quota.
400 InsufficientBalance.AgentAccount The account balance is insufficient. Please contact your channel partner to recharge in time. The credit balance of your channel partner is insufficient. Contact your channel partner to add funds to the account in a timely manner.
400 InvalidAccountStatus.NotEnoughBalance Your account does not have enough balance, please contact your partner to increase your account balance. Your credit balance is insufficient. Contact your channel partner to increase your account availability.
403 InvalidDataDiskCategory.NotSupported Specified disk category is not supported. Invalid DataDiskCategory value.
403 InstanceDiskCategoryLimitExceed The total size of specified disk category in an instance exceeds. The maximum disk capacity of the category for an instance is exceeded.
403 InvalidSnapshot.NotReady The specified snapshot creation is not completed yet. The specified snapshot is not created.
403 InvalidSnapshot.TooOld This operation is forbidden because the specified snapshot is created before 2013-07-15. 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 size of the specified snapshot exceeds 2,000 GB.
403 OperationDenied The specified snapshot is not allowed to create disk. The specified snapshot cannot be used to create disks.
403 QuotaExceed.PortableCloudDisk The quota of portable cloud disk exceeds. The maximum number of removable disks is exceeded.
403 InvalidDiskCategory.ValueUnauthorized The disk category is not authorized. You are not authorized to manage the specified disk category.
403 InvalidSnapshotId.NotReady The specified snapshot has not completed yet. The specified snapshot is being created.
403 InvalidSnapshotId.NotDataDiskSnapshot The specified snapshot is system disk snapshot. The specified snapshot is a system disk snapshot.
403 InvalidDiskSize.TooSmall Specified disk size is less than the size of snapshot. The specified disk size is smaller than the snapshot size.
403 OperationDenied The type of the disk does not support the operation. The disk category does not support this operation.
403 InvalidDataDiskCategory.NotSupported %s Invalid data disk category. %s is a variable. An error message is dynamically returned based on call conditions.
403 InvalidDiskSize.NotSupported Disk size is not supported. Invalid Size value.
403 InvalidAccountStatus.NotEnoughBalance Your account does not have enough balance. Your account balance is insufficient. Add funds to your account and try again.
403 InvalidAccountStatus.SnapshotServiceUnavailable Snapshot service has not been opened yet. The operation is not supported while the snapshot service is not activated.
403 InvalidPayMethod The specified pay method is not valid. Invalid payment method.
403 InvalidDiskCategory.NotSupported The specified disk category is not supported. The specified disk category does not support this operation.
403 InvalidDiskSize.NotSupported The specified disk size is not supported. The specified disk size is not supported.
403 UserNotInTheWhiteList The user is not in disk white list. You are not authorized to manage the disk. Try again when you are authorized.
403 QuotaExceed.PostPaidDisk Living postPaid disks quota exceeded. The maximum number of pay-as-you-go disks is exceeded.
403 InvalidRegion.NotSupport The specified region does not support byok. The Bring Your Own Key (BYOK) feature is not supported in the specified region.
403 UserNotInTheWhiteList The user is not in byok white list. You are not authorized to use the BYOK feature. Try again after you are authorized.
403 InvalidParameter.KMSKeyId.CMKNotEnabled The CMK needs to be enabled. The customer master key (CMK) is not enabled when the ID of the CMK is specified for a disk. You can call the DescribeKey operation of KMS to query the information about the specified CMK.
403 InvalidParameter.KMSKeyId.CMKUnauthorized The CMK needs to be added ECS tag. You are not authorized to use the CMK.
403 InvalidParameter.KMSKeyId.KMSUnauthorized ECS service have no right to access your KMS. 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. 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 instance is being upgraded. Try again later.
403 QuotaExceed.Tags %s The maximum number of tags is exceeded. %s is a variable. An error message is dynamically returned based on call conditions.
403 QuotaExceeded.PostpaidDataDiskCapacity The quota of postpaid data disk capacity exceeds. The capacity of pay-as-you-go data disks exceeds the quota limit.
403 OperationDenied.SnapshotNotAllowed The specified snapshot is not allowed to create disk. The specified snapshot cannot be used to create disks.
403 LastTokenProcessing The last token request is processing. A token request is being processed. Try again later.
403 InvalidParameter.MultiAttach The specified param MultiAttach is not valid. Invalid MultiAttach value.
403 InvalidParameter.MultiAttachAndInstanceIdConflict The parameter MultiAttach and InstanceId are conflict. MultiAttach and InstanceId cannot be both specified.
403 InvalidParameter.DiskCategoryAndMultiAttachConflict The specified disk category does not support multi attach set. MultiAttach is not supported by Shared Block Storage devices.
403 InvalidParameter.DiskCategoryAndMultiAttachNotMatch The specified disk category does not support multi attach enabled. The specified disk category does not support the multi-attach feature.
403 OperationDenied.ZoneNotSupportMultiAttachDisk The specified zone does support multi attach disk. 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. Your coupon balance is insufficient or your coupons have expired.
403 InvalidOperation.CreateFromSnapshotUnsupported The elastic ephemeral disk cannot be created from snapshot. Elastic ephemeral disks cannot be created from snapshots.
404 InvalidRegionId.NotFound The specified RegionId does not exist. The RegionId is not found.
404 InvalidZoneId.NotFound The specified zone does not exist. The ZoneId is not found.
404 InvalidSnapshotId.NotFound The specified SnapshotId does not exist. The SnapshotId is not found.
404 InvalidResourceGroup.NotFound The ResourceGroup provided does not exist in our records. The resource group is not found.
404 InvalidParameter.KMSKeyId.NotFound The specified KMSKeyId does not exist. The specified KMS key ID is not found
404 InvalidInstanceId.NotFound The InstanceId provided does not exist in our records. The instance is not found. Check whether the instance ID is correct.
500 InternalError The request processing has failed due to some unknown error. An internal error occurred. Try again later.
500 InternalError The request processing has failed due to some unknown error, exception or failure. An internal error occurred. Try again later.

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