All Products
Search
Document Center

Elastic Compute Service:Instructions for importing images

Last Updated:Sep 01, 2023

Before you import an image to Elastic Compute Service (ECS), we recommend that you read the following instructions to ensure image availability and improve import efficiency.

Windows Server images

Item

Description

Operating system

Images that contain the following operating system versions of Windows 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 RAW, VHD, and QCOW2 formats can be imported to ECS. For images in other formats, you must convert the images to the RAW, VHD, or QCOW2 format before you can import the images to ECS. For more information, see Convert the image file format.

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.

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

Security

  • Disable the firewall.

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

Others

  • 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 for 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. Special characters include ( ) ` ~ ! @ # $ % ^ & * - _ + = | { } [ ] : ; ' < > , . ? /. The password cannot start with a forward slash (/).

  • Make sure that the QEMU guest agent (GA) is not installed in 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 in 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

Linux images

Item

Description

Operating system

Images that contain the following operating system versions of Linux 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

  • RedHat

  • 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.

  • Linux images that are not listed as ECS public 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 RAW, VHD, and QCOW2 formats can be imported to ECS. For images in other formats, you must convert the images to the RAW, VHD, or QCOW2 format before you can import the images to ECS. For more information, see Convert the image file format.

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 list of 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.

  • The system disk can have only the root partition. If the system disk has other partitions, the instance cannot be started or the disk cannot be resized.

Network

  • Note that 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, so that 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 /etc/issue*. Otherwise, the distribution of the operating system cannot be identified by ECS and the operating system cannot be created for instances.

    • Do not modify /boot/grub/menu.lst. Otherwise, ECS instances cannot be started.

    • Do not modify /etc/fstab. Otherwise, partitions cannot be loaded and ECS instances cannot be started.

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

    • Do not modify /etc/selinux/config to enable SELinux. Otherwise, instance operating systems cannot be started. If you must enable SELinux, see Enable or disable SELinux.

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

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

  • Install Xen or KVM virtualization drivers. For more information, see Install the virtio driver.

  • Install cloud-init to configure the hostname, NTP repositories, and YUM repositories. For more information, see Install cloud-init.

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 allow the password to be set or the key pair to be modified for an imported image, make sure that the image meets the following requirements before you import it:

    • 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 this 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 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 it:

    • The image supports the growpart command.

      To support this 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 this 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 manually install it. 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 considered as non-standard platform images. Such images are developed on a standard operating system platform, but their critical system configuration files, basic system environments, or applications 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 within 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 these images:

  • Others Linux: ECS identifies all images of this type as other Linux images. If you import an Others Linux image and then use it 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 manually 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 a customized Linux image is imported, you can create instances from this image and configure networks and passwords for the instances in the same way as you do with instances 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, you must 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, you must 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, you must 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, you must use a bucket that resides in the oss-cn-beijing-finance-1 region of OSS.