This topic describes how to import on-premises image files to your ECS environment. You can use imported images to create ECS instances or change the system disks of ECS instances.


Before importing custom images, make sure that the following requirements have been met:

Background information

When you import an image, a snapshot is automatically generated. You can view the snapshot information on the Snapshots page of the ECS console. Before the import image task is complete, the status of the snapshot is displayed as Failed. After the task is complete, the status automatically changes to Successful. The snapshot capacity is the size of the imported image file, regardless of the system disk size that was set when you import the image. The snapshot service is a paid service. For more information, see Billing of snapshots.

The import image function allows you to select a license type to activate the source operating system. This can reduce your image usage costs on the cloud. For more information about license types, see Parameters for image import.


  1. Use a third-party OSS client or the OSS API to upload the prepared custom image file. If the file is larger than 5 GiB, see Multipart upload and resumable upload.
  2. Log on to the ECS console.
  3. In the left-side navigation pane, choose Instances & Images > Images.
  4. In the top navigation bar, select a region.
  5. Authorize ECS to access your OSS resources.
    1. On the Images page, click Import Image.
    2. In the Import Image dialog box, click Confirm Address in step 3 shown in the following figure.
    3. On the Cloud Resource Access Authorization page, select AliyunECSImageImportDefaultRole and AliyunECSExportDefaultRole and click Confirm Authorization Policy.
  6. Import the custom image.
    1. Go back to the Images page and click Import Image.
    2. In the Import Image dialog box, configure the following parameters:
      Parameter Required Description
      Region of Image Yes This field is automatically populated with the current region. To change the region, close the Import Image dialog box and select a new region in the top navigation bar of the Images page. You can then click Import Image again to configure other parameters.
      OSS Object Address Yes Copy the object address of the image file from the OSS console. For more information, see Download objects.
      Image Name Yes Enter a name for the custom image. The name must be 2 to 128 characters in length and must start with a letter. It can contain letters, digits, periods (.), underscores (_), colons (:), and hyphens (-).
      Operating System Yes Select the operating system of your image. Valid values: Windows | Linux.

      If you want to import a non-standard platform image, select Linux.

      System Disk Size Yes Specify the system disk size. Valid values: 40 GiB to 500 GiB.
      System Architecture Yes Select x86_64 for 64-bit operating systems and i386 for 32-bit operating systems.
      Platform Yes The options depend on your selected Operating System. Select a system platform for the image to be imported.
      • Windows: Windows Server 2003, Windows Server 2008, and Windows Server 2012.
      • Linux: CentOS, SUSE, Ubuntu, Debian, FreeBSD, CoreOS, Aliyun, Customized Linux, and Others Linux. (open a ticket to confirm the selected edition is supported.)
      • If your image operating system is a custom edition developed from Linux kernel, open a ticket.
      Image Format No The qcow2, RAW, and VHD formats are supported. We recommend that you use the qcow2 and VHD formats.
      Note The ISO format is not supported. You can use offline tools such as VirtualBox to create an ISO image file and convert it to the RAW, VHD, or qcow2 format. You can also use Packer to create and import a local image. For more information, see Create and import on-premises images by using Packer and Configure DevOps parameters by using Packer.
      License Type No Select a license type to activate the source operating system after the image is imported. Valid values:
      • BYOL: the license that is provided by the source operating system. When this option is selected, make sure that your license key can be used by Alibaba Cloud.
      • Alibaba Cloud: the Alibaba Cloud software license. When this option is selected, the Alibaba Cloud license is applied to your selected Platform.
      • Automatic: the default value. When this option is selected, Alibaba Cloud will automatically detect the source operating system and allocate a license. In this mode, the system automatically checks whether an Alibaba Cloud software license exists in your selected Platform and then performs the following actions:
        • If a license exists, the system allocates the license to the imported image.
        • If no license exists, the system switches the license type to BYOL.
      Image Description No Enter a description for the custom image.
      Add Images of Data Disks No Select this option if you want to import an image that contains data disks. Supported data disk capacity ranges from 5 GiB to 2,000 GiB.
    3. Click OK. The system will create a task to import the custom image.
  7. Optional: You can view the task progress in the image list of the destination region. Before the task is complete, you can find the imported custom image on the Tasks page in the ECS console and cancel the import task if needed. For more information, see Tasks.
    The amount of time it takes to import a custom image depends on the size of the image file and the number of image import tasks in the queue.

What to do next

Create an instance by using a custom image