All Products
Search
Document Center

Elastic Compute Service:CopySnapshot

Last Updated:Mar 19, 2024

Copies a normal snapshot from one region to another.

Operation description

When you call this operation, take note of the following items:

  • New snapshots (copies) cannot be used to roll back disks from which the source snapshots (originals) 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.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
ResourceGroupIdstringNo

This parameter is not publicly available.

rg-bp67acfmxazb4p****
Tagobject []No

The tag key and value of the new snapshot.

KeystringNo

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

TestKey
ValuestringNo

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

TestValue
RegionIdstringYes

The region ID of the source snapshot. You can call the DescribeRegions operation to query the most recent region list.

cn-chengdu
DestinationRegionIdstringYes

The ID of the destination region to which to copy the source snapshot.

us-east-1
SnapshotIdstringYes

The ID of the source snapshot.

s-bp67acfmxazb4p****
DestinationSnapshotNamestringYes

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://. The name can contain digits, letters, colons (:), underscores (_), and hyphens (-).

This parameter is empty by default.

CopySnapshotDemo
DestinationSnapshotDescriptionstringYes

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.

CopySnapshotDemo
RetentionDaysintegerNo

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.

60
EncryptedbooleanNo

Specifies whether to encrypt the new snapshot. Valid values:

  • true
  • false

Default value: false.

false
KMSKeyIdstringNo

The ID of the customer master key (CMK) in Key Management Service (KMS) in the destination region.

0e478b7a-4262-4802-b8cb-00d3fb40****
Arnobject []No
Note This parameter is currently in invitational preview and unavailable for public use.
RoleTypestringNo
Note This parameter is not publicly available.
null
RolearnstringNo
Note This parameter is not publicly available.
null
AssumeRoleForlongNo
Note This parameter is not publicly available.
0
DestinationStorageLocationArnstringNo
Note This parameter is not publicly available.
null

Response parameters

ParameterTypeDescriptionExample
object
SnapshotIdstring

The ID of the new snapshot.

s-bp17441ohwka0yui****
RequestIdstring

The request ID.

C8B26B44-0189-443E-9816-D951F596****

Examples

Sample success responses

JSONformat

{
  "SnapshotId": "s-bp17441ohwka0yui****",
  "RequestId": "C8B26B44-0189-443E-9816-D951F596****"
}

Error codes

HTTP status codeError codeError messageDescription
400Duplicate.TagKeyThe Tag.N.Key contain duplicate key.The specified tag key already exists. Tag keys must be unique.
400InvalidTagKey.MalformedThe specified Tag.n.Key is not valid.The specified Tag.N.Key parameter is invalid.
400InvalidTagValue.MalformedThe specified Tag.n.Value is not valid.The specified tag value is invalid.
400InvalidRegionId.MalFormedThe specified RegionId is not valid.The specified region does not exist.
403InvalidSnapshotId.EncryptedNotSupportThe specified snapshot with encrypted does not support copy.-
403InvalidSnapshotId.NotFoundThe specified snapshot is not exists.The specified source snapshot does not exist.
403InvalidSnapshotCategory.NotSupportCopyThe specified snapshot's category does not support copy.-
403InvalidUser.NotInWhiteListThe user is not in the white list of copying snapshot.You are not authorized to perform the operation.
403InvalidParamter%s-
403InvalidAccountStatus.NotEnoughBalanceYour account does not have enough balance.Your account balance is insufficient. Add funds to your account and try again.
403InvalidAccountStatus.SnapshotServiceUnavailableSnapshot service has not been opened yet.The operation is not supported while the snapshot service is not activated.
403InvalidSnapshotId.NotReadyThe specified snapshot has not completed yet.The specified snapshot is being created.
403InvalidOperation.UnauthorizedThe specified operation is unauthorized.-
403InvalidOperation.UnfinishedCrossRegionCopyThis disk has unfinished cross-region copy snapshots in the target region.-
403InvalidOperation.NotSupportCopyInSameRegionCopying snapshot in the same region is not supported.-
403InvalidSnapshotName.MalformedThe specified SnapshotName is wrongly formed.The format of the specified snapshot name is invalid.
403InvalidDescription.MalformedThe specified description is wrongly formed.The resource description is invalid. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
403InvalidRetentionDays.MalformedThe specified RetentionDays is not valid.The specified RetentionDays parameter is invalid.
403InvalidRegionId.NotSupportedEncryptedSnapshotCopyThe specified region not support copy encrypted snapshot.-
403InvalidRegion.NotSupportThe specified region does not support byok.The bring your own key (BYOK) feature is not supported in the region.
403InvalidRegionId.NotSupportEncryptAlgorithmThe current region does not support creating encrypted disks with EncryptAlgorithm.-
403InvalidRegionId.NotExistsRegion not exists.-
403InvalidEncryptAlgorithmThe specified parameter EncryptAlgorithm is not valid.-
403InvalidEncrypted.NotMatchKmsKeyIdThe specified parameter Encrypted must be true when KmsKeyId is not empty.-
403InvalidEncrypted.NotMatchEncryptAlgorithmThe specified parameter Encrypted must be true when EncryptAlgorithm is not empty.-
403InvalidEncrypted.NotSupportDecryptEncrypted snapshot not support copy to decrypt snapshot.-
403InvalidSnapshotCategory.NotSupportCrossRegionCopyThe specified snapshot is not support cross region copy.-
403InvalidSnapshotCategory.NotSupportEncryptedCopyThe specified snapshot is not support encrypted copy.-
403InvalidParameter.KmsNotEnabledThe specified operation need enable KMS.The current operation requires opening KMS
403InvalidParameter.DataEncryptedKeyCreateFailedCreate kms data encrypted key fail. If you need further assistance, you can contact the KMS Technical Support.-
403InvalidParameter.KMSKeyId.NotFoundThe specified KMSKeyId does not exist.The specified KMSKeyId parameter does not exist.
403InvalidParameter.KMSKeyId.CMKUnauthorizedThis operation for kmsKeyId is forbidden by KMS. If you need further assistance, you can contact the KMS Technical Support.-
403InvalidParameter.KMSKeyId.CMKNotEnabledThe CMK needs to be enabled.The customer master key (CMK) is not enabled when KMSKeyId is specified for an encrypted disk. You can call the DescribeKey operation of KMS to query information about the specified CMK.
403InvalidParameter.KMSKeyId.KMSUnauthorizedECS service have no right to access your KMS.ECS is not authorized to access your KMS resources.
403InvalidKMSKeyId.NotSymmetricThe specified parameter KmsKeyId must be symmetric.-
403InvalidEncrypted.NotMatchKmsKeyIdThe specified parameter Encrypted must be true when kmsKeyId is not null.-
403QuotaExceed.SnapshotQuotaThe quota is insufficient, please contact your channel partner to increase the quota.The quota is insufficient. Contact your channel partner to request a quota increase.
403InvalidOperation.UnfinishedEncryptedSnapshotCopyThis disk has unfinished encrypted copy snapshots in the target region.-
403InvalidParameterDestinationStorageLocationArn.UnauthorizedThe operation has failed due to lack of permission for the specified "DestinationStorageLocationArn". Please use a resource with appropriate permission for the operation.-
403InvalidParameterDestinationStorageLocationArn.RegionNotMatchThe region information in the specified parameter "DestinationStorageLocationArn" is inconsistent with "DestinationRegionId". Please use the correct information for the operation.-
403InvalidSnapshot.StorageLocationNotSupportedThe storage location of the current snapshot does not support this operation.-
403InvalidSnapshot.EncryptedNotSupportedThe current operation does not support the use of encrypted snapshots.-
403InvalidParameterDestinationStorageLocationArn.MalformedThe specified DestinationStorageLocationArn is wrongly formed.-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-12-18The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 403 change
    delete Error Codes: 400
2023-08-02The Error code has changed. The request parameters of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 403 change
    delete Error Codes: 400
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: DestinationStorageLocationArn
2023-06-19The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 403 change
    delete Error Codes: 400
2023-03-01The Error code has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    Error Codes 403 change
    delete Error Codes: 400