After creating a custom image, you can export it from the Elastic Compute Service (ECS) console to an Object Storage Service (OSS) bucket. You can then download the image file from the bucket to your computer for analysis and backup. This topic explains how to export a custom image and important considerations during the process.
Prerequisites
-
An OSS bucket is created in the region where the custom image you want to export is located. For more information, see create a bucket in the console.
-
An Alibaba Cloud account and a Resource Access Management (RAM) user must have the necessary permissions to export custom images. For more information, see permissions required to export custom images.
Background information
Limitations
Limitation | Description |
Image format | Custom images that were derived from Alibaba Cloud Marketplace images cannot be exported. |
Operating system | Images that contain Windows Server operating systems cannot be exported. |
Number and capacity of data disks |
|
Notes
Note | Description |
Export fee | Because the exported image files are stored in an OSS bucket, exporting a custom image incurs OSS storage and download traffic fees, along with request fees for each read or write operation on the data. For more information about OSS billing, see OSS billing overview. |
Export duration | The amount of time required to export a custom image varies based on the size of the image files and the number of concurrent export tasks in the queue. |
Exported image files | If an exported custom image contains data disk snapshots, multiple image files are generated and stored in the same OSS bucket. Note Files with system in their names represent system disk snapshots, and files with data in their names represent data disk snapshots. The identifiers of data disk snapshots are the mount points of the source data disks, such as xvdb and xvdc. |
Other |
|
Permissions required to export custom images
-
ECS Access Permissions for OSS Resources
Access Resource Access Management (RAM) with your Alibaba Cloud account to grant ECS the necessary permissions for accessing OSS resources by assuming the
AliyunECSImageExportDefaultRole
role. -
OSS Bucket Operation Permissions
If you are using a RAM user, contact the Alibaba Cloud account owner to grant the RAM user operation permissions on OSS buckets.
-
Create custom policies for a RAM user using an Alibaba Cloud account. For more information, see create custom policies in script edit mode.
-
Grant only read permissions on OSS buckets to a RAM user
To create OSS buckets with an Alibaba Cloud account and use a RAM user to export custom images, you must grant the RAM user read permissions on OSS buckets. Below is an example policy:
{ "Version": "1", "Statement": [ { "Action": [ "oss:GetObject", "oss:GetBucketLocation", "oss:GetBucketInfo" ], "Resource": "*", "Effect": "Allow" } ] }
-
Grant read and write permissions on OSS buckets to a RAM user
To use a RAM user to create OSS buckets and export custom images, you must grant the RAM user read and write permissions on OSS buckets. Below is an example policy:
{ "Version": "1", "Statement": [ { "Action": [ "oss:GetObject", "oss:GetBucketLocation", "oss:GetBucketInfo" "oss:GetObject", "oss:PutObject", "oss:DeleteObject", "oss:GetBucketLocation", "oss:AbortMultipartUpload", "oss:ListMultipartUploads", "oss:ListParts", "oss:GetBucketInfo", "oss:GetBucketUserQos" ], "Resource": "*", "Effect": "Allow" } ] }
-
-
Attach the policy to the RAM user using the Alibaba Cloud account. For more information, see grant permissions to a RAM user. To grant a RAM user read and write permissions on a specific OSS bucket, see tutorial example: use RAM policy to control access to OSS.
-
Procedure
Log on to the ECS console.
In the left-side navigation pane, choose .
-
In the upper-left corner of the menu bar, select a region.
ImportantEnsure the region matches the one where the bucket is located.
-
Optional: Grant ECS access permissions to OSS resources.
When exporting an image for the first time, you must access Resource Access Management (RAM) with your Alibaba Cloud account and grant the necessary ECS permissions for OSS resources by assuming the
AliyunECSImageExportDefaultRole
role. If ECS already has OSS access permissions, this step will be skipped automatically.-
Locate the target image you want to export. In the Actions column, choose .
-
In the Cloud Resource Access Authorization dialog box, you can click Authorize.
-
Locate the
AliyunECSImageImportDefaultRole
andAliyunECSImageExportDefaultRole
roles, then click Agree To Authorize.
-
-
On the Custom Images tab, locate the desired image. In the Actions column, click .
-
In the Export Image dialog box, configure the following parameters:
-
Optional: Choose the format for exporting the image. Supported formats include RAW, VHD, QCOW2, VDI, and VMDK.
Note-
The Set Exported Image Format feature is available only in certain regions, including India (Mumbai) Closed, Japan (Tokyo), Australia (Sydney), and others. In regions where this feature is not supported, images are exported in RAW format by default.
-
Images are exported in RAW format by default in regions where the Set Exported Image Format feature is not available.
-
-
OSS Bucket Address: Choose the OSS bucket located in the same region as your custom image.
-
OSS Object Address: Specify a prefix to name your custom image object.
For instance, specifying Demo as the prefix results in the OSS bucket containing the exported custom image file named Demo-[system-generated file name].
-
-
Click OK to initiate the export of the custom image. The time needed to export a custom image depends on the image file sizes and the current number of export tasks in the queue. You can monitor the progress of the task using the task ID in Task Management, or log on to the OSS console to check the outcome.
Before the task is completed, you can visit Task Management to locate and cancel the export of the custom image in the specified region.
What to do next
Download the custom image to your computer. For more information, see download files.
If you select RAW as the image format when exporting, the exported image file will have a .raw.tar.gz extension by default. After decompression, the file extension will be .raw. For Mac OS X users, GNU Tar is recommended for decompressing the image file.