All Products
Search
Document Center

Elastic Compute Service:Export a custom image

Last Updated:Aug 07, 2025

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.

    image

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?
  1. Create a pay-as-you-go ECS instance from the custom image. For more information, see Create an instance from a custom image.

  2. Remotely log on to the created ECS instance and run the df -h command to view the actual capacity of the data disk. Based on the actual capacity, create and attach the required number of new data disks. Then, copy the data from the original data disk to the new data disks. For more information, see Create an empty data disk and Attach a data disk.

  3. Create snapshots of the new data disks and the system disk. For more information, see Create a snapshot.

  4. Create a new custom image from the snapshots, and then export the new custom image. For more information, see Create a custom image from a snapshot.

Encrypted image

Encrypted images cannot be exported.

  • The data of an encrypted image is encrypted. After being exported, the image cannot be used. If you import the exported image, it also cannot be used.

  • Encryption is irreversible. Exporting an image with decryption is not supported.

Precautions

Item

Description

Export fees

When you export an image file, it is stored in an OSS bucket. This incurs the following fees:

  • Storing the exported image file in an OSS bucket incurs OSS storage fees.

  • Uploading and downloading the image file during the export process incurs OSS traffic fees.

  • Accessing the OSS API during the image export process incurs OSS request 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

  • When using the exported full image to create a Linux system with the same configuration, confirm that the file devices recorded in /etc/fstab correspond to the exported data disk snapshot information.

  • If the disk contains no data when the custom image is created, the decompressed image will also contain no data after export.

  • An exported image is not guaranteed to start properly on other platforms. However, you can attach the disks in the image to retrieve data.

Procedure

  1. Go to ECS console - Images.

  2. In the top navigation bar, select the region and resource group of the resource that you want to manage. 地域

  3. On the Custom Images tab, find the custom image and click Export Image in the Actions column.

  4. Review the information in the Export Preparations section and click Next. Confirm that you meet the prerequisites and click Continue Export.

  5. Configure the parameters for Export Image File.

    image

    • 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.

      Note
      • The 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.

      Note

      You 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].

  6. 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.

Note

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.

  1. Check the error code on the Task Management page or by calling the DescribeTaskAttribute API operation.

  2. 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.