You need to enable JavaScript to run this app.
文档中心
云服务器

云服务器

复制全文
下载 pdf
镜像
ImportImage - 导入镜像
复制全文
下载 pdf
ImportImage - 导入镜像
调用 ImportImage 接口,将本地镜像文件导入火山引擎,该镜像将作为自定义镜像展示在相应地域中。​
注意事项​
  • 每个地域下最多支持50个自定义镜像。​
请求说明​
您可以使用导入的镜像创建ECS实例(RunInstances),或者更换实例的系统盘(ReplaceSystemDisk)。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action string 必选 示例值:ImportImage​
要执行的操作,取值:ImportImage。​
​
Version string 必选 示例值:2020-04-01​
API的版本,取值:2020-04-01。​
​
Architecture string 可选 示例值:amd64​
镜像的架构类型。取值:​
  • amd64:x86计算​
  • arm64:ARM计算​
​
BootMode string 可选 示例值:UEFI​
镜像的启动模式。取值:​
  • BIOS(默认):BIOS启动模式​
  • UEFI:UEFI启动模式​
说明​
  • 弹性裸金属型规格的云服务器,仅支持UEFI启动模式。​
  • 如果Architecture=arm64,则默认值为UEFI,且只能设置为UEFI。​
​
Description string 可选 示例值:This is my first image​
镜像描述。​
  • 必须以字母、汉字开头。​
  • 只能包含中文,字母,数字,下划线“_”,中划线“-”,等号“=”,英文逗号“,”和英文句号“.”,中文逗号“,”和中文句号“。”和空格。​
  • 长度限制为0 ~ 255个字符。​
  • 不填默认为空。​
​
ImageName string 必选 示例值:image-1​
镜像名称。​
  • 必须以字母、汉字开头。​
  • 只能包含中文,字母,数字,下划线“_”,中划线“-”,英文句号“.”。​
  • 长度限制为1 ~ 128个字符。​
​
ImportDataVolumes.N.DataVolumeUrl string[] 可选 示例值:ImportDataVolumes.1.DataVolumeUrl=https://example.tos-cn-beijing.com/data1.qcow2&ImportDataVolumes.2.DataVolumeUrl=https://example.tos-cn-beijing.com/data2.qcow2​
自定义镜像包含的数据盘文件,在TOS存储桶的Url链接。​
  • 参数 - N:表示数据盘Url序号,取值范围1 ~ 15。​
  • 多个数据盘Url之间用&分隔。​
说明​
请将自定义镜像文件上传至TOS存储桶获取链接,详情可查看导入自定义镜像。​
​
LicenseType string 可选 示例值:Volcengine​
镜像许可证类型。取值:​
  • VolcanoEngine:默认,根据您设置的platform,采用火山引擎官方渠道的许可证。​
  • BYOL:自带许可证(BYOL)。​
说明​
  • 使用自带许可证(BYOL)时,请确保您的许可证密钥支持在火山引擎使用。​
  • 本参数仅在导入商业镜像(如Windows Server)时生效,否则不生效。​
​
NeedDetection boolean 可选 示例值:true​
是否进行镜像检测。取值:​
  • true:默认值,进行检测。​
  • false:不进行检测。​
​
OsType string 可选 示例值:Linux​
操作系统类型。取值:​
  • Linux​
  • Windows​
说明​
若为空,火山引擎会根据您传入的Platform值确认OsType。​
​
Platform string 必选 示例值:CentOS​
镜像操作系统的发行版本。取值:​
  • CentOS​
  • Debian​
  • veLinux​
  • Windows Server​
  • Fedora​
  • OpenSUSE​
  • Ubuntu​
  • Rocky Linux​
  • AlmaLinux​
​
PlatformVersion string 可选 示例值:7.6​
镜像的发行版本。最大长度为100个字符。​
​
ProjectName string 可选 示例值:default​
资源所属项目。​
​
Tags.N.Key string[] 可选 示例值:Tags.1.Key=image-tag-key-1&Tags.2.Key=image-tag-key-2​
镜像标签的标签键。​
  • 参数 - N:表示标签键的序号,取值范围:1~20。​
  • 多个标签键之间用&分隔。​
说明​
  • 命名规则如下:​
  • 不能以volc:、sys:的任意大小写组合开头。​
  • 只能包含语言字符、数字、空格和英文符号“_”、“.”、“:”、“/”、“=”、“+”、“-”、“@”。​
  • 长度限制在1~128个字符之间。​
  • 同一资源的标签键不允许重复。​
​
Tags.N.Value string[] 可选 示例值:Tags.1.Value=image-tag-value-1&Tags.2.Value=image-tag-value-2​
镜像标签的标签值。​
  • 参数 - N:表示标签值的序号,取值范围:1~20。​
  • 多个标签值之间用&分隔。​
说明​
  • 命名规则如下:​
  • 只能包含语言字符、数字、空格和英文符号“_”、“.”、“:”、“/”、“=”、“+”、“-”、“@”。​
  • 允许为空,长度限制在0~256个字符之间。​
  • 如果传入该参数,则必须先传入Tags.N.Key。​
​
Url string 必选 示例值:https://example.tos-cn-beijing.com/centos.qcow2​
自定义镜像包含的系统盘文件,在TOS存储桶的Url链接。​
说明​
请将自定义镜像文件上传至TOS存储桶获取链接,详情可查看导入自定义镜像。​
​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
ImageId string 示例值:image-ebgy1og99tfct0gw****​
镜像ID。​
​
​
​
请求示例​
​
GET /?Action=ImportImage&Version=2020-04-01&ImageName=image-1&OsType=Linux&Platform=CentOS&PlatformVersion=7.6&Architecture=amd64&Url=xxx HTTP/1.1​
Host: ecs.cn-beijing.volcengineapi.com​
Region: cn-beijing​
Service: ecs​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "202106111445100102252431000052****",​
"Action": "ImportImage",​
"Version": "2020-04-01",​
"Service": "ecs",​
"Region": "cn-beijing"​
},​
"Result": {​
"ImageId": "image-ebgy1og99tfct0gw****"​
}​
}​
​
错误码​
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。​
​
状态码​
错误码​
错误信息​
说明​
400​
InvalidArchitecture.Malformed​
The specified Architecture is malformed.​
指定的镜像架构类型不合法。​
400​
InvalidBootMode.Malformed​
The specified BootMode is malformed.​
指定的启动方式不合法。​
400​
InvalidDescription.Malformed​
The specified Description is malformed.​
指定的描述不合法。​
400​
InvalidImageFormat.Malformed​
The specified image format is malformed.​
指定的镜像格式不合法。​
400​
InvalidImageName.Malformed​
The specified ImageName is malformed.​
指定的镜像名称不合法。​
400​
InvalidLicenseType.Malformed​
The specified LicenseType is malformed.​
指定的许可证类型不合法。​
400​
InvalidOsType.Malformed​
The specified OsType is malformed.​
指定的操作系统不合法。​
400​
InvalidPlatformForDetect.UnSupported​
The specified image platform cannot be used for detect.​
指定的镜像平台不支持检测。​
400​
InvalidPlatformForImportImage.Unsupported​
The specified Platform cannot be used for ImportImage.​
指定的镜像操作系统发行版不支持导入。​
400​
InvalidPlatformVersion.Malformed​
The specified PlatformVersion is malformed.​
指定的PlatformVersion不合法。​
400​
InvalidTagKey.Malformed​
The specified TagKey is malformed.​
指定的标签的键不合法。​
400​
InvalidTagValue.Malformed​
The specified TagValue is malformed.​
指定的标签的值不合法。​
400​
InvalidTosGetObject.AccessDenied​
The Action tos:GetObject is not authorized for ecs, please check your IAM policy of ecs.​
tos:GetObject未授权给ecs,请检查您的ecs IAM策略。​
400​
InvalidUrl.Malformed​
The specified URL is malformed.​
指定的Url不合法。​
400​
LimitExceeded.MaximumImageCount​
You've reached the limit on the number of image that you can create.​
可创建的自定义镜像个数超过限制。​
400​
LimitExceeded.MaximumImageSize​
The specified image size exceeds the limit.​
指定的镜像大小超过限制。​
400​
LimitExceeded.MaximumImportDataVolumes​
The number of specified ImportDataVolumes exceeds the maximum limit.​
指定的ImportDataVolumes超过最大限制。​
400​
LimitExceeded.MaximumTags​
You've reached the limit on the number of tags that you can create.​
指定的标签数量超过最大限制。​
400​
MissingParameter.ImageName​
The required parameter ImageName is not supplied.​
镜像名称不能为空。​
400​
MissingParameter.Platform​
The required parameter Platform is not supplied.​
指定的的操作系统发行版不能为空。​
404​
InvalidProject.NotFound​
The specified Project does not exist.​
指定的Project不存在。​
404​
InvalidTOSObject.NotFound​
The specified TOSObject does not exist.​
指定的TOSObject不存在。​
409​
InvalidTagKey.Conflict​
The specified TagKey already exists.​
指定的标签键已存在。​
412​
OperationDenied.SnapshotServiceUnavailable​
The specified operation is denied as Snapshot service is unavailable.​
指定的操作被拒绝,因为快照服务未开通。​
500​
InternalError​
An internal error has occurred.​
内部错误,请重试。如果多次尝试失败,请提交工单。​
​
​
最近更新时间:2026.05.20 10:28:55
这个页面对您有帮助吗?
有用
有用
无用
无用