After you create a custom image, you can export the image file in the Elastic Compute Service (ECS) console to an Object Storage Service (OSS) bucket and then download the image file from the bucket to your on-premises computer to analyze and back up the image. This topic describes how to export a custom image and the items that you must take note of when you export the image.
Prerequisites
OSS is activated. For more information, see the Activate OSS section of the "Get started with OSS" topic.
An OSS bucket is created in the region where the custom image that you want to export resides. For more information, see Create a bucket.
The account that you use is granted permission to export custom images.
If you use an Alibaba Cloud account, go to the Cloud Resource Access Authorization page and click Confirm Authorization Policy to grant ECS the permissions to access OSS resources. By default, ECS uses the
AliyunECSImageExportDefaultRole
role to export images.If you use a Resource Access Management (RAM) user, contact the owner of the corresponding Alibaba Cloud account to grant the RAM user the permissions to access OSS buckets.
Usage notes
Limits
Limit | Description |
Image format and operating system | Due to image copyright restrictions, you cannot export Windows Server custom images or custom images that are derived from Alibaba Cloud Marketplace images. |
Number and capacity of data disks | The capacity of each data disk cannot exceed 2,048 GiB. Note If the capacity of a data disk exceeds 2,048 GiB, distribute data from the disk to multiple data disks that are less than 2,048 GiB in size, create a custom image by using the smaller data disks, and then export the custom image. |
Encrypted image | You cannot export encrypted images.
|
Considerations
Consideration | Description |
Export fee | Exported image files are stored in OSS buckets. You are charged for the storage of the files in the buckets and data transfers that occur when you download the files from the buckets. For information about OSS billing, see Billing overview. |
Export duration | The amount of time that is 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 file | If an exported custom image contains data disk snapshots, multiple image files are generated and stored in the same OSS bucket. Note Files whose names contain system are system disk snapshots. Files whose names contain data are data disk snapshots. The identifiers of data disk snapshots are the mount points of the source data disks, such as xvdb and xvdc. |
Other |
|
Procedure
Log on to the ECS console.
In the left-side navigation pane, choose .
In the top navigation bar, select the region and resource group to which the resource belongs.
On the Custom Images tab, find the custom image that you want to export. In the Actions column, click Export Image.
In the Make Preparations step, check whether the custom image meets the image export requirements and click Next.
(Conditionally required) Grant ECS the permissions to access OSS resources.
The first time you export a custom image, if you did not grant ECS the access permissions on OSS resources, you can grant ECS the corresponding permissions in the Export Image dialog box.
In the Export Image Files to OSS section, click AliyunECSImageExportDefaultRole.
On the Cloud Resource Access Authorization page, verify that the
AliyunECSImageExportDefaultRole
role is displayed and click Confirm Authorization Policy.NoteThe system automatically creates the
AliyunECSImageExportDefaultRole
role and grants the role permissions.
In the Export Image dialog box, click Next.
Click Continue.
In the Export Image File step, configure the following parameters:
Image Format: Select the format in which you want to export the custom image. Valid values: Auto-detect, RAW, VHD, QCOW2, VDI, and VMDK. If you do not have requirements for the image format, select Auto-detect.
OSS Bucket (OSS Bucket): Select an OSS bucket that resides in the same region as the custom image.
Image File Name Prefix: Enter a prefix for the names of the exported image files. For example, if you enter Demo in this field, the name of each exported image file in the specified OSS bucket is Demo-[Automatically generated object name].
After you confirm the information, click OK to export the custom image.
(Optional) During image export, you can view the progress of the export task or cancel the export task in the destination region.
View the export task
You can go to the Task Management page or log on to the OSS console to view the progress of the export task.
NoteThe 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.
An export task may fail when you export a custom image. You can perform the following steps to identify and resolve the issue:
View the error code that corresponds to the issue on the Task Management page in the ECS console or by calling the DescribetaskAttribute operation.
View the error code details and resolve the issue based on the corresponding solutions described in the following table.
Error code
Cause
Cause identification
Suggestion
IMAGE_ALREADY_EXIST
An image file (object) with the same name as the image file that you want to export exists in the OSS bucket.
Check whether an image file (object) with the same name as the image file that you want to export exists in the OSS bucket.
Export the image file that you want to export to another OSS bucket.
Change the name of the image file that you want to export and try again.
Cancel the export task
Before the export task is completed, you can find the task in the corresponding region on the Task Management page and cancel the task.
In the left-side navigation pane, choose .
Find the task that you want to cancel and click Cancel in the Actions column.
What to do next
Download the exported image file to your on-premises computer. For more information, see Simple download.
If you selected the RAW format when you exported the custom image, the default name extension of the exported image file is .raw.tar.gz and the name extension of the decompressed image files is .raw. If your computer runs Mac OS X, we recommend that you use GNU Tar to decompress the image file.