You can call this operation to copy a normal snapshot from one region to another.

Description

When you call this operation, note that:

  • New snapshots, which are snapshot copies created from source snapshots, cannot be used to roll back the disks from which the source snapshots were created.
  • Encrypted snapshots cannot be copied.
  • Local snapshots cannot be copied.

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 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 that is copied from 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 with http:// or https://. It can contain letters, digits, colons (:), underscores (_), and hyphens (-).

Default value: null.

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://.

Default value: null.

RetentionDays Integer No 60

The retention period of the new snapshot. Unit: days. The new snapshot is automatically released when it expires. Valid values: 1 to 65536.

Default value: null, indicating that the new snapshot will not be automatically released.

Tag.N.Key String No ECS

The tag key of 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 Documentation

The tag value of 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://.

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-bp17441ohwka0yuhi***"
}

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 source snapshot 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. Top up your account before you proceed.
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 a tag with the identical key already exists.
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 InvalidRegionId.MalFormed The specified RegionId is not valid The error message returned because the specified RegionId parameter is invalid.

For a list of error codes, visit the API Error Center.