This topic was translated by AI and is currently in queue for revision by our editors. Alibaba Cloud does not guarantee the accuracy of AI-translated content. Request expedited revision

export a custom image

Updated at: 2025-02-18 17:42

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

Background information

Limitations

Limitation

Description

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

  • Images that contain the snapshots of up to four data disks can be exported.

  • The capacity of each data disk cannot exceed 500 GiB.

    Note

    If the capacity of a data disk exceeds 500 GiB, you must distribute the data on the disk to multiple data disks that are less than 500 GiB in size and then create and export custom images from these smaller data disks.

Notes

Note

Description

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

  • When you create a Linux system with the same configuration as the exported full image, you need to confirm whether the file devices recorded in /etc/fstab correspond to 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.

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.

    1. 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"
                }
            ]
        }
    2. 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

  1. Log on to the ECS console.

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

  3. In the upper-left corner of the menu bar, select a region.

    Important

    Ensure the region matches the one where the bucket is located.

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

    1. Locate the target image you want to export. In the Actions column, choose More > Export Image.

    2. In the Cloud Resource Access Authorization dialog box, you can click Authorize.

    3. Locate the AliyunECSImageImportDefaultRole and AliyunECSImageExportDefaultRole roles, then click Agree To Authorize.

  5. On the Custom Images tab, locate the desired image. In the Actions column, click More Options > Export Image .

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

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

Note

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.

  • On this page (1)
  • Prerequisites
  • Background information
  • Limitations
  • Notes
  • Permissions required to export custom images
  • Procedure
  • What to do next
  • References
Feedback
phone Contact Us

Chat now with Alibaba Cloud Customer Service to assist you in finding the right products and services to meet your needs.

alicare alicarealicarealicare