CopyImage_云服务器 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.

接口说明

您可以在其他地域使用复制后的镜像创建 ECS 实例(RunInstances),或者更换实例的系统盘(ReplaceSystemDisk)。

调用该接口时,您需要注意:

  • 自定义镜像的状态必须为可用(Available)。
  • 镜像是您账号下的自定义镜像时,可以跨地域复制镜像;镜像是其他人共享给您的镜像时,只能同地域复制镜像。
  • 复制镜像期间,您无法直接操作删除( DeleteImage )复制中的镜像,但是您可以通过取消复制任务( CancelCopyImage )的方式来删除复制中的镜像。
  • 同一个地域下同时只能有五个镜像复制任务运行,其余任务需要排队等待上述任一任务完成后再依次排队执行。
  • 您可以通过ResourceGroupId参数指定复制后的镜像所属的资源组。如果不设置ResourceGroupId参数值,复制后的镜像属于默认资源组。

流控信息

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

授权信息

如下是此API对应的授权信息,用于RAM权限策略语句的Action元素中,为RAM用户或RAM角色授予调用此API的权限。请通过 RAM 访问控制设置,使用方法可参考访问控制帮助文档

具体说明如下:展开详情

操作访问级别资源类型条件关键字关联操作
ecs:CopyImage
Update
Image
acs:ecs:{#regionId}:{#accountId}:image/*

请求参数

字段名称字段详情
DestinationImageNamestring

复制后的镜像的名称。长度为 2~128 个字符。必须以大小写字母或中文开头,也不能以aliyunacs:开头,不能包含http://或者https://。可以包含数字、半角句号(.)、半角冒号(:)、下划线(_)或者短划线(-)。

示例值:YourImageName
DestinationDescriptionstring

复制后的镜像的描述信息。长度为 2~256 个英文或中文字符,不能以http://https://开头。

示例值:This is a description example.
ImageIdstring

源自定义镜像的 ID。

示例值:m-bp1h46wfpjsjastc****参考取值来源:
    ImportImage
    CreateImage
    ExportImage
    DescribeImages
RegionIdstring

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

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

复制到目标地域的 ID。

示例值:cn-shanghai
Encryptedboolean

是否加密复制后的镜像。展开详情

示例值:false
KMSKeyIdstring

加密镜像使用的密钥 ID。

示例值:e522b26d-abf6-4e0d-b5da-04b7******3c参考取值来源:
    DescribeDiskDefaultKMSKeyId
字符长度 <= 64
EncryptAlgorithmstring
说明 该参数暂未开放使用。
示例值:hide
ResourceGroupIdstring

复制后的镜像的资源组 ID。如果不设置该参数值,复制后的镜像属于默认资源组。展开详情

示例值:rg-bp67acfmxazb4p****参考取值来源:
    DescribeSecurityGroups
Tagarray<object>

标签列表。

子级条数 <= 20

返回参数

字段名称字段详情
ImageIdstring

复制后的镜像的 ID。

示例值:m-bp1h46wfpjsjastd****
RequestIdstring

请求 ID。

示例值:473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

返回示例

错误返回示例

错误码

全局错误码
HTTP 状态码错误码错误信息操作
400
InvalidDescription.Malformed
The specified destination description is wrongly formed.诊断
400
SourceRegion.NotFound
The source region not found.诊断
400
DestinationRegion.NotFound
The destination region not found.诊断
400
IncorrectImageStatus
The image not available.诊断
400
InvalidSnapshotId.NotFound
The specified SnapshotId does not exist.诊断
400
InvalidImageName.Duplicated
The specified image name is already in use in the target region. Please try a different one.诊断
400
InvalidParameter.EncryptedIllegal
The specified parameter Encrypted must be true when kmsKeyId is not empty.诊断
400
InvalidEncrypted.NotMatchEncryptAlgorithm
The specified parameter Encrypted must be true when EncryptAlgorithm is not empty.诊断
400
InvalidEncryptAlgorithm
The specified parameter EncryptAlgorithm is not valid.诊断
400
InvalidEncrypted.NotMatchKmsKeyId
The specified parameter Encrypted must be true when KmsKeyId is not empty.诊断
400
OperationDenied.CommunityImage
Community image does not support copy.诊断
400
InvalidImageName.Malformed
The specified destination image name is wrongly formed.诊断
400
InvalidParameter.KmsNotEnabled
The specified operation need enable KMS.诊断
400
OperationDenied.ImageCopyConflict
The same image cannot be copied concurrently. Please wait until the last copy is completed before performing the next operation.诊断
400
Account.Arrearage
Your account has an outstanding payment.诊断
401
InvalidAliUid.IsNull
The aliUid must not be null.诊断
403
Forbbiden
User not authorized to operate on the specified resource.诊断
403
QuotaExceed.Image
The number of images exceeds the limit (%s).诊断
403
QuotaExceed.Snapshot
The snapshot quota exceeds.诊断
403
OperationDenied.ImageCopying
The image is currently being copied. Please try again later.诊断
403
RegionNotSupportCopy
The region not support copy.诊断
403
InvalidSnapshot.TooOld
This operation is denied because the specified snapshot is created before 2013-07-15.诊断
403
OperationDenied
The specified snapshot is not allowed to create image.诊断
403
IncorrectDestinationRegion
The destination region is not equal the target region.诊断
403
OperationDeined.EncryptedSnapshot
The image contains encrypted snapshots, which do not support copying.诊断
403
OperationDenied.SameRegionOnly
The image shared from others can not be copied to another region directly.诊断
403
OperationDenied.NotPublished
The operation is denied because corresponding marketplace image is not published in destination region.诊断
403
OperationDenied.NotAuthorized
The operation is denied because corresponding marketplace image is not authorized to current user.诊断
403
OperationDenied.EncryptSnapshotAcrossRegion
The image do not contain encrypted snapshots, which do not support copying to encrypted ones.诊断
403
InvalidParameter.KMSKeyId.CMKNotEnabled
The CMK needs to be enabled.诊断
403
InvalidParameter.KMSKeyId.KMSUnauthorized
ECS service have no right to access your KMS.诊断
403
InvalidRegion.NotSupport
The specified region does not support byok.诊断
403
UserNotInTheWhiteList
The user is not in byok white list.诊断
403
InvalidRegionId.NotSupportEncryptAlgorithm
The current region does not support creating encrypted disks with EncryptAlgorithm.诊断
403
OperationDenied.KmsServiceUnauthorized
The account is not authorized to kms service, please authorize it.诊断
403
OperationDenied.NonCompliantDestinationRegion
The copy operation to the destination region is not in compliance with regulations.诊断
403
InvalidEncrypted.NotMatchDiskDefaultEncryption
The specified parameter Encrypted not match for your account default encryption settings.诊断
403
InvalidParameter.DataEncryptedKeyCreateFailed
Create kms data encrypted key fail. If you need further assistance, you can contact the KMS Technical Support.诊断
403
SizeExceed.Image
The image exceeds the maximum size. You can use the CopySnapshot API to copy your snapshots of the image and then create a new image from them.诊断
404
InvalidImageId.NotFound
The specified ImageId does not exist.诊断
404
InvalidParameter.KMSKeyId.NotFound
The specified KMSKeyId does not exist.诊断
404
InvalidResourceGroup.NotFound
The ResourceGroup provided does not exist in our records.诊断
500
InternalError
The request processing has failed due to some unknown error, exception or failure.诊断

变更历史

变更时间变更内容概要操作
2025-02-27
变更错误码400
变更错误码403
2025-01-16
变更错误码400
2024-12-19
变更错误码403
2024-12-11
变更错误码400
2024-12-09
变更错误码403
2024-09-05
变更错误码403
2024-06-27
变更请求参数KMSKeyId
2023-12-18
变更错误码403
  • 1
  • 2
  • 10 条/页

相关示例

2024年08月20日