全部產品
Search
文件中心

Elastic Compute Service:CopySnapshot - 複製快照

更新時間:Apr 04, 2026

將一份標準快照或加密快照從一個地區複製到另一個地區。

介面說明

調用該介面時,您需要注意:

  • 複製後的新快照不能復原源快照對應的雲端硬碟。

  • 不支援複製本地快照。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

ecs:CopySnapshot

create

*Snapshot

acs:ecs:{#regionId}:{#accountId}:snapshot/{#snapshotId}

請求參數

名稱

類型

必填

描述

樣本值

ResourceGroupId

string

該參數暫未開放使用。

rg-bp67acfmxazb4p****

Tag

array<object>

新快照的標籤資訊。

object

新快照的標籤資訊。

Key

string

新快照的標籤鍵。一旦傳入該值,則不允許為空白字串。最多支援 128 個字元,不能以 aliyun 和 acs:開頭,不能包含 http://或者 https://。

TestKey

Value

string

新快照的標籤值。一旦傳入該值,允許為空白字串。最多支援 128 個字元,不能以 aliyun 和 acs:開頭,不能包含 http://或者 https://。

TestValue

RegionId

string

源快照所在的地區。您可以調用 DescribeRegions 查看最新的阿里雲地區列表。

cn-chengdu

DestinationRegionId

string

新快照的目標地區 ID。

us-east-1

SnapshotId

string

源快照 ID。

s-bp67acfmxazb4p****

DestinationSnapshotName

string

新快照的名稱。長度為 2~128 個字元,必須以大小寫字母或中文開頭,不能以 http://和 https:// 開頭。支援 Unicode 中 letter 分類下的字元(其中包括英文、中文和數字等)。可以包含半形冒號(:)、底線(_)、半形句號(.)或者短劃線(-)。

預設值:空。

CopySnapshotDemo

DestinationSnapshotDescription

string

新快照的描述資訊。長度為 2~256 個英文或中文字元,不能以 http://或 https://開頭。

預設值:空。

CopySnapshotDemo

RetentionDays

integer

新快照的保留時間長度,單位為天,到期後快照會被自動釋放。取值範圍:1~65536。

預設值:空,表示快照不會被自動釋放。

60

Encrypted

boolean

是否加密雲端硬碟。取值範圍:

  • true:是。

  • false:否。

預設值:false。

false

KMSKeyId

string

目標地區的 KMS 使用者主要金鑰。

0e478b7a-4262-4802-b8cb-00d3fb40****

Arn

array<object>

說明

該參數正在邀測中,暫不支援使用。

object

RoleType

string

說明

該參數暫未開放使用。

null

Rolearn

string

說明

該參數暫未開放使用。

null

AssumeRoleFor

integer

說明

該參數暫未開放使用。

0

DestinationStorageLocationArn

string

說明

該參數暫未開放使用。

null

ClientToken

string

保證請求等冪性。從您的用戶端產生一個參數值,確保不同請求間該參數值唯一。ClientToken 只支援 ASCII 字元,且不能超過 64 個字元。更多詳情,請參見如何保證等冪性

123e4567-e89b-12d3-a456-426655440000

返回參數

名稱

類型

描述

樣本值

object

SnapshotId

string

新快照的 ID。

s-bp17441ohwka0yui****

RequestId

string

請求 ID。

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

樣本

正常返回樣本

JSON格式

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

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 Duplicate.TagKey The Tag.N.Key contain duplicate key. 標籤中存在重複的鍵,請保持鍵的唯一性。
400 InvalidTagKey.Malformed The specified Tag.n.Key is not valid. 指定的標籤鍵參數有誤。
400 InvalidTagValue.Malformed The specified Tag.n.Value is not valid. 指定的標籤值參數有誤。
400 InvalidRegionId.MalFormed The specified RegionId is not valid.
400 InvalidParameter.Arns The specified Arns is not valid. 該Arns參數無效,請檢查後重新傳遞。
500 InternalError The request processing has failed due to some unknown error, exception or failure. 內部錯誤,請重試。
403 InvalidSnapshotId.EncryptedNotSupport The specified snapshot with encrypted does not support copy.
403 InvalidSnapshotId.NotFound The specified snapshot is not exists. 指定的源快照不存在。
403 InvalidSnapshotCategory.NotSupportCopy The specified snapshot's category does not support copy.
403 InvalidUser.NotInWhiteList The user is not in the white list of copying snapshot. 您暫未授權執行該操作。
403 InvalidAccountStatus.NotEnoughBalance Your account does not have enough balance.
403 InvalidAccountStatus.SnapshotServiceUnavailable Snapshot service has not been opened yet. 快照服務未開通,操作無法執行。
403 InvalidSnapshotId.NotReady The specified snapshot has not completed yet.
403 InvalidOperation.Unauthorized The specified operation is unauthorized.
403 InvalidOperation.UnfinishedCrossRegionCopy This disk has unfinished cross-region copy snapshots in the target region. 該磁碟還有未完成的跨地區快照拷貝。
403 InvalidOperation.NotSupportCopyInSameRegion Copying snapshot in the same region is not supported. 拷貝快照的源和目的region不能相同。
403 InvalidSnapshotName.Malformed The specified SnapshotName is wrongly formed.
403 InvalidDescription.Malformed The specified description is wrongly formed.
403 InvalidRetentionDays.Malformed The specified RetentionDays is not valid.
403 InvalidRegionId.NotSupportedEncryptedSnapshotCopy The specified region not support copy encrypted snapshot.
403 InvalidRegion.NotSupport The specified region does not support byok. 該地區不支援BYOK。
403 InvalidRegionId.NotSupportEncryptAlgorithm The current region does not support creating encrypted disks with EncryptAlgorithm.
403 InvalidRegionId.NotExists Region not exists.
403 InvalidEncryptAlgorithm The specified parameter EncryptAlgorithm is not valid.
403 InvalidEncrypted.NotMatchKmsKeyId The specified parameter Encrypted must be true when KmsKeyId is not empty.
403 InvalidEncrypted.NotMatchEncryptAlgorithm The specified parameter Encrypted must be true when EncryptAlgorithm is not empty.
403 InvalidEncrypted.NotSupportDecrypt Encrypted snapshot not support copy to decrypt snapshot.
403 InvalidSnapshotCategory.NotSupportCrossRegionCopy The specified snapshot is not support cross region copy.
403 InvalidSnapshotCategory.NotSupportEncryptedCopy The specified snapshot is not support encrypted copy.
403 InvalidParameter.KmsNotEnabled The specified operation need enable KMS.
403 InvalidParameter.DataEncryptedKeyCreateFailed Create kms data encrypted key fail. If you need further assistance, you can contact the KMS Technical Support. 使用KMS主要金鑰建立資料密鑰失敗,請聯絡KMS值班同學進一步排查。
403 InvalidParameter.KMSKeyId.NotFound The specified KMSKeyId does not exist.
403 InvalidParameter.KMSKeyId.KMSUnauthorized ECS service have no right to access your KMS. ECS 服務無權訪問您的 KMS。
403 InvalidKMSKeyId.NotSymmetric The specified parameter KmsKeyId must be symmetric.
403 QuotaExceed.SnapshotQuota The quota is insufficient, please contact your channel partner to increase the quota. 您當前配額不足,請您可以聯絡渠道夥伴為您增加額度。
403 InvalidOperation.UnfinishedEncryptedSnapshotCopy This disk has unfinished encrypted copy snapshots in the target region. 雲端硬碟存在未完成的加密快照拷貝任務。
403 InvalidParameterDestinationStorageLocationArn.Unauthorized The operation has failed due to lack of permission for the specified "DestinationStorageLocationArn". Please use a resource with appropriate permission for the operation.
403 InvalidParameterDestinationStorageLocationArn.RegionNotMatch The region information in the specified parameter "DestinationStorageLocationArn" is inconsistent with "DestinationRegionId". Please use the correct information for the operation.
403 InvalidSnapshot.StorageLocationNotSupported The storage location of the current snapshot does not support this operation.
403 InvalidSnapshot.EncryptedNotSupported The current operation does not support the use of encrypted snapshots. 加密快照不支援此操作
403 InvalidParameterDestinationStorageLocationArn.Malformed The specified DestinationStorageLocationArn is wrongly formed.
403 OperationDenied.NonCompliantDestinationRegion The copy operation to the destination region is not in compliance with regulations. 目標地區不符合安全合規要求。
403 OperationDenied.SnapshotCategoryNotSupportCopy The specified category of snapshot not support copy. 指定快照類型暫不支援拷貝
403 InvalidParameter.KMSKeyId.CMKNotEnabled The CMK (Customer Master Key) must be in an active state. 使用者主要金鑰(CMK)需要處於活動狀態。
403 InvalidParameter.KMSKeyId.CMKUnauthorized The CMK(Customer Master Key) lacks authorization to add tags to the ECS service. 使用者主要金鑰(CMK)未授權ECS服務添加標籤許可權。
409 InvalidOperation.Conflict Request was denied due to conflict with a previous request, please try again later. 請求操作的資源與之前的請求衝突

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情