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.
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.
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).
The boot modes supported by instance types and public images are defined by the system and cannot be changed. For more information, see the Boot modes supported by instance types and Boot modes of public images sections of this topic.
You can specify or change the boot modes of custom images. For more information, see the Boot modes of custom images section of this topic.
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 |
①: 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.
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.
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.
NoteYou 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.
ImportantIf 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.
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.