全部文档
当前文档

暂无内容

如果没有找到您期望的内容,请尝试其他搜索词

文档中心

创建镜像

请求参数

以下请求参数列表仅列出了接口请求参数和部分公共参数,完整公共参数列表见公共请求参数
参数名称
类型
必填
描述
Action String
公共参数,本接口取值:CreateImage。
Version String
公共参数,本接口取值:2016-03-04。
InstanceId String

待创建镜像的实例ID。 标准UUID格式,形如^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

Name String

新镜像的名称。 2-64个字符,支持中文、字母、数字以及-_@#.字符

Type String

自定义镜像类型,分为本地镜像和普通镜像。 LocalImage 和 CommonImage

DataDiskIds.N String

实例需要制作镜像的数据盘ID。 标准UUID格式,形如[1]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

SnapshotIds.N String

实例需要制作镜像的快照ID,里面必须包含一个系统盘快照ID。 标准UUID格式,形如[2]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

InstantAccess Boolean

支持快速开盘/快速变更,该参数仅对本地盘/本地盘机型/本地盘快照生效

返回参数

参数名称
类型
描述
RequestId String

请求ID。

示例值:7a6fa859-85e6-40ba-95d2-69deb5e43b6a
ImageId String

新创建的镜像ID。

示例值:标准UUID格式,形如^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

请求示例

curl -X GET|POST
'http://kec.api.ksyun.com/?Action=CreateImage&Version=2016-03-04'
-H 'authorization: xxx, SignedHeaders=content-type;host;x-amz-date, Signature=xxx'
-H 'cache-control: no-cache'
-H 'content-type: application/x-www-form-urlencoded'
-H 'host: kec.api.ksyun.com'
-H 'x-amz-date: 20170720T022802Z'
-d 'InstanceId=xxx&Name=xxx&Type=xxx&DataDiskIds.N=xxx&SnapshotIds.N=xxx&InstantAccess=xxx'

返回示例

JSON格式

{
"RequestId":"7a6fa859-85e6-40ba-95d2-69deb5e43b6a",
"ImageId":"15754278-6194-4b29-a3cd-677182c69b77"
}

错误码

以下仅列出了接口业务逻辑相关的错误码,其他错误码详见公共错误码

错误码
错误信息
Http状态码
描述
SnapshotIdContainVariedTypeSystem disk and data disk snapshot types must be the same.400系统盘与数据盘快照类型需一致
OnlySupportSSD3CreateImageOnly the system disk and data disk type SSD3.0 can be used to make a local image.400仅支持使用系统盘和数据盘类型为ssd3.0的盘制作本地镜像
VolumeIdInvalidParameterValueAn invalid or out-of-range value was supplied for the "VolumeId" parameter.400磁盘ID参数的取值无效或者超出有效范围
SnapshotFromDifferentAvailableZoneLocal snapshots come from different zones.400本地快照来自不同的可用区
DataDiskTypeInvalidAn invalid or out-of-range value was supplied for the "DataDisk.Type" parameter.400“数据盘类型”参数的取值无效或者超出有效范围.
OnlyUsingInstanceToCreateImageSupportInstantAccessModeOnly using instance to create image support instant access mode400仅实例制作镜像支持开启快速开盘模式
ProductTypeNotSupportAssembledImageThe ProductType of instance is not supported assembledImage.400实例商品类型不支持整机镜像.
SystemDiskTypeInvalidAn invalid or out-of-range value was supplied for the "SystemDisk.DiskType" parameter.400“系统盘类型”参数的取值无效或者超出有效范围.
InstanceIdInvalidInstance Resource id is invalid400实例资源ID无效
SnapshotCountErrorSnapshot count is Error.400快照数量错误
SnapshotEntryedInvalidParameterValue暂无400被加密的磁盘和快照不允许创建整机镜像
OnlyReservePreMigratedSupportInstantAccessModeInstance under to be modifed status does not support instant access mode400待变更状态的实例不支持开启快速开盘模式
InstanceStateNotSupportedMigrateThe current status of the resource does not support this operation.400本操作执行时“实例状态”不支持
InstanceStateNotSupportCreateImageInstance State Not Support Create Image.400实例状态不支持创建整机镜像
SnapshotIdInvalidParameterValueSnapshot id is invalid400磁盘镜像ID无效
StatusNotSupportImageThe current status of instance does not support creating image.400实例该状态不支持制作镜像
OnlyLocalDiskSupportInstantAccessModeWhenCreatingImageOnly local data disk support instant access mode when creating image400创建镜像时仅本地数据盘支持快速开机模式
ImageRepeatParameterCreate Image have Repeat Parameter.400制作镜像时使用了多种传参方式
SystemDiskTypeNotSupportCreateLocalImageThis instance does not support creating local images.400本实例不支持创建本地镜像
CreateImageContainDataDiskSnapshotsInReservePreMigratedStatusInstance under the status of to be modifed cannot create image containing datadisk snapshots400待变更状态实例不支持制作含数据盘的镜像
InternalError400 BAD_REQUEST : : "{\"message\": \"Instance d07b869d-e8ef-43f7-920a-0f255a692e3c isn\u0027t active or shutoff\u003cbr /\u003e\u003cbr /\u003e\\n\\n\\n\", \"code\": \"400 Bad Request\", \"title\": \"Bad Request\"}"400
纯净模式常规模式

纯净模式

点击可全屏预览文档内容