イメージをビルドするためのイメージテンプレートを作成します。
操作説明
API
イメージテンプレートを使用して、イメージコンテンツをカスタマイズし、リージョンやアカウントをまたいでイメージをビルドできます。イメージテンプレートを作成する前に、次の点にご注意ください。
カスタムイメージテンプレートのみ作成できます。
ソースイメージとして使用できるのは、パブリックイメージ、カスタムイメージ、共有イメージ、またはイメージファミリーのみです。
イメージテンプレートを使用してイメージをビルドすると、システムはビルドを支援するために 1 つ以上の中間インスタンスを作成します。これらの従量課金の Elastic Compute Service (ECS) インスタンスに対して課金されます。詳細については、「従量課金」をご参照ください。
BuildContent で指定されたビルドコンテンツについては、次の点にご注意ください。
FROMコマンドは非推奨です。システムはBuildContent内のFROMコマンドを無視し、代わりにBaseImageTypeおよびBaseImageパラメーターを使用してソースイメージを選択します。イメージテンプレートのコンテンツは 16 KB を超えることはできません。サポートされているコマンドの詳細については、「Image Builder のコマンドリファレンス」をご参照ください。
詳細については、「Image Builder の概要」をご参照ください。
今すぐお試しください
テスト
RAM 認証
|
アクション |
アクセスレベル |
リソースタイプ |
条件キー |
依存アクション |
|
ecs:CreateImagePipeline |
create |
*ImagePipeline
|
なし |
|
リクエストパラメーター
|
パラメーター |
型 |
必須 / 任意 |
説明 |
例 |
| Tag |
array<object> |
任意 |
イメージパイプラインに追加するタグ。 |
|
|
object |
任意 |
タグのリスト。 |
||
| Key |
string |
任意 |
タグ N のキー。N は 1 から 20 です。タグキーの長さは 1~128 文字です。 |
TestKey |
| Value |
string |
任意 |
タグ N の値。N は 1 から 20 です。タグ値は空にすることも、最大 128 文字にすることもできます。 |
TestValue |
| RegionId |
string |
必須 |
リージョン ID。DescribeRegions 操作を呼び出して、Alibaba Cloud リージョンの最新リストをクエリできます。 |
cn-hangzhou |
| ResourceGroupId |
string |
任意 |
リソースグループの ID。 |
rg-bp67acfmxazb4p**** |
| AddAccount |
array |
任意 |
送信先イメージを共有する Alibaba Cloud アカウントの ID。最大 20 個のアカウント ID を指定できます。 |
1234567890 |
|
integer |
任意 |
送信先イメージを共有する Alibaba Cloud アカウントの ID。 |
1234567890 |
|
| ToRegionId |
array |
任意 |
イメージを配布する送信先リージョンの ID。最大 20 個のリージョン ID を指定できます。 このパラメーターを指定しない場合、イメージは現在のリージョンにのみ作成されます。 |
cn-hangzhou |
|
string |
任意 |
イメージを配布する送信先リージョンの ID。 |
cn-hangzhou |
|
| RegionId |
string |
必須 |
リージョン ID。DescribeRegions 操作を呼び出して、Alibaba Cloud リージョンの最新リストをクエリできます。 |
cn-hangzhou |
| ResourceGroupId |
string |
任意 |
リソースグループの ID。 |
rg-bp67acfmxazb4p**** |
| BaseImageType |
string |
必須 |
ベースイメージのタイプ。有効な値:
|
IMAGE |
| BaseImage |
string |
任意 |
ベースイメージ。このパラメーターの値は、
|
m-bp67acfmxazb4p**** |
| Name |
string |
任意 |
イメージパイプラインの名前。長さは 2~128 文字で、文字または漢字で始まる必要があり、 説明
このパラメーターを指定しない場合、 |
testImagePipeline |
| Description |
string |
任意 |
イメージパイプラインテンプレートの説明。説明の長さは 2~256 文字で、 |
This is description. |
ImageName
deprecated
|
string |
任意 |
送信先イメージ名のプレフィックス。 重要
このパラメーターは非推奨です。代わりに ImageOptions.ImageName を使用してください。
|
testImageName |
| VSwitchId |
string |
任意 |
中間インスタンスの起動に使用される VPC 内の VSwitch の ID。 このパラメーターを指定しない場合、新しい VPC と VSwitch が作成されます。VPC リソースのクォータが十分であることを確認してください。詳細については、「使用制限」をご参照ください。 |
vsw-bp67acfmxazb4p**** |
| InstanceType |
string |
任意 |
中間インスタンスのインスタンスタイプ。DescribeInstanceTypes 操作を呼び出してインスタンスタイプをクエリできます。 このパラメーターを指定しない場合、システムは在庫状況に応じて、最小の vCPU とメモリを持つインスタンスタイプを自動的に選択します。たとえば、デフォルトでは `ecs.g6.large` が選択されます。`ecs.g6.large` の在庫がない場合は、`ecs.g6.xlarge` が選択されます。 |
ecs.g6.large |
| SystemDiskSize |
integer |
任意 |
中間インスタンスのシステムディスクのサイズ。単位:GiB。有効な値:20~500。 デフォルト値:40。 |
40 |
| InternetMaxBandwidthOut |
integer |
任意 |
中間インスタンスのパブリックアウトバウンド帯域幅。単位:Mbit/s。有効な値:0~100。 デフォルト値:0。 |
0 |
| DeleteInstanceOnFailure |
boolean |
任意 |
イメージビルドが失敗したときに中間インスタンスをリリースするかどうかを決定します。有効な値:
デフォルト値:true。 説明
中間インスタンスを起動できない場合、デフォルトでは保持されません。 |
true |
| BuildContent |
string |
任意 |
イメージビルドテンプレートのコンテンツ。コンテンツのサイズは最大 16 KB です。サポートされているコマンドの詳細については、「Image Builder のコマンドリファレンス」をご参照ください。 |
COMPONENT ic-bp12dvdzvr9k9***** COMPONENT acs:ecs:cn-hangzhou:18689161186*****:imagecomponent/ComponentName/1.*.* |
| ClientToken |
string |
任意 |
リクエストのべき等性を保証するためにクライアントが生成したグローバルに一意のトークン。ClientToken の値には ASCII 文字のみを含めることができ、長さは 64 文字を超えることはできません。詳細については、「べき等性を確保する方法」をご参照ください。 |
123e4567-e89b-12d3-a456-426655440000 |
| RepairMode |
string |
任意 |
イメージテンプレートのイメージ修復モード。 有効な値:
説明
修復項目は、チェックおよび修復機能の向上に伴い変更される場合があります。各修復項目の詳細については、「イメージチェックの概要」をご参照ください。 |
Standard |
ImageFamily
deprecated
|
string |
任意 |
送信先イメージファミリーの名前。 重要
このパラメーターは非推奨です。代わりに ImageOptions.ImageFamily を使用してください。
|
family |
| TestContent |
string |
任意 |
イメージテストテンプレートのコンテンツ。コンテンツのサイズは最大 16 KB です。サポートされているコマンドの詳細については、「Image Builder のコマンドリファレンス」をご参照ください。 |
COMPONENT ic-bp12dvdzvr9k9***** COMPONENT acs:ecs:cn-hangzhou:18689161186*****:imagecomponent/ComponentName/1.*.* |
| ImportImageOptions |
object |
任意 |
イメージをインポートするための設定。このパラメーターは、 |
|
| Architecture |
string |
任意 |
インポートするイメージのアーキテクチャ。有効な値:
デフォルト値:x86_64。 |
x86_64 |
| OSType |
string |
任意 |
オペレーティングシステムのタイプ。有効な値:
デフォルト値:linux。 |
linux |
| Platform |
string |
任意 |
オペレーティングシステムのディストリビューション。有効な値:
デフォルト値:OSType が Linux に設定されている場合は Others Linux、OSType が Windows に設定されている場合は Other Windows。 |
Aliyun |
| BootMode |
string |
任意 |
イメージの起動モード。有効な値:
デフォルト値:BIOS。 重要
起動の失敗を防ぐため、起動モードがイメージでサポートされていることを確認してください。 |
BIOS |
| LicenseType |
string |
任意 |
イメージがインポートされた後にオペレーティングシステムをアクティベートするために使用されるライセンスタイプ。有効な値:
デフォルト値:Auto。 |
Auto |
| DiskDeviceMappings |
array<object> |
任意 |
カスタムイメージのディスクに関する情報。
|
|
|
object |
任意 |
|||
| OSSBucket |
string |
任意 |
イメージファイルを含む OSS バケット。 |
ecsimageos |
| OSSObject |
string |
任意 |
OSS バケットに保存されているイメージファイルの名前 (キー)。 |
CentOS_5.4_32.raw |
| Format |
string |
任意 |
イメージのフォーマット。有効な値:
デフォルト値:空のままにすると、システムは自動的にイメージフォーマットを検出します。 |
RAW |
| DiskImageSize |
integer |
任意 |
イメージファイルから作成するディスクのサイズ (GiB)。システムディスクの場合、この値はイメージファイルのサイズ以上である必要があります。 有効な値:
ベースイメージファイルを OSS バケットにアップロードした後、バケット内のイメージファイルのサイズを表示できます。 |
40 |
| Features |
object |
任意 |
イメージの特徴量属性。 |
|
| NvmeSupport |
string |
任意 |
インポートするベースイメージが NVMe をサポートするかどうかを指定します。有効な値:
デフォルト値:unsupported。 |
supported |
| ImdsSupport |
string |
任意 |
||
| RetainImportedImage |
boolean |
任意 |
説明
このパラメーターは招待プレビューです。 |
false |
| RetentionStrategy |
string |
任意 |
||
| ImageName |
string |
任意 |
||
| Description |
string |
任意 |
||
| RoleName |
string |
任意 |
||
| ImportImageTags |
array<object> |
任意 |
||
|
object |
任意 |
|||
| Key |
string |
任意 |
||
| Value |
string |
任意 |
||
NvmeSupport
deprecated
|
string |
任意 |
送信先イメージが NVMe をサポートするかどうかを指定します。 重要
このパラメーターは非推奨です。代わりに ImageOptions.ImageFeatures.NvmeSupport を使用してください。
|
auto |
| AdvancedOptions |
object |
任意 |
詳細設定。 |
|
| RetainCloudAssistant |
boolean |
任意 |
送信先イメージにクラウドアシスタントを保持するかどうかを指定します。イメージビルドプロセス中、コマンドを実行するためにクラウドアシスタントが中間インスタンスに自動的にインストールされます。プロセス完了後にクラウドアシスタントを保持するかどうかを選択できます。有効な値:
デフォルト値:false。 説明
この設定は、イメージにすでにインストールされているクラウドアシスタントクライアントには影響しません。 |
true |
| ImageNameSuffix |
string |
任意 |
送信先イメージ名にサフィックスを自動的に追加する機能を無効にするかどうかを指定します。有効な値:
|
disable |
| ImageOptions |
object |
任意 |
送信先イメージのプロパティ。 |
|
| ImageName |
string |
任意 |
送信先イメージ名のプレフィックス。プレフィックスの長さは 2~64 文字である必要があります。文字または漢字で始まる必要があります。 完全なイメージ名は、プレフィックスとビルドタスク ID ( |
testImageName |
| ImageFamily |
string |
任意 |
送信先イメージファミリーの名前。名前は 2~128 文字の長さで、文字または漢字で始まる必要があります。 |
family |
| Description |
string |
任意 |
送信先イメージの説明。説明の長さは 2~256 文字で、 |
This is description. |
| ImageFeatures |
object |
任意 |
送信先イメージの特徴量の属性です。 |
|
| NvmeSupport |
string |
任意 |
送信先イメージが NVMe をサポートするかどうかを指定します。有効な値:
|
auto |
| ImageTags |
array<object> |
任意 |
送信先イメージのタグ。 |
|
|
object |
任意 |
|||
| Key |
string |
任意 |
タグのキー。タグキーの長さは 1~128 文字で、 |
TestKey |
| Value |
string |
任意 |
タグの値。タグ値は空にすることも、最大 128 文字にすることもできます。 |
TestValue |
レスポンスフィールド
|
フィールド |
型 |
説明 |
例 |
|
object |
|||
| ImagePipelineId |
string |
イメージパイプラインの ID。 |
ip-2ze5tsl5bp6nf2b3**** |
| RequestId |
string |
リクエストの ID。 |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
例
成功レスポンス
JSONJSON
{
"ImagePipelineId": "ip-2ze5tsl5bp6nf2b3****",
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}
エラーコード
|
HTTP ステータスコード |
エラーコード |
エラーメッセージ |
説明 |
|---|---|---|---|
| 400 | InvalidSourceInstance.NotFound | The specified source instance is not found. | |
| 400 | InvalidName.Malformed | %s | |
| 400 | InvalidDescription.Malformed | %s | |
| 400 | InvalidImageName.Malformed | %s | |
| 400 | InvalidBaseImageType.NotSupportedValue | %s | |
| 400 | InvalidSystemDiskSize.NotSupportedValue | %s | |
| 400 | InvalidInternetMaxBandwidthOut.NotSupportedValue | %s | |
| 400 | InvalidAddAccountSize.ExceededMaxNumber | %s | |
| 400 | InvalidToRegionIdSize.ExceededMaxNumber | %s | |
| 400 | InvalidBuildContent.LengthExceeded | %s | |
| 400 | InvalidImageTemplateCommandSize.ExceededMaxNumber | %s | |
| 400 | DuplicatedCommand.FROM | %s | |
| 400 | InvalidCommandOrder.FROM | %s | |
| 400 | InvalidImageTemplateCommand.NotSupported | %s | |
| 400 | InvalidCommandContent.RUN | %s | |
| 400 | InvalidCommandContent.ENV | %s | |
| 400 | InvalidCommandContent.WORKDIR | %s | |
| 400 | InvalidCommandContent.COPY | %s | |
| 400 | InvalidCommandContent.USER | %s | |
| 400 | InvalidCommandContent.FROM | %s | |
| 400 | InvalidCommandContent.CMD | %s | |
| 400 | InvalidCommandContent.ENTRYPOINT | %s | |
| 400 | QuotaExceed.ImagePipeline | %s. | |
| 400 | NoPermission | %s. | |
| 400 | EmptyCommandContent.LABEL | %s. | |
| 400 | EmptyCommandContent.ENV | %s. | |
| 400 | EmptyCommandContent.ENTRYPOINT | %s. | |
| 400 | EmptyCommandContent.CMD | %s. | |
| 400 | EmptyCommandContent.COPY | %s. | |
| 400 | EmptyCommandContent.WORKDIR | %s. | |
| 400 | NotEmptyCommandContent.RESTART | %s. | |
| 400 | EmptyCommandContent.USER | %s. | |
| 400 | EmptyCommandContent.RUN | %s. | |
| 400 | InvalidImage.OsTypeUnsupported | The specified base image does not support image building. | |
| 400 | InvalidParameter.BuildContent | %s. | |
| 400 | InvalidParameter.TestContent | %s. | |
| 400 | InvalidImageComponent.NotSupported | %s. | |
| 400 | InvalidParameterCombination | %s. | |
| 400 | InvalidParameter.RepairMode | The specified parameter RepairMode is invalid. | |
| 400 | InvalidImageFamily.Malformed | The format of the specified image family is invalid. | |
| 400 | InvalidImage.ImageOwnerAliasUnsupported | The specified base image does not support distributing. | |
| 400 | InvalidParameter.ImportImageOptionsArchitecture | The specified parameter ImportImageOptions.Architecture is invalid. The correct value should be in [%s]. | |
| 400 | InvalidParameter.ImportImageOptionsOSType | The specified parameter ImportImageOptions.OSType is invalid. The correct value should be in [%s]. | |
| 400 | InvalidParameter.ImportImageOptionsBootMode | The specified parameter ImportImageOptions.BootMode is invalid. The correct value should be in [%s]. | |
| 400 | InvalidImportImageOptionsDiskDeviceMappings.LengthLimitExceeded | The length of the specified parameter ImportImageOptions.DiskDeviceMappings exceeds the limit(17). | |
| 400 | InvalidParameter.ImportImageOptionsDiskDeviceMappingsOSSObject | The specified parameter ImportImageOptions.DiskDeviceMappings.OSSObject is invalid. OSSObject supports up to 1023 characters, and cannot start with http:// or https://. | |
| 400 | InvalidParameter.ImportImageOptionsDiskDeviceMappingsOSSBucket | The specified parameter ImportImageOptions.DiskDeviceMappings.OSSBucket is invalid. OSSBucket supports up to 63 characters, only lowercase letters, numbers, and dashes are allowed, and cannot start or end with a dash. | |
| 400 | InvalidParameter.ImportImageOptionsPlatform | The specified parameter ImportImageOptions.Platform is invalid. The correct value should be in [%s]. | |
| 400 | InvalidParameter.ImportImageOptionsLicenseType | The specified parameter ImportImageOptions.LicenseType is invalid. The correct value should be in [%s]. | |
| 400 | InvalidParameter.ImportImageOptionsFeaturesNvmeSupport | The specified parameter ImportImageOptions.Features.NvmeSupport is invalid. The correct value should be in [%s]. | |
| 400 | InvalidParameter.NvmeSupport | The specified parameter NvmeSupport is invalid. The correct value should be in [%s]. | |
| 400 | InvalidParameter.ImportImageOptionsDiskDeviceMappingsFormat | The specified parameter ImportImageOptions.DiskDeviceMappings.Format is invalid. The correct value should be in [%s]. | |
| 400 | InvalidOperation.DiskImageSizeExceeded | The disk size exceeds the limit. Please check the specified parameter ImportImageOptions.DiskDeviceMappings.DiskImageSize and ImportImageOptions.DiskDeviceMappings.OSSObject. Ensure that each of them is between 1 and 2048 in size. | |
| 400 | InvalidImageOptions.Description | The specified parameter ImageOptions.Description is invalid. The length should be between 2 to 256 characters, and cannot start with http:// or https://. | |
| 400 | InvalidImageName.Duplicated | The specified image name is already in use in the target region. Please try a different one. | |
| 400 | InvalidImage.NotSupportRepair | The specified base image does not support repair. | |
| 400 | Duplicate.TagKey | The Tag.N.Key contain duplicate key. | |
| 400 | InvalidTagKey.Malformed | The specified Tag.N.Key is not valid. Tag keys cannot be empty or null, support up to 128 characters, cannot start with "aliyun" or "acs:", and cannot contain "http://" or "https://". | |
| 400 | InvalidTagValue.Malformed | The specified Tag.N.Value is not valid. Tag values support up to 128 characters, and cannot contain "http://" or "https://". | |
| 400 | InvalidAdvancedOptions.ImageNameSuffix | The specified parameter AdvancedOptions.ImageNameSuffix is invalid. The correct value should be in [%s]. | |
| 400 | InvalidImportImageOptions.DockerOptionsImageMalformed | The specified parameter ImportImageOptions.DockerOptions.Image is invalid. The length should be between 1 to 512 characters. | |
| 400 | InvalidImportImageOptions.DockerOptionsImageSizeMalformed | The specified parameter ImportImageOptions.DockerOptions.ImageSize is invalid. The size should be between 1GB to 2048GB. | |
| 403 | ImagePipeline.NotSupportWindowsInstance | Image pipeline does not support windows instance at this time. | |
| 403 | InvalidOSSObject.NotAuthorized | The specified ImportImageOptions.DiskDeviceMappings.OSSObject is not allowed to be accessed. | |
| 403 | InvalidOperation.NoPermissionCreateServiceLinkedRole | You are not authorized to create Service-linked role. The system will automatically create it when the API is called for the first time. Check your RAM policies, and ensure that you are using the correct credentials. | |
| 403 | InvalidOSSObject.NeedRestore | The specified ImportImageOptions.DiskDeviceMappings.OSSObject is an archived object and needs to be restored first. | |
| 403 | InvalidOperation.NoRightAccessOSS | ECS service is not authorized to access your OSS. Check your RAM roles and policies, and ensure that ecs.aliyuncs.com is authorized to assume AliyunECSImageImportDefaultRole. | |
| 403 | InvalidOperation.OSSObjectIsImporting | The specified ImportImageOptions.DiskDeviceMappings.OSSObject is importing. | |
| 404 | InvalidImage.NotFound | %s | |
| 404 | InvalidResourceGroup.NotFound | The ResourceGroup provided does not exist in our records. | |
| 404 | ImageComponent.NotFound | %s. | |
| 404 | InvalidInstanceType.NotFound | The specified instance type does not exist. | |
| 404 | InvalidVSwitchId.NotFound | The specified VSwitchId does not exist. | |
| 404 | InvalidRegionId.NotFound | %s | |
| 404 | InvalidImportImageOptionsDiskDeviceMappingsOSSObject.NotFound | The specified ImportImageOptions.DiskDeviceMappings.OSSObject is not found in this region. | |
| 404 | MissingParameter.RepairMode | The specified parameter RepairMode is missing. | |
| 404 | MissingParameter.ImportImageOptions | The specified parameter ImportImageOptions is missing. | |
| 404 | MissingParameter.ImportImageOptionsDiskDeviceMappingsOSSObject | The specified parameter ImportImageOptions.DiskDeviceMappings.OSSObject is missing. | |
| 404 | MissingParameter.ImportImageOptionsDiskDeviceMappingsOSSBucket | The specified parameter ImportImageOptions.DiskDeviceMappings.OSSBucket is missing. | |
| 404 | MissingParameter.ImageOptionsDiskDeviceMappings | The specified parameter ImportImageOptions.DiskDeviceMappings is missing. | |
| 404 | MissingImportImageOptions.DockerOptions | The specified parameter ImportImageOptions.DockerOptions is missing. | |
| 404 | InvalidOssBucketName.NotFound | The specified parameter OssDeliveryConfig.BucketName does not exist. |
完全なリストについては、「エラーコード」をご参照ください。
変更履歴
完全なリストについては、「変更履歴」をご参照ください。