All Products
Search
Document Center

Elastic Compute Service:Best practices for ECS instance boot modes

Last Updated:May 29, 2024

A boot mode is the mode in which the system disk is booted during the creation of an Elastic Compute Service (ECS) instance. The boot mode of an ECS instance is determined based on the boot modes supported by the instance type and the boot mode of the image that is used to create the instance. This topic describes the boot modes of ECS instances, how to view the boot modes of public images, and how to specify or change the boot modes of custom images.

Note

The boot mode of an ECS instance determines the mode that is used to boot the system disk of the instance on first instance startup. If you restart an ECS instance, the system uses the boot mode that is determined during instance creation to boot the system disk.

Introduction

ECS supports the Legacy Basic Input/Output System (BIOS) and Unified Extensible Firmware Interface (UEFI) boot modes:

  • Legacy BIOS boot mode: BIOS, which is the basic software layer involved in the system boot process, is used to initialize hardware. BIOS provides basic hardware services to support the booting of an operating system. BIOS is a traditional firmware interface standard with limited functionality.

  • UEFI boot mode: UEFI, which is a substitute for BIOS, is a more advanced and modular firmware interface standard. UEFI provides a more powerful, flexible, and secure boot environment.

    The UEFI boot mode has advantages over the Legacy BIOS boot mode.

    • Support for large disk sizes

      Legacy BIOS uses the Master Boot Record (MBR) partitioning scheme and supports hard disks that are up to 2 TB in size. UEFI uses the GUID Partition Table (GPT) partitioning scheme and supports hard disks that are larger than 2 TB in size.

    • High speed and performance

      In Legacy BIOS boot mode, all devices are scanned at boot time. In UEFI boot mode, only necessary drivers are loaded at boot time, and the boot speed is faster compared with the Legacy BIOS boot mode.

    • Security

      UEFI provides the Secure Boot feature. UEFI allows only authentic drivers and services to load at boot time and ensures that ECS instances do not load malware on startup. UEFI requires digital signatures for drivers and the kernel. You can use UEFI to protect against piracy and boot-sector malware.

    • Scalability

      UEFI is an extensible, standard solid-state interface. Legacy BIOS is a rigid, unofficial standard that is developed based on conventions that are no longer relevant and is poorly documented.

    • Flexibility

      UEFI is a 32-bit or 64-bit program that is written in the C language. UEFI is not limited to real mode and provides more addressable address space. Legacy BIOS is a 16-bit program assembly language that can run only in 16-bit real mode and provides only 1 MB of addressable memory.

Boot modes of ECS instances

The boot mode of an ECS instance (the third column in the following table) is determined based on the boot modes supported by the instance type (the first column in the following table) and the boot mode of the image (the second column in the following table).

Boot modes supported by the instance type

Boot mode of the image

Boot mode of the ECS instance

UEFI

UEFI

UEFI

UEFI

UEFI-Preferred

UEFI

Legacy BIOS

Legacy BIOS

Legacy BIOS

Legacy BIOS

UEFI-Preferred

Legacy BIOS

Legacy BIOS and UEFI

UEFI

UEFI

Legacy BIOS and UEFI

Legacy BIOS

Legacy BIOS

Legacy BIOS and UEFI

UEFI-Preferred

UEFI

Note

: If the boot mode of an image is UEFI-Preferred, the image can use the Legacy BIOS or UEFI boot mode. If an instance type supports the Legacy BIOS and UEFI boot modes and the boot mode of an image is UEFI-Preferred, the UEFI boot mode is used when an ECS instance of the instance type is created from the image.

Boot modes supported by instance types

ECS instance types support UEFI, Legacy BIOS, or both. You cannot change the boot modes supported by ECS instance types. You can call the DescribeInstanceTypes operation and determine the boot modes supported by an instance type based on the value of the SupportedBootModes response parameter.

When you create an ECS instance, the image versions that you can select may vary based on the boot modes supported by the instance type that you select. For example, if you select a security-enhanced instance type that supports only UEFI, you can select only UEFI images, as shown in the following figure.

image..png

Boot modes of images

Boot modes of public images

The following section describes the default boot modes that are supported by different versions of public images:

  • UEFI public images: support only the UEFI boot mode.

    For example, the UEFI boot mode is used by the public images whose operating system names contain UEFI, such as Alibaba Cloud Linux 2.1903 64-bit (UEFI), Ubuntu 18.04 64-bit (UEFI), and Debian 11.6 64-bit (UEFI).

  • Arm public images: support the UEFI boot mode by default.

    For example, the UEFI boot mode is used by the public images whose operating system names contain ARM or Arm, such as Ubuntu 20.04 64-bit for ARM and CentOS 8.4 64-bit for ARM.

  • Other public images: support the Legacy BIOS or UEFI-Preferred boot mode by default.

Boot modes of custom images

Specify a boot mode for a custom image

You can specify a boot mode for a custom image in the ECS console or by calling an API operation.

  • Method 1: Use the ECS console

    In the ECS console, you can specify a boot mode for a custom image only when you import the image. By default, Arm images use the UEFI boot mode, as shown in the following figure. For non-Arm images, you can specify a boot mode based on your business requirements. For more information, see Import custom images.

    image

  • Method 2: Call an API operation

    When you call the ImportImage operation to import a custom image or call the CreateImage operation to create a custom image, configure the BootMode parameter to specify a boot mode for the image.

    • If you set the BootMode parameter to BIOS, the custom image uses the Legacy BIOS boot mode.

    • If you set the BootMode parameter to UEFI, the custom image uses the UEFI boot mode.

    • If you set the BootMode parameter to UEFI-Preferred, the custom image can use the Legacy BIOS or UEFI boot mode.

      Note

      You cannot specify the UEFI-Preferred boot mode for imported custom images.

Change the boot mode of a custom image

You cannot change the boot mode of a public image. You can change the boot mode of a custom image in the following scenarios:

  • You changed the boot partition configuration of the system disk on an ECS instance and want the custom images that are created from the instance to use a different boot mode.

  • You selected an incorrect boot mode when you created or imported a custom image.

    Important
    • If the custom image is associated with ECS instances, you cannot change the boot mode of the image.

    • To ensure that the ECS instances created from the custom image can start, make sure that the new boot mode is supported by the image and the instance type.

You can change the boot mode of a custom image in the ECS console or by calling an API operation.

  • Method 1: Use the ECS console

    In the ECS console, go to the details page of a custom image to change the boot mode of the image. For more information, see Modify the attributes and tags of an image.

  • Method 2: Call an API operation

    To change the boot mode of a custom image, call the ModifyImageAttribute operation and change the value of the BootMode parameter.

    If you set the BootMode parameter to BIOS, the custom image uses the Legacy BIOS boot mode.

    If you set the BootMode parameter to UEFI, the custom image uses the UEFI boot mode.

    If you set the BootMode parameter to UEFI-Preferred, the custom image can use the Legacy BIOS or UEFI boot mode.

View the boot mode of an image

  • Method 1: Use the ECS console

    In the ECS console, go to the details page of an image to view the boot mode of the image.

    image

  • Method 2: Call an API operation

    Call the DescribeImages operation to query the image and check the boot mode of the image based on the value of the BootMode response parameter.

    • If the value of the BootMode parameter is BIOS, the image uses the Legacy BIOS boot mode.

    • If the value of the BootMode parameter is UEFI, the image uses the UEFI boot mode.

    • If the value of the BootMode parameter is UEFI-Preferred, the image can use the Legacy BIOS or UEFI boot mode.

References

  • If you enable the image check feature when you create or import a custom image, the feature checks the boot mode of the image. For more information, see Overview.

  • When you create an image file on your on-premises computer, you can specify the Legacy BIOS or UEFI boot mode for the operating system. For more information, see Create Linux image files and Create Windows image files.