When migrating to the cloud or importing a custom image, you must configure the correct boot mode. Matching the image boot mode with the instance type is essential to prevent startup failures and ensure your Elastic Compute Service (ECS) instance runs reliably.
Boot mode types
An ECS instance supports two boot modes: BIOS and UEFI.
BIOS: A traditional firmware interface used to initialize hardware and load the operating system. It is primarily used for compatibility with legacy operating systems, such as CentOS 6, Windows XP, and earlier versions.
UEFI: A modern replacement for BIOS that supports features like Secure Boot.
How the boot mode is determined
An ECS instance's final boot mode depends on the modes supported by both its instance type and image. The instance type dictates the hardware constraints, while the image specifies the software's boot method.
Instance type boot mode: Defined by Alibaba Cloud and cannot be changed. The options are
UEFI,BIOS, or support for both (UEFI & BIOS).Image boot mode: Public images use a default boot mode defined by Alibaba Cloud. You can modify a custom image's boot mode after it is created or during import. The options are
UEFI,BIOS, orUEFI-Preferred.UEFI-Preferredindicates that the image supports both modes but attempts to start in UEFI mode first.
The boot modes of the instance type and the image must be compatible. If the instance type's boot mode does not match the image's boot mode (for example, using a BIOS image with a UEFI-only instance type), the instance may fail to start.
Instance type boot mode | Image boot mode | Final instance boot mode |
|
|
|
|
|
|
|
| Follows the image boot mode. If the image boot mode is If the image boot mode is |
|
|
Configure the boot mode
When you import a custom image, Alibaba Cloud can only read the image's metadata. It cannot inspect or modify the bootloader configuration inside the image file. Before you configure the boot mode for a custom image, ensure the image file has the correct bootloader configuration, such as an EFI System Partition (ESP) for UEFI or a Master Boot Record (MBR) for BIOS. An incorrect configuration will prevent the instance from recognizing the system disk and cause a startup failure.
Specify the boot mode when importing a custom image
Console
In the ECS console, go to the Images page. In the top navigation bar, select the target region.
In the upper-right corner of the Images page, click Import Image.

In the Import Image dialog box, configure the necessary parameters, then select a Boot Mode.
You cannot set the boot mode to
UEFI-Preferredduring image import. To set it toUEFI-Preferred, you must modify the image after it is successfully imported.
Click OK.
API
When you call the ImportImage operation to import a custom image, use the BootMode parameter to specify the image's boot mode.
Modify the boot mode of an existing custom image
To ensure the stability and consistency of running instances, you cannot modify the boot mode of a custom image once it has been used to create an instance.
Console
In the ECS console, go to the Images page. In the top navigation bar, select the region where the target custom image is located.
Click the target image's ID to open its details page.
In the Basic Information section, click the
icon next to Boot Mode.In the Set Boot Mode dialog box, select a boot mode and click Confirm.
API
Call the ModifyImageAttribute operation and set the BootMode parameter to modify the boot mode of the image.
FAQ
Why can't I see or select certain image versions when creating an ECS instance?
When you create an ECS instance in the console, the boot mode of your selected instance type restricts the available image versions. For example, if you select a security-enhanced instance type that only supports UEFI mode, the console filters out images that only support BIOS mode.
How can I view the boot modes supported by an instance type?
Console
Go to the Custom Launch page in the ECS console.
On the Instance page, select the All Instance Types tab and click View more specification parameters.

Select the Supported Boot Mode checkbox and click OK.

Enter the target instance type in the search box to view its supported boot modes.

API
You can query this information by calling the DescribeInstanceTypes operation. The SupportedBootModes field in the response lists the boot modes supported by the instance type.
How can I view the boot mode of an image?
Console
Go to the Images page in the ECS console. In the top navigation bar, select the target region.
Click the target image's ID to open its details page.
The image's Boot Mode is shown in the Basic Information section.

API
Call the DescribeImages operation. The boot mode of the image is specified in the BootMode parameter of the return value.
How do I check whether my custom image uses a BIOS or UEFI bootloader internally?
You must perform this check on the source server used to create the image or on a temporary instance created from the image.
For Linux: Check if the
/sys/firmware/efidirectory exists. If it exists, the operating system was booted in UEFI mode.For Windows: Check the partition table type of the system disk. Open PowerShell as an administrator and run the
Get-Diskcommand. In the command's output, check thePartitionStylecolumn. A GPT partition style indicates UEFI boot, while an MBR partition style indicates BIOS boot.