All Products
Search
Document Center

Elastic Compute Service:Export a custom image

Last Updated:Aug 27, 2024

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.

      Grant a RAM user the permissions to access OSS buckets

      1. Create a custom policy.

      2. Attach the custom policy to the RAM user. For more information, see Grant permissions to a RAM user.

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.

  • Data in encrypted images is encrypted. The data is unusable after it is exported or re-imported.

  • Image encryption is irreversible. You cannot decrypt the encrypted images to export the 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

  • To use an exported image to create identical Linux instances, make sure that the file system information recorded in the /etc/fstab directory is consistent with the exported data disk snapshot information.

  • If you create a custom image based on a disk that does not contain data and export the image, the decompressed image file contains no data.

  • An exported image may not start normally on other platforms. You can attach disks contained in the image to obtain data.

Procedure

  1. Log on to the ECS console.

  2. In the left-side navigation pane, choose Instances & Images > Images.

  3. In the top navigation bar, select the region and resource group to which the resource belongs. 地域

  4. On the Custom Images tab, find the custom image that you want to export. In the Actions column, click Export Image.

  5. In the Make Preparations step, check whether the custom image meets the image export requirements and click Next.

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

    1. In the Export Image Files to OSS section, click AliyunECSImageExportDefaultRole.

    2. On the Cloud Resource Access Authorization page, verify that the AliyunECSImageExportDefaultRole role is displayed and click Confirm Authorization Policy.

      Note

      The system automatically creates the AliyunECSImageExportDefaultRole role and grants the role permissions.

  7. In the Export Image dialog box, click Next.

  8. Click Continue.

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

  10. After you confirm the information, click OK to export the custom image.

  11. (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.

        Note

        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.

      • An export task may fail when you export a custom image. You can perform the following steps to identify and resolve the issue:

        1. View the error code that corresponds to the issue on the Task Management page in the ECS console or by calling the DescribetaskAttribute operation.

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

      1. In the left-side navigation pane, choose Maintenance & Monitoring > icon1 > Tasks.

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

Note

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.