When you deploy your business in the cloud, you can import image files from your computer or other cloud servers to Alibaba Cloud Elastic Compute Service (ECS). The imported images are recognized as custom images in ECS. After you import an image to ECS, you can use the image to create ECS instances or replace the operating systems (system disks) of existing ECS instances. This topic describes how to import an image.

Import a Linux image

The following figure shows the procedure on how to import a Linux image. Procedure on how to import a Linux image
  1. Read Instructions for importing images to learn about the limits for importing Linux images.
  2. Prepare a usable on-premises image file.
    1. Install VirtualBox on the source server (server from which to create an image) and use VirtualBox to create a virtual machine and install an operating system. For more information, see Create a virtual machine and install an operating system.
    2. Install the required plug-ins on the source server.
      • Install cloud-init to allow ECS instances that run the image to complete their initialization configurations. For more information, see Install cloud-init.
      • Install VirtIO drivers to allow ECS instances created from the image to start as expected. For more information, see Install the virtio driver.
      • Optional:If the operating system contained in the image is not supported by Alibaba Cloud and cloud-init cannot be installed, you can select Customized Linux when you import the image. For more information, see Customize Linux images.
    3. Install and use an image compliance tool to automatically check whether the Linux settings of the image meet the image import requirements. For more information, see Check whether an image meets the import requirements.
    4. Obtain the Linux image file.
      1. For more information, see Obtain a Linux image file.
      2. Check whether the image file is in a format supported by ECS. ECS instances support only image files in RAW, VHD, and QCOW2 formats. If the image file that you want to import is in another format, you must convert the image file to a supported format first. For more information about how to convert the format of an image file, see Convert the format of an image.
  3. Upload the image file that you obtained to Object Storage Service (OSS). For more information, see Upload image files to OSS.
  4. Import the image. For more information, see Import custom images.
  5. Create an instance from the custom image that you imported. For more information, see Use a custom image to create one or more instances.

Import a Windows image

The following figure shows the procedure on how to import a Windows image.Procedure on how to import a Windows image
  1. Read Instructions for importing images to learn about the limits for importing Windows images.
  2. Prepare a usable on-premises image file.
    1. Install VirtualBox on the source server (server from which to import an image) and use VirtualBox to create a virtual machine and install an operating system. For more information, see Create a virtual machine and install an operating system.
    2. Install VirtIO drivers on the source server to allow ECS instances created from the image to start as expected. For more information, see Install the virtio driver.
    3. Obtain the Windows image file.
      1. For more information, see Obtain a Windows image file.
      2. Check whether the image file is in a format supported by ECS. ECS instances support only image files in RAW, VHD, and QCOW2 formats. If the image file that you want to import is in another format, you must convert the image file to a supported format first. For more information about how to convert the format of an image file, see Convert the format of an image.
  3. Upload the image file that you obtained to Object Storage Service (OSS). For more information, see Upload image files to OSS.
  4. Import the image. For more information, see Import custom images.
  5. Create an instance from the custom image that you imported. For more information, see Use a custom image to create one or more instances.