Copies a normal snapshot from one region to another.
Description
Before you call this operation, take note of the following items:
- New snapshots (snapshot copies) cannot be used to roll back the disks for which source snapshots (copied snapshots) were created.
- Encrypted snapshots cannot be copied.
- Local snapshots cannot be copied.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | CopySnapshot |
The operation that you want to perform. Set the value to CopySnapshot. |
ResourceGroupId | String | No | rg-bp67acfmxazb4p**** |
This parameter is unavailable. |
Tag.N.Key | String | No | TestKey |
The key of tag N to add to the new snapshot. The tag key cannot be an empty string. It can be up to 128 characters in length and cannot start with acs: or aliyun. It cannot contain http:// or https://. |
Tag.N.Value | String | No | TestValue |
The value of tag N to add to the new snapshot. The tag value can be an empty string. It can be up to 128 characters in length and cannot start with acs: or aliyun. It cannot contain http:// or https://. |
RegionId | String | Yes | cn-chengdu |
The region ID of the source snapshot. You can call the DescribeRegions operation to query the most recent region list. |
DestinationRegionId | String | Yes | us-east-1 |
The region ID of the new snapshot. |
SnapshotId | String | Yes | s-bp67acfmxazb4p**** |
The ID of the source snapshot. |
DestinationSnapshotName | String | Yes | CopySnapshotDemo |
The name of the new snapshot. The name must be 2 to 128 characters in length. It must start with a letter and cannot start http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-). This parameter is empty by default. |
DestinationSnapshotDescription | String | Yes | CopySnapshotDemo |
The description of the new snapshot. The description must be 2 to 256 characters in length and cannot start with http:// or https://. This parameter is empty by default. |
RetentionDays | Integer | No | 60 |
The retention period of the new snapshot. Unit: days. The new snapshot is automatically released when its retention period ends. Valid values: 1 to 65536. This parameter is empty by default, which indicates that the snapshot is not automatically released. |
Encrypted | Boolean | No | false |
Specifies whether to encrypt the new snapshot. Valid values:
Default value: false. |
KMSKeyId | String | No | 0e478b7a-4262-4802-b8cb-00d3fb40**** |
The ID of the Key Management Service (KMS) customer master key (CMK) in the destination region to use to encrypt the new snapshot. |
Arn.N.RoleType | String | No | null |
Note This parameter is unavailable.
|
Arn.N.Rolearn | String | No | null |
Note This parameter is unavailable.
|
Arn.N.AssumeRoleFor | Long | No | 0 |
Note This parameter is unavailable.
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
SnapshotId | String | s-bp17441ohwka0yui**** |
The ID of the new snapshot. |
RequestId | String | C8B26B44-0189-443E-9816-D951F596**** |
The ID of the request. |
Examples
Sample requests
http(s)://ecs.aliyuncs.com/?Action=CopySnapshot
&ResourceGroupId=hide
&Tag=[{"Key":"TestKey","Value":"TestValue"}]
&RegionId=cn-chengdu
&DestinationRegionId=us-east-1
&SnapshotId=s-bp67acfmxazb4p****
&DestinationSnapshotName=CopySnapshotDemo
&DestinationSnapshotDescription=CopySnapshotDemo
&RetentionDays=60
&Common request parameters
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<CopySnapshotResponse>
<RequestId>C8B26B44-0189-443E-9816-D951F596****</RequestId>
<SnapshotId>s-bp17441ohwka0yui****</SnapshotId>
</CopySnapshotResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "C8B26B44-0189-443E-9816-D951F596****",
"SnapshotId" : "s-bp17441ohwka0yui****"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
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. |
403 | InvalidSnapshotId.NotFound | The specified snapshot is not exists. | The error message returned because the specified SnapshotId parameter does not exist. |
403 | InvalidUser.NotInWhiteList | The user is not in the white list of copying snapshot. | The error message returned because you are not authorized to perform this operation. |
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 | InvalidSnapshotId.NotReady | The specified snapshot has not completed yet. | The error message returned because the specified snapshot is being created. |
403 | InvalidSnapshotName.Malformed | The specified SnapshotName is wrongly formed. | The error message returned because the specified DestinationSnapshotName parameter is invalid. |
403 | InvalidDescription.Malformed | The specified description is wrongly formed. | The error message returned because the specified DestinationSnapshotDescription parameter is invalid. The description must be 2 to 256 characters in length and cannot start with http:// or https://. |
403 | InvalidRetentionDays.Malformed | The specified RetentionDays is not valid. | The error message returned because the specified RetentionDays parameter is invalid. |
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 | InvalidParameter.KMSKeyId.NotFound | The specified KMSKeyId does not exist. | The error message returned because the specified KMSKeyId parameter does not exist. |
403 | InvalidParameter.KMSKeyId.CMKNotEnabled | The CMK needs to be enabled. | The error message returned because the CMK specified by the KMSKeyId parameter is not enabled. You can call the DescribeKey operation of KMS to query the information of 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. |
For a list of error codes, see Service error codes.