All Products
Search
Document Center

Elastic Compute Service:Instructions for importing images

Last Updated:Jun 03, 2024

Before you import an image to Elastic Compute Service (ECS), familiarize yourself with the instructions described in this topic to ensure image availability and improve import efficiency.

Windows Server images

Item

Description

Operating system

Images that contain the following Windows operating system versions can be imported to ECS:

  • Microsoft Windows Server 2022

  • Microsoft Windows Server 2019

  • Microsoft Windows Server 2016

  • Microsoft Windows Server 2012 R2

  • Microsoft Windows Server 2012

  • Microsoft Windows Server 2008 R2

  • Microsoft Windows Server 2008

  • Windows Server 2003 Service Pack 1 (SP1) or later

Image format

Only images in the RAW, VHD, and QCOW2 formats can be imported to ECS. For images in other formats, convert the images to the RAW, VHD, or QCOW2 format before you import the images to ECS. For more information, see Convert the format of an image.

Virtual disk size

Configure the system disk size based on the virtual disk size rather than the image size. The system disk size ranges from 5 GiB to 2,048 GiB.

File system and partition

  • Master boot record (MBR) partitions, GUID Partition Table (GPT) partitions, and New Technology File System (NTFS) file systems are supported.

  • Multi-partition system disks are supported.

  • A system disk can have only the boot partition (drive C). If the system disk has other partitions, the instance to which the system disk is attached cannot be started or the disk cannot be resized.

Security

  • Disable the firewall.

  • Allow traffic on Remote Desktop Protocol (RDP) port 3389.

Other

  • Verify the integrity of file systems.

  • Do not modify critical system files.

  • Make sure that the system disk has sufficient free space.

  • Make sure that the logon password of the administrator account meets the password complexity requirements. The password must be 8 to 30 characters in length and contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. The following special characters are supported: ( ) ` ~ ! @ # $ % ^ & * - _ + = | { } [ ] : ; ' < > , . ? / The password cannot start with a forward slash (/).

  • Make sure that the QEMU guest agent (GA) is not installed on images. If the QEMU GA is installed, some services that ECS requires may be unavailable.

  • Make sure that Community Edition virtio drivers are not installed on Windows Server operating systems. If Community Edition virtio drivers are installed, remove the read-only property of the following files:

    • C:\Windows\System32\drivers\netkvm.sys

    • C:\Windows\System32\drivers\balloon.sys

    • C:\Windows\System32\drivers\vioser.sys

    • C:\Windows\System32\drivers\viostor.sys

    • C:\Windows\System32\drivers\pvpanic.sys

  • Before you import an image, make sure that the image meets the image requirements to be compatible with ECS instance types and passed the compatibility tests. For more information, see Alibaba Cloud Marketplace Windows image requirements.

Linux images

Item

Description

Operating system

Images that contain the following Linux operating system versions of can be imported to ECS:

  • Alibaba Cloud Linux

  • Anolis

  • CentOS 5, 6, 7, and 8

  • CentOS Stream

  • Debian 6, 7, 8, 9, and 10

  • FreeBSD

  • openSUSE 13, 42, and 15

  • Red Hat

  • Red Hat Enterprise Linux (RHEL)

  • SUSE Linux 10, 11, 12, and 15

  • Ubuntu 10, 12, 13, 14, 16, 18, and 20

  • CoreOS 681.2.0+

  • AlmaLinux

  • Rocky Linux

Note
  • If the image that you want to import is an Arm64-based image or if the operating system of the image is CentOS Stream, Anolis, AlmaLinux, or Rocky Linux, the image must meet additional requirements.

  • If Linux images contain the operating systems that are not contained in ECS public images, the Linux images are considered as non-standard platform images.

For more information, see the Other instructions for Linux images section of this topic.

Image format

Only images in the RAW, VHD, and QCOW2 formats can be imported to ECS. For images in other formats, convert the images to the RAW, VHD, or QCOW2 format before you import the images to ECS. For more information, see Convert the format of an image.

Virtual disk size

Configure the system disk size based on the virtual disk size rather than the image size. The system disk size ranges from 5 GiB to 2,048 GiB.

File system and partition

  • MBR partitions, GPT partitions, XFS file systems, ext3 file systems, and ext4 file systems are supported.

    Note

    However, ext4 file systems cannot have the 64bit feature, and the project and quota features cannot be used together. You can run the following command to view the features that an ext4 file system has:

    tune2fs -l <ext4 file system disk directory> | grep features
  • System disk partitions cannot be adjusted. Only system disks with a single root partition are supported.

  • System disk partitions (root partitions) cannot be created across disks by using Logical Volume Manager (LVM). If system disk partitions are created across disks, ECS instances may be unable to start.

  • We do not recommend that you create system root partitions by using LVM. If you create system root partitions by using LVM, you may be unable to change the passwords of ECS instances in the ECS console and to connect to ECS instances by using password-based or SSH key pair-based authentication.

  • A system disk can have only the boot partition. If the system disk has other partitions, the instance to which the system disk is attached cannot be started or the disk cannot be resized.

Network

  • Only a single network interface is supported.

  • Enable Dynamic Host Configuration Protocol (DHCP).

Note

Make sure that the virtio_net driver is configured in initd/initramfs. This way, network interface (NIC) drivers can finish initializing NICs before network service configurations are started. For more information, see Install the virtio driver.

Security

  • Disable the firewall.

  • Allow traffic on SSH port 22.

Others

  • Verify the integrity of file systems.

  • Do not modify critical system files such as /sbin, /bin, and /lib*.

    • Do not modify the /etc/issue* files. If you modify the files, the distribution of the operating system cannot be identified by ECS and the operating system cannot be created for instances.

    • Do not modify the /boot/grub/menu.lst file. If you modify the file, ECS instances cannot be started.

    • Do not modify the /etc/fstab file. If you modify the file, partitions cannot be loaded and ECS instances cannot be started.

    • Do not set the /etc/shadow file to read-only. If you set the file to read-only, the password file cannot be modified and instance operating systems cannot be created.

    • We do not recommend that you denable SELinux by modifying the /etc/selinux/config file. If you enable SELinux by modifying the file, instance operating systems cannot be started. If you must enable SELinux, perform the operations that are described in Enable or disable SELinux to enable SELinux.

  • Make sure that the logon password of the root account meets the password complexity requirements. The password must be 8 to 30 characters in length and contain at least three of the following character types: lowercase letters, uppercase letters, digits, and special characters. The following special characters are supported: ( ) ` ~ ! @ # $ % ^ & * - _ + = | { } [ ] : ; ' < > , . ? /

  • Make sure that the QEMU GA is not installed on images. If the QEMU GA is installed, some services that ECS requires may be unavailable.

  • Install Xen or Kernel-based Virtual Machine (KVM) virtualization drivers. For more information, see Install the virtio driver.

  • Install cloud-init to configure the hostname, Network Time Protocol (NTP) repositories, and YUM repositories. For more information, see Install cloud-init.

  • Before you import an image, make sure that the image meets the image requirements to be compatible with ECS instance types and passed the compatibility tests. For more information, see Alibaba Cloud Marketplace Linux image requirements.

Other instructions for Linux images

Limits

If the image that you want to import is an Arm64-based image or if the operating system of the image is CentOS Stream, Anolis, AlmaLinux, or Rocky Linux, take note of the following items:

  • To ensure that the password can be configured or the key pair can be modified for an imported image, make sure that the image meets the following requirements before you import the image:

    • The kernel of the operating system supports the CONFIG_FW_CFG_SYSFS feature.

      By default, Linux community kernel 4.6 or later and CentOS kernel 3.10.0-826.el7 or later support the feature. You can run the grep -nr CONFIG_FW_CFG_SYSFS /boot/config-$(uname -r) command on the source server of the image. If the command output contains CONFIG_FW_CFG_SYSFS=y, the operating system kernel contained in the image supports the CONFIG_FW_CFG_SYSFS feature.

    • Alibaba Cloud cloud-init of the latest version is installed on the operating system.

      If the version of cloud-init is 19.1, the minor version must be 19.1.18 or later. If the version of cloud-init is 0.7.6a in some early versions of operating systems, the minor version must be 0.7.6a15 or later. For more information, see Install cloud-init.

    • The operating system supports the SHA-512 encryption algorithm.

  • If you want an imported image to support resizing of disks and file systems, make sure that the image meets the following requirements before you import the image:

    • The image supports the growpart command.

      To support the command, you must install the cloud-utils-growpart package. The methods of installing the package vary based on operating systems. For more information, see Extend the partitions and file systems of disks on a Linux instance.

    • The image supports the resize2fs command.

      To support the command, you must install the e2fsprogs package. By default, the package is installed on operating systems. If the package is not installed on an operating system, you must install the package on the operating system. For example, to install the e2fsprogs package on a CentOS 7 operating system, run the yum install -y e2fsprogs command.

    • Alibaba Cloud cloud-init of the latest version is installed on the operating system.

      If the version of cloud-init is 19.1, the minor version must be 19.1.18 or later. If the version of cloud-init is 0.7.6a in some early versions of operating systems, the minor version must be 0.7.6a15 or later. For more information, see Install cloud-init.

Non-standard Linux images

Linux images that are not listed as ECS public images are non-standard platform images. Non-standard platform images are developed on a standard operating system platform, but the critical system configuration files, basic system environments, or applications of the images do not comply with the standard operating system requirements of ECS. If you want to use a non-standard platform image, you must complete the required configurations in the operating system of the image before and after the image is imported.

The following section describes the non-standard platform image types that can be imported and how to configure the images:

  • Others Linux: ECS identifies all images of this type as other Linux images. If you import an Others Linux image and then use the image to create instances, ECS does not process the created instances. If DHCP is disabled in the Others Linux image, you must connect to the instances by using a remote connection feature in the ECS console and then configure IP addresses, routes, and passwords for the instances. If DHCP is enabled in the Others Linux image, networks are automatically configured for the instances when you log on to the instances.

  • Customized Linux: Before you import a customized Linux image, create instances from the image and configure networks and passwords for the instances in the same way as you perform the operations for instances that are created from standard ECS images. For more information, see Customize Linux images.

Instructions for importing images to Alibaba Finance Cloud regions

To import custom images to an Alibaba Finance Cloud region, use the endpoint of the region and an Object Storage Service (OSS) bucket that resides in the region. Examples:

  • To import custom images to the cn-shanghai-finance-1 region of ECS, use a bucket that resides in the oss-cn-shanghai-finance-1-pub region of OSS.

  • To import custom images to the cn-shenzhen-finance-1 region of ECS, use a bucket that resides in the oss-cn-szfinance region of OSS.

  • To import custom images to the cn-beijing-finance-1 region of ECS, use a bucket that resides in the oss-cn-beijing-finance-1 region of OSS.