カスタムイメージをあるリージョンから別のリージョンにコピーします。この操作を使用すると、リージョン間で ECS インスタンスをデプロイしたり、リージョン間で ECS インスタンスを複製したりできます。
操作説明
操作の説明
コピーしたイメージをターゲットリージョンで使用して、ECS インスタンスを作成 (RunInstances) したり、インスタンスのシステムディスクを置き換えたり (ReplaceSystemDisk) できます。
この操作の呼び出し時は、以下の点に注意してください。
カスタムイメージは [Available] (利用可能) 状態である必要があります。
イメージがご使用のアカウント配下のカスタムイメージである場合、リージョン間でコピーできます。イメージが別のアカウントから共有されたものである場合、同じリージョン内でのみコピーできます。
イメージのコピー処理中は、コピー中のイメージを直接削除 (DeleteImage) することはできません。ただし、コピータスクをキャンセル (CancelCopyImage) することで、コピー中のイメージを削除できます。
単一のリージョンでは、イメージコピータスクの最大値は 5 です。追加のタスクはキューに入れられ、実行中のタスクのいずれかが完了した後に、キューの順番に従って実行されます。
ResourceGroupId パラメーターを使用して、コピーされたイメージが属するリソースグループを指定できます。ResourceGroupId パラメーターを設定しない場合、コピーされたイメージはデフォルトのリソースグループに属します。 DeleteImage CancelCopyImage
今すぐお試しください
テスト
RAM 認証
|
アクション |
アクセスレベル |
リソースタイプ |
条件キー |
依存アクション |
|
ecs:CopyImage |
update |
*Image。
|
なし | なし |
リクエストパラメーター
|
パラメーター |
型 |
必須 / 任意 |
説明 |
例 |
| DestinationImageName |
string |
任意 |
コピーされたイメージの名前。名前の長さは 2~128 文字である必要があります。先頭は英字にする必要があり、aliyun または acs: で始めることはできません。http:// または https:// を含めることはできません。数字、ピリオド (.)、コロン (:)、アンダースコア (_)、ハイフン (-) を含めることができます。 |
YourImageName |
| DestinationDescription |
string |
任意 |
コピーされたイメージの説明。説明の長さは 2~256 文字である必要があり、http:// または https:// で始めることはできません。 |
これは説明の例です |
| ImageId |
string |
必須 |
ソースカスタムイメージの ID。 |
m-bp1h46wfpjsjastc**** |
| RegionId |
string |
必須 |
ソースカスタムイメージのリージョン ID。DescribeRegions を呼び出して、最新のリージョンリストを取得できます。 DescribeRegions |
cn-hangzhou |
| DestinationRegionId |
string |
任意 |
ターゲットリージョンの ID。 |
cn-shanghai |
| Encrypted |
boolean |
任意 |
コピーされたイメージを暗号化するかどうかを指定します。
デフォルト値: 未指定 (初期化は不要)。 |
false |
| KMSKeyId |
string |
任意 |
イメージの暗号化に使用されるキーの ID。 |
e522b26d-abf6-4e0d-b5da-04b7******3c |
| EncryptAlgorithm |
string |
任意 |
このパラメーターは公開されていません。 |
hide |
| ResourceGroupId |
string |
任意 |
コピーされたイメージのリソースグループ ID。このパラメーターを設定しない場合、コピーされたイメージはデフォルトのリソースグループに属します。 説明
RAM (Resource Access Management) ユーザーを使用してこの操作を呼び出し、ResourceGroupId パラメーターを空のままにした場合は、次の点に注意してください。RAM ユーザーにデフォルトのリソースグループに対する権限がない場合、呼び出し時にエラーメッセージ Forbidden: User not authorized to operate on the specified resource が返されます。ResourceGroupId パラメーターを RAM ユーザーに権限があるリソースグループ ID に設定するか、対応する Alibaba Cloud アカウントを使用して RAM ユーザーにデフォルトのリソースグループに対する権限を付与してから、この操作を再度呼び出してください。 |
rg-bp67acfmxazb4p**** |
| Tag |
array<object> |
任意 |
タグ。 |
|
|
object |
任意 |
タグ。 |
||
| Key |
string |
任意 |
コピーされたイメージのタグキー。N の有効な値: 1~20。タグキーは空の文字列にすることはできません。タグキーの長さは最大 128 文字で、aliyun または acs: で始めることはできません。http:// または https:// を含めることはできません。 |
TestKey |
| Value |
string |
任意 |
コピーされたイメージのタグ値。N の有効な値: 1~20。タグ値は空の文字列にすることができます。タグ値の長さは最大 128 文字で、acs: で始めることはできません。http:// または https:// を含めることはできません。 |
TestValue |
| DryRun |
boolean |
任意 |
ドライランのみを実行するかどうかを指定します。有効な値:
デフォルト値: false。 |
false |
| ClientToken |
string |
任意 |
リクエストのべき等性を確保するために使用されるクライアントトークン。クライアントを使用してトークンを初期化および生成できますが、異なるリクエスト間でトークンが一意であることを確認してください。ClientToken の値には ASCII 文字のみを使用でき、長さは 64 文字以下である必要があります。詳細については、「べき等性を確保する方法」を参照してください。 |
123e4567-e89b-12d3-a456-426655440000 |
| シナリオ | ソースイメージのステータス | Encrypted パラメーター | KMSKeyId パラメーター | ターゲットリージョンで EBS アカウントレベルのデフォルト暗号化 が構成されているかどうか | 送信先イメージの結果 | 説明 |
| 1 | 暗号化されていないイメージ | False または未指定 | 未指定 | 未構成 | 暗号化されていないイメージ | イメージを暗号化する設定ではなく、変更されません。 |
| 2 | 暗号化されていないイメージ | True | 未指定 | 任意 | 完全に暗号化されたイメージ | ユーザーが明示的に暗号化するようリクエストします。EBS アカウントレベルのデフォルト暗号化が構成されている場合、構成されたデフォルトキーがシークレットキー暗号化になります。それ以外の場合、サービスキーがシークレットキー暗号化になります。 |
| 3 | 暗号化されていないイメージ | True | 指定 | 任意 | 完全に暗号化されたイメージ | ユーザーが明示的に暗号化するようリクエストします。指定された KMSKeyId がシークレットキー暗号化になります。 |
| 4 | 暗号化されていないイメージ | 未指定 | 未指定 | 構成済み | 完全に暗号化されたイメージ | EBS アカウントレベルのデフォルト暗号化に構成されたキーがシークレットキー暗号化になります。 |
| 5 | 暗号化されたイメージ | 未指定 | 未指定 | 未構成 | 暗号化されたイメージ | 元の形式が保持されます。暗号化されていないスナップショットは暗号化されないままになり、暗号化されたスナップショットはサービスキーで暗号化するよう設定されます。 |
| 6 | 暗号化されたイメージ | 未指定または True | 未指定 | 構成済み | 完全に暗号化されたイメージ | EBS アカウントレベルのデフォルト暗号化に構成されたキーがシークレットキー暗号化になります。 |
| 7 | 暗号化されたイメージ | True | 未指定 | 未構成 | 完全に暗号化されたイメージ | サービスキーがシークレットキー暗号化になります。 |
| 8 | 暗号化されたイメージ | True | 未指定 | 構成済み | 完全に暗号化されたイメージ | EBS アカウントレベルのデフォルト暗号化に構成されたキーがシークレットキー暗号化になります。 |
| 9 | 暗号化されたイメージ | True | 指定 | 任意 | 完全に暗号化されたイメージ | ユーザーが明示的に暗号化するようリクエストします。指定された KMSKeyId がシークレットキー暗号化になります。 |
レスポンスフィールド
|
フィールド |
型 |
説明 |
例 |
|
object |
|||
| ImageId |
string |
コピーされたイメージの ID。 |
m-bp1h46wfpjsjastd**** |
| RequestId |
string |
リクエスト ID |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
例
成功レスポンス
JSONJSON
{
"ImageId": "m-bp1h46wfpjsjastd****",
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
エラーコード
|
HTTP ステータスコード |
エラーコード |
エラーメッセージ |
説明 |
|---|---|---|---|
| 400 | InvalidDescription.Malformed | The specified destination description is wrongly formed. | 指定されたリソースの説明の形式が無効です。説明の長さは 2~256 文字で、http:// または https:// で始まることはできません。 |
| 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 Encrypted parameter must be set to true when KMSKeyId is specified. Please adjust the parameters and try again. | |
| 400 | InvalidEncrypted.NotMatchEncryptAlgorithm | The Encrypted parameter must be set to true when EncryptAlgorithm is specified. Please adjust the parameters and try again. | |
| 400 | InvalidEncryptAlgorithm | The specified EncryptAlgorithm is not valid. Ensure the value is a supported encryption algorithm such as AES-256. | |
| 400 | InvalidEncrypted.NotMatchKmsKeyId | The Encrypted parameter must be set to true when KMSKeyId is specified. Please adjust the parameters and try again. | |
| 400 | OperationDenied.CommunityImage | Community image does not support copy. | コミュニティイメージのコピーはサポートされていません。 |
| 400 | InvalidImageName.Malformed | The specified destination image name is wrongly formed. | イメージ名が無効です。命名規則の詳細については、DestinationImageName パラメーターのメトリックの説明を参照してください。 |
| 400 | InvalidParameter.KmsNotEnabled | The specified operation need enable KMS. | 現在の操作には Key Management サービス (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. | 指定されたディスクのソーススナップショットは 2013 年 7 月 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. | 指定された操作を実行できません。イメージのソースイメージは Alibaba Cloud マーケットプレイスのものであり、ターゲットリージョンで公開されていません。 |
| 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 | The ECS service is not authorized to access your KMS key. Please grant the ECS service permission to use the key and try again. | |
| 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 ECS service is not authorized to access your KMS key. Please grant the ECS service permission to use the key and try again. | |
| 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 | The ECS service is not authorized to access your KMS key. Please grant the ECS service permission to use the key and try again. | |
| 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 specified KMS key must be in an enabled state. Please enable the key in the KMS console and try again. | |
| 403 | InvalidParameter.KMSKeyId.CMKUnauthorized | The specified KMS key is not authorized for the ECS service. Please grant the ECS service permission to use the key in the KMS console and try again. | |
| 403 | InvalidOperation.VhdImageUnsupported | The specified vhd image is not supported for this operation. Please switch to a raw image and retry. | VHD 初期化イメージはこの操作をサポートしていません。RAW 初期化イメージに切り替えて、再試行してください。 |
| 403 | InvalidOperation.CloudBoxImageCopyUnsupported | Copying CloudBox images is not supported. | CloudBox イメージはコピーをサポートしていません。 |
| 403 | OperationDenied.KMSKeyUnauthorized | The operation is denied due to missing KMS key authorization. Please check the KMS key permissions and ensure the key is properly authorized for this operation. | |
| 404 | InvalidImageId.NotFound | The specified ImageId does not exist. | このアカウントの下に指定されたイメージが存在しません。イメージ ID が正しいかどうかを確認してください。 |
| 404 | InvalidParameter.KMSKeyId.NotFound | The specified KMSKeyId does not exist. Please verify that the key ID is correct and that the key resides in the current region. | |
| 404 | InvalidResourceGroup.NotFound | The ResourceGroup provided does not exist in our records. | Record にリソースグループが見つかりません。 |
| 409 | InvalidOperation.Conflict | Request was denied due to conflict with a previous request, please try again later. | タスクの競合が発生しているため、この操作は実行できません。 |
完全なリストについては、「エラーコード」をご参照ください。
変更履歴
完全なリストについては、「変更履歴」をご参照ください。