カスタムイメージをあるリージョンから別のリージョンにコピーします。イメージのコピーにより、ECS インスタンスのクロスリージョン Deployment およびレプリケーションが可能になります。
操作説明
操作の説明
コピーしたイメージを使用して RunInstances 操作を呼び出して ECS インスタンスを作成するか、ReplaceSystemDisk 操作を呼び出してターゲットリージョンでインスタンスのシステムクラウドディスクを置き換えることができます。
この操作を呼び出す際は、以下の点に注意してください。
カスタムイメージは [Available] (利用可能) 状態である必要があります。
イメージがご使用のアカウント配下のカスタムイメージである場合、リージョン間でコピーできます。イメージが他のアカウントから共有されたものである場合、同じリージョン内でのみコピーできます。
イメージのコピープロセス中、 DeleteImage 操作を呼び出してコピー中のイメージを直接削除することはできません。ただし、 CancelCopyImage 操作を呼び出してコピータスクをキャンセルすることで、イメージを削除できます。
同じリージョンでは、最大値 5 のイメージコピータスクを同時に実行できます。その他のタスクは、実行中のタスクのいずれかが完了するまでキューで待機する必要があります。
ResourceGroupId パラメーターを使用して、コピーされたイメージが属するリソースグループを指定できます。ResourceGroupId パラメーターを指定しない場合、コピーされたイメージはデフォルトのリソースグループに属します。
今すぐお試しください
テスト
RAM 認証
|
アクション |
アクセスレベル |
リソースタイプ |
条件キー |
依存アクション |
|
ecs:CopyImage |
update |
*Image
*Image
|
なし | なし |
リクエストパラメーター
|
パラメーター |
型 |
必須 / 任意 |
説明 |
例 |
| DestinationImageName |
string |
任意 |
コピーされたイメージの名前。名前の長さは 2~128 文字である必要があります。先頭は英字または漢字とする必要があり、aliyun または acs: で始めることはできません。http:// または https:// を含めることはできません。数字、ピリオド (.)、コロン (:)、アンダースコア (_)、およびハイフン (-) を含めることができます。 |
YourImageName |
| DestinationDescription |
string |
任意 |
コピーされたイメージの説明。説明の長さは 2~256 文字である必要があり、http:// または https:// で始めることはできません。 |
This is a description example. |
| ImageId |
string |
必須 |
ソースカスタムイメージの ID。 |
m-bp1h46wfpjsjastc**** |
| RegionId |
string |
必須 |
ソースカスタムイメージのリージョン ID。 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。このパラメーターを指定しない場合、レプリケーション後のイメージはデフォルトのリソースグループに属します。 説明
この操作を Resource Access Management (RAM) ユーザーとして呼び出し、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 のキー。N の有効な値: 1~20。このパラメーターを指定する場合、空の文字列にすることはできません。タグキーの長さは最大 128 文字です。aliyun または acs: で始めることはできず、http:// または https:// を含めることはできません。 |
TestKey |
| Value |
string |
任意 |
コピーされたイメージのタグ N の値。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. | 指定されたスナップショットが存在しません。スナップショット ID が正しいことを確認してください。 |
| 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. | この操作を実行するには、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 Marketplace から取得されたものであり、ターゲットリージョンでは公開されていません。 |
| 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 customer master keys. Please choose another region or use a default KMS key and try again. | |
| 403 | UserNotInTheWhiteList | The user is not in byok white list. | ユーザーが共有ブロックストレージのホワイトリストに登録されていません。ホワイトリストへの登録を申請するには、チケットを起票してください。 |
| 403 | InvalidRegionId.NotSupportEncryptAlgorithm | The parameter EncryptAlgorithm is not supported. Please remove EncryptAlgorithm and try again. | |
| 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 | 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. | レコードにリソースグループが見つかりません。 |
| 409 | InvalidOperation.Conflict | Request was denied due to conflict with a previous request, please try again later. | タスクが競合しているため、この操作は実行できません。 |
完全なリストについては、「エラーコード」をご参照ください。
変更履歴
完全なリストについては、「変更履歴」をご参照ください。