You can call this operation to copy a normal snapshot from one region to another.
Description
When you call this operation, take note of the following items:
- New snapshots, which are the copies of source snapshots, cannot be used to roll back the disks for which the source 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. |
SnapshotId | String | Yes | s-bp67acfmxazb4p**** |
The ID of the source snapshot. |
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. |
DestinationSnapshotName | String | Yes | CopySnapshotDemo |
The name of the new snapshot. The name must be 2 to 128 characters in length and can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-). It must start with a letter and cannot start with http:// or https://. 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 will be automatically released when it expires. Valid values: 1 to 65536. This parameter is empty by default, which indicates that the snapshot will not be automatically released. |
Tag.N.Key | String | No | TestKey |
The key of tag N to be bound to the new snapshot. The tag key cannot be an empty string. It can be up to 128 characters in length and cannot contain http:// or https://. It cannot start with acs: or aliyun. |
Tag.N.Value | String | No | TestValue |
The value of tag N to be bound to the new snapshot. The tag value can be an empty string. It can be up to 128 characters in length and cannot contain http:// or https://. It cannot start with acs: or aliyun. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | C8B26B44-0189-443E-9816-D951F59623A9 |
The ID of the request. |
SnapshotId | String | s-bp17441ohwka0yui**** |
The ID of the new snapshot. |
Examples
Sample requests
https://ecs.aliyuncs.com/?Action=CopySnapshot
&DestinationRegionId=us-east-1
&RegionId=cn-chengdu
&SnapshotId=s-bp67acfmxazb4p****
&<Common request parameters>
Sample success responses
XML
format
<CopySnapshotResponse>
<RequestId>C8B26B44-0189-443E-9816-D951F59623A9</RequestId>
<SnapshotId>s-bp17441ohwka0yuhi****</SnapshotId>
</CopySnapshotResponse>
JSON
format
{
"RequestId": "C8B26B44-0189-443E-9816-D951F59623A9",
"SnapshotId": "s-bp17441ohwka0yui****"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
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. |
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.NotReady | The specified snapshot has not completed yet. | The error message returned because the specified snapshot is being created. |
For a list of error codes, visit the API Error Center.