Home  >  Article  >  Operation and Maintenance  >  How to export a custom image to an OSS Bucket in the same region as the custom image

How to export a custom image to an OSS Bucket in the same region as the custom image

坏嘻嘻
坏嘻嘻Original
2018-09-21 14:51:532784browse

This article introduces how to export a custom image to an OSS Bucket in the same region as the custom image, and focuses on the specific steps. The content of this article is compact, and I hope you can gain something from it.

ExportImage

Export your custom image to the OSS Bucket in the same region as the custom image.

Description

Exporting custom images created using system disk snapshots of market images is not supported.

Supports exporting custom images that include data disk snapshot information. The number of data disks cannot exceed 4, and the maximum capacity of a single data disk cannot exceed 500 GB.

You need to submit a work order and contact Alibaba Cloud to enable the export image function for you.

You need to authorize the cloud server ECS official service account to write OSS permissions through RAM:

Create role: AliyunECSImageExportDefaultRole (any other role name is invalid), set the following role policy for this role:

 {
   "Statement": [
     {
       "Action": "sts:AssumeRole",
       "Effect": "Allow",
       "Principal": {
         "Service": [
           "ecs.aliyuncs.com"
         ]
       }
     }
   ],
   "Version": "1"
 }

Add the default system permission policy: AliyunECSImageExportRolePolicy under the role AliyunECSImageExportDefaultRole. This policy is the default policy for exporting images provided by cloud server ECS. Users can also create custom policies. The permissions need to include:

 {
   "Version": "1",
   "Statement": [
     {
       "Action": [
         "oss:GetObject",
         "oss:PutObject",
         "oss:DeleteObject",
         "oss:GetBucketLocation",
         "oss:AbortMultipartUpload",
         "oss:ListMultipartUploads",
         "oss:ListParts"
       ],
       "Resource": "*",
       "Effect": "Allow"
     }
   ]
 }

Request parameters

How to export a custom image to an OSS Bucket in the same region as the custom image

Return parameters

How to export a custom image to an OSS Bucket in the same region as the custom image

Example

Request Example

https://ecs.aliyuncs.com/?Action=ExportImage
&RegionId=cn-hangzhou
&ImageId=m-231234567
&OssBucket=testexportImage
&<公共请求参数>

Return example

XML format

<ExportImageResponse>
    <RequestId>C8B26B44-0189-443E-9816-D951F59623A9</RequestId>
    <ExportTaskId>tsk-231234567</ExportTaskId>
    <RegionId>cn-hangzhou</RegionId>
</ExportImageResponse>

JSON format

{
    "RequestId": "C8B26B44-0189-443E-9816-D951F59623A9",
    "RegionId": "cn-hangzhou",
    "ExportTaskId": "tsk-231234567"
}

Error code

The following are error codes unique to this interface. For more error codes, please visit the API Error Center.

How to export a custom image to an OSS Bucket in the same region as the custom image

How to export a custom image to an OSS Bucket in the same region as the custom image

The above is the detailed content of How to export a custom image to an OSS Bucket in the same region as the custom image. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn