Instance boot mode

更新时间:
复制 MD 格式

For scenarios such as migrating to the cloud or importing a custom image, you must check and configure the image boot mode to prevent startup failures caused by incompatibilities between the instance type and the image. This ensures that your ECS instance starts and runs stably.

Boot mode types

ECS instances support two boot modes: BIOS and UEFI.

  • BIOS: A legacy firmware interface for initializing hardware and loading the operating system. It is used mainly for compatibility with older operating systems, such as CentOS 6, Windows XP, and earlier versions.

  • UEFI: A modern replacement for BIOS that supports Secure Boot.

How the boot mode is determined

The final boot mode of an ECS instance depends on the boot modes supported by both its instance type and image. The instance type defines the hardware-level limitations, while the image determines the software-level boot method.

  • Instance type boot mode: Defined by Alibaba Cloud and cannot be changed. Options include UEFI, BIOS, and support for both modes (UEFI & BIOS).

  • Image boot mode: The boot mode of a public image is defined by the system. For a custom image, you can modify the boot mode after creation or during import. Options include UEFI, BIOS, and UEFI-Preferred (the image supports both modes but prioritizes UEFI mode).

The instance type boot mode and image boot mode must match. If they are incompatible (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 boot mode

UEFI

UEFI or UEFI-Preferred

UEFI

BIOS

BIOS or UEFI-Preferred

BIOS

UEFI & BIOS

UEFI or BIOS

Matches the image boot mode.

If the image boot mode is UEFI, the final mode is UEFI.
If the image boot mode is BIOS, the final mode is BIOS.

UEFI-Preferred

UEFI

Configure boot mode

Important

When you import a custom image, Alibaba Cloud can only recognize the image's metadata; it cannot inspect or modify the bootloader configuration within the image file. Before you configure the boot mode of a custom image, make sure the image file is correctly configured with the corresponding bootloader, such as an EFI System Partition (ESP) for UEFI or a MBR partition table for BIOS. An incorrect configuration will cause the instance to fail to recognize the system disk, resulting in a startup failure.

Specify boot mode during import

Console

  1. Go to the Images page in the ECS console. In the top menu bar, select the region where the target ECS instance is located.

  2. In the upper-right corner of the Images page, click Import Image.

    image.png

  3. In the Import Image dialog box, configure the required parameters and then select a Boot Mode.

    You cannot set the boot mode to UEFI-Preferred during image import. To enable this mode, modify the setting after the image is successfully imported.

    image

  4. Click OK.

API

When you call the ImportImage API to import a custom image, use the BootMode parameter to specify its boot mode.

Modify a custom image's boot mode

Important

To ensure the stability and consistency of existing instances, you cannot modify the boot mode of a custom image once it has been used to create an instance.

Console

  1. Go to the Images page in the ECS console. In the top menu bar, select the region where the target ECS instance is located.

  2. Click the target image ID to open the image details page.

  3. In the Basic Information section, click the image icon next to Boot Mode.

  4. In the Set Boot Mode dialog box, select a boot mode, and then click OK.

API

Call the ModifyImageAttribute API operation and use the BootMode parameter to modify the image boot mode.

FAQ

Why are some images unavailable during instance creation?

When you create an ECS instance in the console, the boot mode of the selected instance type restricts the available images. For example, if you select a security-enhanced instance type that only supports UEFI, the console filters out images that only support BIOS.

How do I view an instance type's boot modes?

Console

  1. Go to the Custom Launch page in the ECS console.

  2. On the Instance page, select the All Specifications tab and click View more specification parameters.

    image

  3. Select the Supported Boot Mode checkbox and click OK.

    image

  4. Enter the target instance type to view its supported boot modes.

    image

API

Call the DescribeInstanceTypes API operation. The SupportedBootModes field in the response indicates the boot modes supported by the instance type.

  1. Go to DescribeInstanceTypes API Explorer.

  2. In the InstanceTypeFamily or InstanceTypes parameter, enter the instance type or instance family that you want to query.

  3. Click Initiate Call.

    In the response, the SupportedBootModes field shows the supported boot modes for the specified instance type.

How do I view an image's boot mode?

Console

  1. Go to the Images page in the ECS console. In the top menu bar, select the region where the target ECS instance is located.

  2. Click the target image ID to open the image details page.

  3. In the Basic Information section, view the image's Boot Mode.

    image

API

Call the DescribeImages API operation. The BootMode field in the response specifies the image's boot mode.

How do I check if an image uses BIOS or UEFI?

Run the check on the source server used to create the image, or on a temporary instance created from the image:

  • Linux systems: Check whether the /sys/firmware/efi directory exists. If it exists, the system boots in UEFI mode.

  • Windows systems: Check the partition table type of the system disk. Open PowerShell as an administrator and run the Get-Disk command. In the output, check the PartitionStyle column. A GPT partition table corresponds to UEFI boot, while an MBR partition table corresponds to BIOS boot.

Related documentation

Import a custom image