カスタムイメージを、そのイメージと同じリージョンにある Object Storage Service (OSS) バケットにエクスポートします。
操作説明
イメージをエクスポートする前に:
-
イメージのエクスポートに記載されている前提条件と注意事項をご確認ください。
-
ImageFormatパラメーターは、日本 (東京)、インドネシア (ジャカルタ)、ドイツ (フランクフルト)、UAE (ドバイ)、米国 (バージニア)、イギリス (ロンドン)、シンガポール、マレーシア (クアラルンプール)、米国 (シリコンバレー) のリージョンでのみ利用可能です。このパラメーターをサポートしていないリージョンでは、イメージはデフォルトで RAW 形式でエクスポートされます。 -
Resource Access Management (RAM) を使用して、Elastic Compute Service (ECS) に OSS への書き込み権限を付与する必要があります。次の手順に従ってください。
必要な名前
AliyunECSImageExportDefaultRoleでロールを作成し、次の信頼ポリシーをアタッチします。{ "Statement": [ { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { "Service": [ "ecs.aliyuncs.com" ] } } ], "Version": "1" }デフォルトのシステム権限ポリシー
AliyunECSImageExportRolePolicyをAliyunECSImageExportDefaultRoleロールにアタッチします。詳細については、「RAM ロールへの権限付与」をご参照ください。また、次の権限を含むカスタムポリシーを作成することもできます。{ "Version": "1", "Statement": [ { "Action": [ "oss:GetObject", "oss:PutObject", "oss:DeleteObject", "oss:GetBucketLocation", "oss:GetBucketInfo", "oss:AbortMultipartUpload", "oss:ListMultipartUploads", "oss:ListParts" ], "Resource": "*", "Effect": "Allow" } ] }
イメージがエクスポートされた後:
カスタムイメージは、指定された OSS バケットに保存されます。ダウンロード手順については、「カスタムイメージのダウンロード」をご参照ください。
今すぐお試しください
テスト
RAM 認証
|
アクション |
アクセスレベル |
リソースタイプ |
条件キー |
依存アクション |
|
ecs:ExportImage |
update |
*Image
|
なし | なし |
リクエストパラメーター
|
パラメーター |
型 |
必須 / 任意 |
説明 |
例 |
| RegionId |
string |
必須 |
カスタムイメージのリージョン ID。 DescribeRegions を呼び出して、Alibaba Cloud の最新のリージョンリストを表示できます。 |
cn-hangzhou |
| ImageId |
string |
必須 |
カスタムイメージの ID。 |
m-bp67acfmxazb4p**** |
| OSSBucket |
string |
必須 |
エクスポートされたイメージの保存先 OSS バケット。 |
testexportImage |
| OSSPrefix |
string |
任意 |
OSS オブジェクトのプレフィックス。プレフィックスは 1~30 文字の長さで、英字と数字で構成できます。 |
EcsExport |
| ImageFormat |
string |
任意 |
エクスポートされるイメージファイルの形式。有効な値:
デフォルト値:raw。 |
raw |
| RoleName |
string |
任意 |
イメージのエクスポートに使用される RAM ロールの名前。 |
AliyunECSImageExportDefaultRole |
| DryRun |
boolean |
任意 |
実際にイメージをエクスポートせずに、リクエストの有効性を確認するためのドライランを実行するかどうかを指定します。有効な値:
デフォルト値:false。 |
レスポンスフィールド
|
フィールド |
型 |
説明 |
例 |
|
object |
|||
| RequestId |
string |
リクエスト ID。 |
C8B26B44-0189-443E-9816-D951F596**** |
| TaskId |
string |
イメージのエクスポートタスクの ID。 |
tsk-bp67acfmxazb4p**** |
| RegionId |
string |
リージョン ID。 |
cn-hangzhou |
例
成功レスポンス
JSONJSON
{
"RequestId": "C8B26B44-0189-443E-9816-D951F596****",
"TaskId": "tsk-bp67acfmxazb4p****",
"RegionId": "cn-hangzhou"
}
エラーコード
|
HTTP ステータスコード |
エラーコード |
エラーメッセージ |
説明 |
|---|---|---|---|
| 400 | MissingParameter | An input parameter "RegionId" that is mandatory for processing the request is not supplied. | |
| 400 | InvalidImageName.Malformed | The specified Image name is wrongly formed. | 指定されたイメージ名の形式が無効です。長さは 2 ~ 128 文字で、先頭は大文字または小文字の英字、または漢字である必要があります。後続の文字には、数字、"."、"_"、"-" を使うことができます。 |
| 400 | InvalidOSSPrefix.Malformed | The specified OSSPrefix format is wrongly formed. | |
| 400 | InvalidRegionId.NotFound | The specified RegionId does not exist. | |
| 400 | InvalidRegion.NotSupport | The specified region does not support image import or export. | |
| 400 | IncorrectImageStatus | The specified Image is not available. | |
| 400 | InvalidImageFormat.Malformed | The specified Image Format is wrongly formed. | |
| 400 | InvalidOSSBucket.NotFound | The specified OSS bucket does not exist in this region. | |
| 400 | OperationDenied | The specified image contains the snapshot of the data disk,does not support this operation. | |
| 400 | InvalidImage.DiskAmountOrSize | %s | |
| 400 | ImageNotSupported | The specified Image contains encrypted snapshots, do not support export. | |
| 400 | InvalidOSSObject.NeedRestore | The specified OSS object is a archive object, need restore first. | |
| 400 | InvalidOSSBucket.NotMatched | The specified OSS bucket is incorrect, %s. | |
| 400 | InvalidImageFormat.RegionNotSupported | The specified image format is not supported in current region. | |
| 400 | InvalidOSSBucket.ArchiveOssBucketNotSupported | Exporting an image to an OSS bucket with Archive, Cold Archive, or Deep Cold Archive storage class is not supported. | |
| 403 | ImageNotSupported | The specified image from the image market, do not support export image. | |
| 403 | ImageIsExporting | The specified Image is being exported. You can use the DescribeTasks API to check the status of existing tasks. | |
| 403 | ExportImageFailed | Exporting image is failed, Please contact the administrator. | |
| 403 | UserNotInTheWhiteList | The user is not in the white list of exporting image. | |
| 403 | NoSetRoletoECSServiceAcount | ECS service account Have no right to access your OSS.please attach a role of access your oss to ECS service account. | |
| 403 | InvalidOSS.NotAuthorized | The specified OSS bucket or object is not allowed to access. | |
| 403 | ConcurrentQuotaExceed.ExportImage | %s | |
| 403 | WeeklyQuotaExceed.ExportImage | %s | |
| 403 | InvalidImageLicense.NotSupported | %s | |
| 403 | InvalidImageCategory.NotSupported | The specified image category is not supported. | |
| 403 | InvalidOSSBucket.EncryptUnsupported | Accessing objects from encrypted OSS bucket is not supported. | |
| 404 | InvalidImageId.NotFound | The specified ImageId does not exist. |
完全なリストについては、「エラーコード」をご参照ください。
変更履歴
完全なリストについては、「変更履歴」をご参照ください。