あるリージョンから別のリージョンにカスタムイメージをコピーします。カスタムイメージをコピーして、リージョン間で Elastic Compute Service (ECS) インスタンスをデプロイまたはコピーできます。
操作説明
注意事項
カスタムイメージをターゲットリージョンにコピーした後、そのイメージコピー (新しいイメージ) を使用して、RunInstances 操作を呼び出して ECS インスタンスを作成したり、ReplaceSystemDisk 操作を呼び出してターゲットリージョン内のインスタンスのシステムディスクを置き換えたりすることができます。
次の点にご注意ください。
Available状態のカスタムイメージのみコピーできます。ご利用の Alibaba Cloud アカウントに属するカスタムイメージは、リージョン間でコピーできます。他者から共有されたイメージは、そのイメージが存在するリージョン内でのみコピーできます。
イメージのコピー中は、DeleteImage 操作を呼び出して新しいイメージを削除することはできません。ただし、CancelCopyImage 操作を呼び出して、進行中のイメージコピータスクをキャンセルすることはできます。
1 つのリージョンでサポートされる同時イメージコピータスクは 5 つまでです。超過したイメージコピータスクは、実行のためにキューに入れられます。
ResourceGroupIdを設定して、新しいイメージを割り当てるリソースグループを指定できます。ResourceGroupIdを設定しない場合、新しいイメージはデフォルトのリソースグループに割り当てられます。
今すぐお試しください
テスト
RAM 認証
|
アクション |
アクセスレベル |
リソースタイプ |
条件キー |
依存アクション |
|
ecs:CopyImage |
update |
*Image
|
なし | なし |
リクエストパラメーター
|
パラメーター |
型 |
必須 / 任意 |
説明 |
例 |
| DestinationImageName |
string |
任意 |
新しいイメージの名前。名前は 2~128 文字である必要があります。名前は文字で始まる必要があり、 |
YourImageName |
| DestinationDescription |
string |
任意 |
イメージコピーの説明。説明は 2~256 文字である必要があり、 |
This is a description example. |
| ImageId |
string |
必須 |
ソースカスタムイメージの ID。 |
m-bp1h46wfpjsjastc**** |
| RegionId |
string |
必須 |
ソースカスタムイメージのリージョン ID。DescribeRegions 操作を呼び出して、最新のリージョンリストをクエリできます。 |
cn-hangzhou |
| DestinationRegionId |
string |
任意 |
ソースカスタムイメージのコピー先となるターゲットリージョンの ID。 |
cn-shanghai |
| Encrypted |
boolean |
任意 |
新しいイメージを暗号化するかどうかを指定します。
デフォルト値: false。 |
false |
| KMSKeyId |
string |
任意 |
イメージコピーの暗号化に使用されるキーの ID。 |
e522b26d-abf6-4e0d-b5da-04b7******3c |
| EncryptAlgorithm |
string |
任意 |
説明
このパラメーターは利用できません。 |
hide |
| ResourceGroupId |
string |
任意 |
新しいイメージを割り当てるリソースグループの ID。このパラメーターを指定しない場合、新しいイメージはデフォルトのリソースグループに割り当てられます。 説明
デフォルトのリソースグループを管理する権限を持たない Resource Access Management (RAM) ユーザーとして CopyImage 操作を呼び出し、かつ |
rg-bp67acfmxazb4p**** |
| Tag |
array<object> |
任意 |
タグのリスト。 |
|
|
object |
任意 |
タグのリスト。 |
||
| Value |
string |
任意 |
イメージコピーのタグ N の値。N の有効値:1~20。タグ値は空の文字列にすることができます。タグ値は最大 128 文字で、 |
TestValue |
| Key |
string |
任意 |
イメージコピーのタグ N のキー。N の有効値:1~20。タグキーは空の文字列にすることはできません。タグキーは最大 128 文字で、 |
TestKey |
| DryRun |
boolean |
任意 |
実際のリクエストを実行せずに、ドライランのみを実行するかどうかを指定します。インスタンスで使用されているイメージがホットマイグレーションをサポートしているかどうかを確認するかどうかを指定します。有効値:
デフォルト値: false。 |
false |
| ClientToken |
string |
任意 |
リクエストのべき等性を確保するために使用するクライアントトークン。クライアントを使用して値を生成できますが、異なるリクエスト間で値が一意であることを確認する必要があります。トークンには ASCII 文字のみを含めることができ、長さは 64 文字を超えることはできません。詳細については、「べき等性を確保する方法」をご参照ください。 |
123e4567-e89b-12d3-a456-426655440000 |
レスポンスフィールド
|
フィールド |
型 |
説明 |
例 |
|
object |
|||
| ImageId |
string |
イメージコピーの ID。 |
m-bp1h46wfpjsjastd**** |
| RequestId |
string |
リクエスト ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
例
成功レスポンス
JSONJSON
{
"ImageId": "m-bp1h46wfpjsjastd****",
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
エラーレスポンス
JSONJSON
{
"RequestId": "C8B26B44-0189-443E-9816-D951F59623A9",
"ImageId": "Img-231234567"
}
エラーコード
|
HTTP ステータスコード |
エラーコード |
エラーメッセージ |
説明 |
|---|---|---|---|
| 400 | InvalidDescription.Malformed | The specified destination description is wrongly formed. | |
| 400 | SourceRegion.NotFound | The source region not found. | |
| 400 | DestinationRegion.NotFound | The destination region not found. | |
| 400 | IncorrectImageStatus | The image not available. | |
| 400 | InvalidSnapshotId.NotFound | The specified SnapshotId does not exist. | |
| 400 | InvalidImageName.Duplicated | The specified image name is already in use in the target region. Please try a different one. | |
| 400 | InvalidParameter.EncryptedIllegal | The specified parameter Encrypted must be true when kmsKeyId is not empty. | |
| 400 | InvalidEncrypted.NotMatchEncryptAlgorithm | The specified parameter Encrypted must be true when EncryptAlgorithm is not empty. | |
| 400 | InvalidEncryptAlgorithm | The specified parameter EncryptAlgorithm is not valid. | |
| 400 | InvalidEncrypted.NotMatchKmsKeyId | The specified parameter Encrypted must be true when KmsKeyId is not empty. | |
| 400 | OperationDenied.CommunityImage | Community image does not support copy. | |
| 400 | InvalidImageName.Malformed | The specified destination image name is wrongly formed. | |
| 400 | InvalidParameter.KmsNotEnabled | The specified operation need enable KMS. | |
| 400 | OperationDenied.ImageCopyConflict | The same image cannot be copied concurrently. Please wait until the last copy is completed before performing the next operation. | |
| 400 | Account.Arrearage | Your account has an outstanding payment. | |
| 400 | Duplicate.TagKey | The Tag.N.Key contain duplicate key. | |
| 401 | InvalidAliUid.IsNull | The aliUid must not be null. | |
| 500 | InternalError | The request processing has failed due to some unknown error, exception or failure. | |
| 403 | Forbbiden | User not authorized to operate on the specified resource. | |
| 403 | InvalidOperation.CopyingDataFromThisRegionUnsupported | Data transfer from the current region to other regions is not supported. | |
| 403 | InvalidOperation.CopyingDataToThisRegionUnsupported | Only Some Regions %s can copy data to this region. | |
| 403 | QuotaExceed.Image | The number of images exceeds the limit (%s). | |
| 403 | QuotaExceed.Snapshot | The snapshot quota exceeds. | |
| 403 | OperationDenied.ImageCopying | The image is currently being copied. Please try again later. | |
| 403 | RegionNotSupportCopy | The region not support copy. | |
| 403 | InvalidSnapshot.TooOld | This operation is denied because the specified snapshot is created before 2013-07-15. | |
| 403 | OperationDenied | The specified snapshot is not allowed to create image. | |
| 403 | IncorrectDestinationRegion | The destination region is not equal the target region. | |
| 403 | OperationDeined.EncryptedSnapshot | The image contains encrypted snapshots, which do not support copying. | |
| 403 | OperationDenied.SameRegionOnly | The image shared from others can not be copied to another region directly. | |
| 403 | OperationDenied.NotPublished | The operation is denied because corresponding marketplace image is not published in destination region. | |
| 403 | OperationDenied.NotAuthorized | The operation is denied because corresponding marketplace image is not authorized to current user. | |
| 403 | OperationDenied.EncryptSnapshotAcrossRegion | The image do not contain encrypted snapshots, which do not support copying to encrypted ones. | |
| 403 | InvalidParameter.KMSKeyId.KMSUnauthorized | ECS service have no right to access your KMS. | |
| 403 | InvalidRegion.NotSupport | The specified region does not support byok. | |
| 403 | UserNotInTheWhiteList | The user is not in byok white list. | |
| 403 | InvalidRegionId.NotSupportEncryptAlgorithm | The current region does not support creating encrypted disks with EncryptAlgorithm. | |
| 403 | OperationDenied.KmsServiceUnauthorized | The account is not authorized to kms service, please authorize it. | |
| 403 | OperationDenied.NonCompliantDestinationRegion | The copy operation to the destination region is not in compliance with regulations. | |
| 403 | InvalidEncrypted.NotMatchDiskDefaultEncryption | The specified parameter Encrypted not match for your account default encryption settings. | |
| 403 | InvalidParameter.DataEncryptedKeyCreateFailed | Create kms data encrypted key fail. If you need further assistance, you can contact the KMS Technical Support. | |
| 403 | SizeExceed.Image | The image exceeds the maximum size. You can use the CopySnapshot API to copy your snapshots of the image and then create a new image from them. | |
| 403 | InvalidParameter.KMSKeyId.CMKNotEnabled | The CMK (Customer Master Key) must be in an active state. | |
| 403 | InvalidParameter.KMSKeyId.CMKUnauthorized | The CMK(Customer Master Key) lacks authorization to add tags to the ECS service. | |
| 403 | InvalidOperation.VhdImageUnsupported | The specified vhd image is not supported for this operation. Please switch to a raw image and retry. | |
| 403 | InvalidOperation.CloudBoxImageCopyUnsupported | Copying CloudBox images is not supported. | |
| 404 | InvalidImageId.NotFound | The specified ImageId does not exist. | |
| 404 | InvalidParameter.KMSKeyId.NotFound | The specified KMSKeyId does not exist. | |
| 404 | InvalidResourceGroup.NotFound | The ResourceGroup provided does not exist in our records. | |
| 409 | InvalidOperation.Conflict | Request was denied due to conflict with a previous request, please try again later. |
完全なリストについては、「エラーコード」をご参照ください。
変更履歴
完全なリストについては、「変更履歴」をご参照ください。