After you create a custom image, you can export the image file to an Object Storage Service (OSS) bucket in the same region. You can then download the image file from the OSS bucket to your local machine for analysis or backup. This topic describes the procedure and precautions for exporting a custom image.
Prerequisites
OSS is activated. For more information, see Get started with OSS.
An OSS bucket has been created in the same region as the custom image. For more information, see Create a bucket.
ECS has the required permissions to access OSS resources. ECS obtains these permissions by assuming the
AliyunECSImageExportDefaultRole
role.
Usage notes
Conditions
Limitations | Description |
Image format and operating system | Due to image copyright restrictions, you cannot export custom images created from Alibaba Cloud Marketplace images. You also cannot export images of Windows Server operating systems. |
Number and capacity of data disks | The capacity of a single data disk cannot exceed 2 TiB. How can I export a custom image if a single data disk is larger than 2 TiB? |
Encrypted image | Encrypted images cannot be exported.
|
Precautions
Item | Description |
Export fees | When you export an image file, it is stored in an OSS bucket. This incurs the following fees:
|
Export duration | The time required to export an image depends on the size of the custom image file and the number of concurrent export tasks. Please wait. |
Exported image file | If the exported custom image contains data disk snapshots, multiple files appear in your OSS bucket. Note File names that contain system indicate system disk snapshots. File names that contain data indicate data disk snapshots. Data disk snapshots have an identifier that corresponds to the data disk, such as the mount target xvdb or xvdc. |
Other items |
|
Procedure
Go to ECS console - Images.
In the top navigation bar, select the region and resource group of the resource that you want to manage.
On the Custom Images tab, find the custom image and click Export Image in the Actions column.
Review the information in the Export Preparations section and click Next. Confirm that you meet the prerequisites and click Continue Export.
Configure the parameters for Export Image File.
Image Format: The default value is Auto-detect. You can also select a format for the exported image. The supported formats are RAW, VHD, QCOW2, VDI, and VMDK.
NoteThe feature to set the image export format is available only in some regions. The supported regions are Japan (Tokyo), Indonesia (Jakarta), Germany (Frankfurt), UAE (Dubai), US (Virginia), UK (London), Singapore, Malaysia (Kuala Lumpur), and US (Silicon Valley).
Exporting an image file accesses the OSS API and incurs OSS request fees. The number of read operations and the fees incurred vary based on the format. To reduce costs, select the VHD format, which requires fewer read operations.
In regions where the image format cannot be set, images are exported in RAW format by default.
Image Storage (OSS Bucket): Select an OSS bucket that is in the same region as the custom image.
NoteYou can select only OSS buckets of the Standard or Infrequent Access storage class. OSS buckets of the Archive storage class are not supported.
Image File Name Prefix: Specify a prefix for the object name of the custom image.
For example, if you set the prefix to Demo, the name of the exported custom image file in the OSS bucket is Demo-[System-generated file name].
Click Confirm Export to start exporting the custom image.
The time required for the export depends on the size of the image file and the number of tasks in the export queue. You can check the task progress using the task ID on the Task Management page or log on to the OSS console to view the result.
Before the task is complete, you can find the export task on the Task Management page of the destination region and cancel the task.
What to do next
You can download the image file from the OSS bucket to your local machine. For more information, see Simple download.
If you select RAW as the image format for the export, the exported image file has the .raw.tar.gz file name extension. After you decompress the file, its extension is .raw. If you use Mac OS X, you must use the gnu-tar tool to decompress the file.
FAQ
How do I fix a failed image export?
If an image export task fails, you can identify and resolve the issue by performing the following steps.
Check the error code on the Task Management page or by calling the DescribeTaskAttribute API operation.
Identify the issue based on the error code and resolve it.
Error code
Cause
Troubleshooting
Solution
IMAGE_ALREADY_EXIST
A file (Object) with the same name exists in the OSS bucket.
Check whether a file (Object) with the same name exists in the destination OSS bucket.
Change the destination OSS bucket.
Change the name of the exported image file and try to export again.