ExportImage_云服务器 ECS_API文档

插件下载了解更多
VS Code 插件
安装插件之前,确保已安装 VS Code安装插件之前,确保已安装 VS Code
Alibaba Cloud Developer Toolkit is a collection of extensions that can help access Alibaba Cloud services in Visual Studio Code.
JetBrains 插件
安装插件之前,确保已安装 JetBrains IDE安装插件之前,确保已安装 JetBrains IDE
The Alibaba Cloud Developer Toolkit for JetBrains makes it easier to access Alibaba Cloud services.

接口说明

导出镜像前:

  • 您需要先了解前提条件以及注意事项。更多信息,请参见导出镜像

  • 设置参数ImageFormat镜像导出格式功能仅在部分地域可用,支持的地域有日本(东京)、印度尼西亚(雅加达)、德国(法兰克福)、阿联酋(迪拜)、美国(弗吉尼亚)、英国(伦敦)、新加坡、马来西亚(吉隆坡)和美国(硅谷)。不支持设置镜像格式的地域,默认导出 RAW 格式的镜像。

  • 您必须通过 RAM 授权云服务器 ECS 写入 OSS 的权限。具体操作说明如下:

    • 创建角色:AliyunECSImageExportDefaultRole(其他任何角色名称无效),为该角色设置以下角色策略:
         {
           "Statement": [
             {
               "Action": "sts:AssumeRole",
               "Effect": "Allow",
               "Principal": {
                 "Service": [
                   "ecs.aliyuncs.com"
                 ]
               }
             }
           ],
           "Version": "1"
         }
      
    • 在角色AliyunECSImageExportDefaultRole下加入默认的系统权限策略:AliyunECSImageExportRolePolicy,该策略是云服务器 ECS 提供导出镜像的默认策略。更多详情,请参见云资源访问授权。您也可以创建自定义策略,权限需要包含:
           {
             "Version": "1",
             "Statement": [
               {
                 "Action": [
                   "oss:GetObject",
                   "oss:PutObject",
                   "oss:DeleteObject",
                   "oss:GetBucketLocation",
                   "oss:GetBucketInfo",
                   "oss:AbortMultipartUpload",
                   "oss:ListMultipartUploads",
                   "oss:ListParts"
                 ],
                 "Resource": "*",
                 "Effect": "Allow"
               }
             ]
           }
      

导出镜像后:

自定义镜像将保存在指定的 OSS bucket 中,您可以下载自定义镜像。具体操作,请参见下载自定义镜像文件

流控信息

请求速率为1000/60(s)。更多流控信息,请前往配额中心查看

授权信息

当前云产品暂无权限信息透出。

请求参数

字段名称字段详情
RegionIdstring

自定义镜像的地域 ID。您可以调用 DescribeRegions 查看最新的阿里云地域列表。

示例值:cn-hangzhou参考取值来源:
    DescribeRegions
ImageIdstring

自定义镜像 ID。

示例值:m-bp67acfmxazb4p****参考取值来源:
    ImportImage
    CopyImage
    CreateImage
    DescribeImages
OSSBucketstring

保存导出镜像的 OSS bucket。

示例值:testexportImage
OSSPrefixstring

您的 OSS Object 的前缀。可以由数字或者字母组成,字符长度为 1~30。

示例值:EcsExport
ImageFormatstring

镜像文件的导出格式。取值范围:展开详情

示例值:raw
RoleNamestring

导出镜像时使用的 RAM 角色名称。

示例值:AliyunECSImageExportDefaultRole参考取值来源:
    AttachInstanceRamRole
    DetachInstanceRamRole
    DescribeInstanceRamRole

返回参数

字段名称字段详情
RequestIdstring

请求 ID。

示例值:C8B26B44-0189-443E-9816-D951F596****
TaskIdstring

导出镜像任务 ID。

示例值:tsk-bp67acfmxazb4p****
RegionIdstring

地域 ID。

示例值: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.诊断
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.诊断
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.诊断

变更历史

变更时间变更内容概要操作
2025-02-27
变更错误码403
2023-05-26
变更错误码403

相关示例