Disk cloning allows you to quickly create a new disk with the same data as the source disk in the same zone. The new disk supports custom capacity, type, and encryption attributes. After the new disk is attached to an instance, you can quickly replicate business data or horizontally scale your services.
Operation description
The disk cloning feature itself is free of charge, but the new disk generated by cloning is billed based on block storage billing rules. Billable items vary by disk type and include disk capacity fees, provisioned performance fees, and performance burst fees. Except for performance burst fees, which are billed after a burst occurs, all other fees start to accrue after the disk is created, regardless of whether the disk is attached to an instance.
How to use
This is an asynchronous operation. After a successful call, use the taskGroupId and call the DescribeTasks operation to obtain the execution result.
Features
- Cloning supports only ESSD series disks (cloud_essd, cloud_auto, cloud_essd_entry, cloud_regional_disk_auto) as the source, and the
new diskcan only be an ESSD series disk type.Non-regional disks can only be cloned to non-regional disk types. Regional disks can only be cloned to regional disk types.
Local disks and elastic ephemeral disks cannot be cloned or used as clone sources.
You can specify the
new disktype and performance level (PL) during cloning.You can specify the
new diskcapacity during cloning, but the new disk capacity must be greater than or equal to thesource diskcapacity.You can configure provisioned performance and performance burst for the
new disk, provided that the destination disk type supports provisioned performance and performance burst.You can specify encryption for the
new diskand change the encryption key. If thesource diskis encrypted, you cannot clone it into an unencrypted disk, but you can change the encryption key.You can use a subscription disk as the
source disk. Even if the subscription disk has expired, it can still be used as thesource disk.The
new diskcreated by cloning does not support reinitialization.Cloning does not support storage sets or dedicated block storage clusters, but disks in them can be used as the
source disk. The cloned disk will not be in the storage set or dedicated block storage cluster.Source diskstatus restrictions:The
source diskstatus is "In Use" and the corresponding instance status is "Running" or "Stopped".The
source diskstatus is "Available" and the disk has been previously attached.A disk undergoing a specification change cannot be used as the
source disk.A disk undergoing expansion cannot be used as the
source disk.
Disk cloning is not supported for instance hibernation scenarios. If a disk is on a hibernated instance, it cannot be used as the
source disk.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:CloneDisks |
create |
*Disk
*Disk
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID. You can call DescribeRegions to query the most recent region list. |
cn-hangzhou |
| DryRun |
string |
No |
Specifies whether to perform only a dry run, without performing the actual request. Valid values:
|
true |
| ClientToken |
string |
No |
The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but make sure that the token is unique among different requests. The ClientToken value can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence. |
123e4567-e89b-12d3-a456-426655440000 |
| Tag |
array<object> |
No |
The list of tags for the disk. |
|
|
object |
No |
The list of tags for the disk. |
||
| Key |
string |
No |
The tag key of 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 start with aliyun or acs:. The tag key cannot contain http:// or https://. |
TestKey |
| Value |
string |
No |
The tag value of 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://. |
TestValue |
| ResourceGroupId |
string |
No |
The ID of the resource group to which the disk belongs. |
rg-bp199lyny9b3**** |
| SourceDiskId |
string |
Yes |
The ID of the source disk. |
d-bp1d6tsvznfghy7y**** |
| DiskName |
string |
No |
The name of the disk. The name must be 2 to 128 characters in length and can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-). The name must start with a letter. Default value: empty. |
MyDiskName |
| DiskCategory |
string |
Yes |
The category of the new disk. Valid values:
Note
Disk category restrictions for disk cloning:
|
cloud_essd |
| PerformanceLevel |
string |
No |
The performance level (PL) of the enterprise SSD to create. Settings for this parameter vary based on the standard SSD type. Valid values:
Note
If DiskCategory is set to cloud_essd, PerformanceLevel is required. For more information about how to select an ESSD performance level, see ESSDs. |
PL1 |
| Size |
integer |
Yes |
The capacity of the new disk. Unit: GiB. You must specify a value for this parameter. Valid values:
|
60 |
| MultiAttach |
string |
Yes |
Specifies whether to enable the multi-attach attribute for the new disk. Settings for this parameter. Valid values:
|
Disabled |
| ProvisionedIops |
integer |
No |
The provisioned read/write IOPS of the ESSD AutoPL disk. Valid values:
Baseline performance = max{min{1,800 + 50 × Capacity, 50,000}, 3,000}. Note
This parameter is supported only when DiskCategory is set to cloud_auto. For more information, see ESSD AutoPL disks. |
10 |
| BurstingEnabled |
boolean |
No |
Specifies whether to enable the performance burst feature for the new disk. Valid values:
Note
This parameter is supported only when DiskCategory is set to cloud_auto. For more information, see ESSD AutoPL disks. |
true |
| Encrypted |
boolean |
No |
Specifies whether the new disk is encrypted. Valid values:
Default value: false. |
false |
| KmsKeyId |
string |
No |
The key ID of the KMS key used by the new disk. |
key-szz67b2f696f4wh9yeg5d |
| Arn |
array<object> |
No |
Note
This parameter is not publicly available. |
|
|
object |
No |
Note
This parameter is not publicly available. |
||
| RoleType |
string |
No |
Note
This parameter is not publicly available. |
null |
| Rolearn |
string |
No |
Note
This parameter is not publicly available. |
null |
| AssumeRoleFor |
string |
No |
Note
This parameter is not publicly available. |
null |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The request ID. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3**** |
| TaskGroupId |
string |
The task group ID of the disk cloning operation. You can call DescribeTasks to query the task execution result. |
g-2ze2op2grqpclwu7**** |
Examples
Success response
JSON format
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
"TaskGroupId": "g-2ze2op2grqpclwu7****"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidDiskCategory.SourceDiskCategoryNotSupport | The specified target disk category %s is not support clone from origin disk category %s. | |
| 400 | InvalidDisk.NeverAttached | The specified disk %s has been never attached to any instance. | |
| 400 | InvalidStatus.SourceDiskStatusViolation | The specified disk %s status error, want Available or In_use, but %s. | |
| 400 | InvalidDiskCategory.ValueNotSupported | The specified parameter "DiskCategory" is not valid. | The specified cloud disk type DiskCategory is invalid. |
| 400 | InvalidDiskName.ValueNotSupported | The specified parameter "DiskName" is not valid. | |
| 400 | InvalidPerformanceLevel.ValueNotSupported | The specified parameter "PerformanceLevel" is not valid. | |
| 400 | InvalidMultiAttach.ValueNotSupported | The specified parameter "MultiAttach" is not valid. | |
| 400 | InvalidBurstingEnabled.DiskCategoryNotSupported | The specified disk category does not support bursting enabled. | |
| 400 | InvalidProvisionedIops.DiskCategoryNotSupported | The specified disk category does not support provisioned IOPS. | |
| 400 | InvalidProvisionedIops.LimitExceed | The provisioned IOPS exceeds the permitted range limit for the specified disk category | |
| 400 | InvalidSize.MustGreaterThanSourceDisk | The specified size %s(GB) must greater than source disk size %s(GB). | |
| 400 | DryRunOperation | Request validation has been passed with DryRun flag set. | Your request is determined as valid when the DryRun parameter is set. |
| 400 | InvalidSourceDisk.Lazyloading | The specified source disk %s is lazyloading. | |
| 400 | InvalidOperation.DiskCloneExceedsConcurrencyLimit | The source disk %s has reached the maximum number (1) of concurrent clone operations. In-progress cloned disks: %s. Please wait a moment and try again later. | |
| 400 | InvalidParameter.Arns | The specified Arns is not valid. | The Arns parameter is invalid. Please check and pass it again. |
| 401 | InvalidOperation.UserNotInWhiteList | The specified user %s is not in the CloneDisks whitelist. | |
| 404 | InvalidRegionId.NotFound | The specified region does not exist. | The specified RegionId parameter does not exist. Check whether the service is available in the specified region. |
| 404 | InvalidSourceDiskId.NotFound | The specified source disk does not exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.