When you deploy your services in the cloud, you can manually import image files of your servers. You can also use ECS images that are automatically generated by Alibaba Cloud for your servers. This topic describes the application scenarios and operation procedures of the two methods.

Prerequisites

Before you manually import custom images, make sure that the following requirements have been met:

Background information

The following table lists the scenarios in which you can import custom images.
Feature Scenario Procedure
Auto-import Migrate one or more servers such as IDC servers, virtual machines, and cloud servers on other cloud platforms to Alibaba Cloud. Auto-import
Manual import The operating system that you require is not available in Alibaba Cloud. Possible cases are as follows:
  • The specified operating system type does not exist in Alibaba Cloud.
  • The specified operating system version has been discontinued in Alibaba Cloud.
  • The specified operating system is a custom operating system.

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

Manual import

Auto-import

Follow these steps to use Server Migration Center (SMC) to generate ECS images for your server:

  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 a region.
  4. In the upper-right corner of the Images page, choose importImage_arrow > Auto Import.
    The Server Migration Center console is displayed.
  5. Complete the operations as instructed. For more information, see Migration process.
    After the migration is complete, SMC will generate a custom image for your server. The image name starts with IMAGE_FROM_SMC.

Manual import

Follow these steps to manually import a local image to Alibaba Cloud ECS:

  1. Use a third-party OSS client or call an API operation to upload the custom image that you have prepared. For information about how to upload an image file 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, choose importImage_arrow > Manually Import.
    2. In the Import Image dialog box that appears, click Confirm Address in Step 3 shown in the following figure.
    3. On the Cloud Resource Access Authorization page that appears, select AliyunECSImageImportDefaultRole and AliyunECSExportDefaultRole. Click Confirm Authorization Policy.
  6. Import the custom image.
    1. On the Images page, choose importImage_arrow > Manually Import again.
    2. In the Import Image dialog box that appears, configure the parameters listed in the following table.
      Parameter Required Description
      Region of Image Yes This field is automatically set to the current region. To change the region, close the Import Image dialog box and select a new region in the top navigation bar. You can then choose Import Image > Manually Import to open the Import Image dialog box again to configure other parameters.
      OSS Object Address Yes Copy the URL of the image object from the OSS console. For more information about how to obtain an object URL, 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 (GiB) No 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 to import the image.
      • Windows: Windows Server 2003, Windows Server 2008, and Windows Server 2012.
      • Linux: CentOS, SUSE, Ubuntu, Debian, FreeBSD, CoreOS, Aliyun, Customized Linux, and Others Linux. (Submit a ticket to confirm whether the selected edition is supported.)
      • If your image operating system is a custom edition based on the Linux kernel, Submit a ticket.
      Image Format No The RAW, qcow2, and VHD formats are supported. We recommend that you use the qcow2 and VHD formats.
      Note The ISO format is not supported and must be converted 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 has been imported. Valid values:
      • BYOL: the license provided by the source operating system. When this option is selected, make sure that your license key can be used by Alibaba Cloud.
      • Aliyun: the Alibaba Cloud software license. When this option is selected, the Alibaba Cloud license is applied to your selected Platform.
      • Auto: 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 Data Disk Image No Select this option if you want to import an image that contains data of 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 and the number of ongoing import tasks in the queue.

    When you import a custom image, a snapshot is automatically generated. You can view the snapshot information on the Snapshots page in the ECS console. Before the image import task is complete, the status of the snapshot is displayed as Failed. After the image import task is complete, the status of both the snapshot and image is updated to Available. The snapshot capacity is the size of the imported image file, regardless of the system disk size that you set when you import the image. The snapshot service is a paid service. For more information, see Snapshot billing.

What to do next

Create an instance by using a custom image