When you deploy services to 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 are met:

Background information

The following table lists the scenarios in which you can import custom images.
Item Scenario Procedure
Auto-import Migrate one or more servers such as IDC servers, virtual machines, and cloud servers from other cloud platforms to Alibaba Cloud. Auto-import
Manual import The operating system that you require is not available in Alibaba Cloud. Examples:
  • The specified operating system type does not exist in Alibaba Cloud.
  • The specified operating system version is 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 the table that describes parameters for image import in the following section.

Manual import

Auto-import

Perform the following operations to use Server Migration Center (SMC) to generate an ECS image 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, click Online SMC Migration.
    You are redirected to the SMC console.
  5. Complete the operations as instructed. For more information, see Migration process.
    After your server is migrated, SMC generates a custom image for your server. The image name starts with IMAGE_FROM_SMC.

Manual import

Perform the following operations 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 prepared custom image. 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. In the upper-right corner of the Images page, click Import Image.
    2. In the Import Image dialog box, click Verify in Step 3 as shown in the following figure.
    3. On the Cloud Resource Access Authorization page, AliyunECSImageImportDefaultRole and AliyunECSExportDefaultRole are displayed. Click Confirm Authorization Policy.
  6. Import the custom image.
    1. In the upper-right corner of the Images page, click Import Image again.
    2. In the Import Image dialog box, configure the parameters listed in the following table.
      Parameter Required Description
      Region of Image Yes This parameter is automatically set to the current region. To change the region, close the Import Image dialog box and select another region in the upper-left corner of the top navigation bar. Then, you can click Import Image to open the Import Image dialog box and continue to configure other parameters.
      OSS Object Address Yes Paste the URL of the image object copied 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 can contain letters, digits, periods (.), underscores (_), colons (:), and hyphens (-). It must start with a letter.
      Operating System/Platform Yes
      • Operating System:

        Select the operating system of your image. Valid values: Windows and Linux.

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

      • Platform:
        The option depends on the Operating System value that you selected. Select a system platform based on the image to be imported.
        • Windows: Windows Server 2003, Windows Server 2008, Windows Server 2012, Windows Server 2016, and Windows Server 2019.
        • Linux: CentOS, SUSE, openSUSE, Ubuntu, Debian, FreeBSD, CoreOS, Aliyun, Red Hat, 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.
      System Disk Size (GiB) No Specify the system disk size. Unit: GiB. Valid values: 5 to 500.
      System Architecture Yes Select x86_64 for 64-bit operating systems or i386 for 32-bit operating systems.
      Image Format No Valid values: Automatic Detection, RAW, QCOW2 and VHD.
      • If you do not know the image format, you can select Automatic Detection to allow the system to detect and set the image format.
      • If you want to select an image format, we recommend that you select the QCOW2 or VHD format, which has a smaller transmission footprint.
      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 an on-premises image by using Packer and Alicloud Image Builder parameters used to implement DevOps.
      License Type No Select a license type to activate the source operating system after the image is imported. Default value: Auto. Valid values:
      • BYOL: the license provided by the source operating system. When this value is selected, make sure that your license key can be used in Alibaba Cloud.
      • Aliyun: the license allocated by Alibaba Cloud. When this value is selected, a license allocated by Alibaba Cloud is applied based on the Platform value that you selected.
      • Auto: specifies that Alibaba Cloud automatically detects the source operating system and allocates a license. When this value is selected, the system automatically checks whether a license allocated by Alibaba Cloud exists for your specified system platform and then performs the following actions:
        • If a license allocated by Alibaba Cloud exists for the specified system platform, the system allocates the license to the imported image.
        • If no license allocated by Alibaba Cloud exists for the specified system platform, 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 1,000 GiB.
      Resource Group No Specify a resource group for the custom image for easy management.
      Tag No Bind tags to images to classify the images for easy search and batch operations.
    3. Click OK. The system then creates 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 or cancel the import task on the Tasks page in the ECS console.

    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 an image, a snapshot is automatically generated. You can view the snapshot information on the Snapshots page in the ECS console. Before the image is imported, the status of the snapshot is displayed as Failed. After the image is imported, the status of the image is updated to Available and that of the snapshot is updated to Successful. 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.

What to do next

Create an instance by using a custom image