Why is my Linux instance not booting after I changed its type to a Nitro-based instance type?

Last updated: 2020-03-19

I changed my Amazon Elastic Compute Cloud (Amazon EC2) Linux instance to a Nitro-based instance type, and now it doesn't boot.

Short Description

Here are some common reasons why a Linux instance might not boot after you change it to a Nitro-based type:

  • The Elastic Network Adapter (ENA) enaSupport attribute is disabled for the instance.
  • The ENA module isn't installed on the instance.
  • The NVMe module isn't installed on the instance, or, if installed, the NVMe module isn't loaded in the initramfs image of the instance.
  • You are trying to mount the file systems at boot time in the "/etc/fstab" file using a device name. Amazon Elastic Block Store (Amazon EBS) volumes are exposed as NVMe devices to these instance types, and the device names are changed. To avoid this, mount the file systems using UUID/Label. For more information, see Amazon EBS and NVMe on Linux Instances.

To resolve these issues, confirm that ENA is enabled and that your Linux instance meets the Nitro-based instance module and file system mounting requirements.


Be sure that ENA is enabled

1.    To confirm that ENA is enabled, see Testing Whether Enhanced Networking Is Enabled follow the instructions under Instance Attribute (enaSupport).

2.    If ENA is disabled, run the modify-instance-attribute action. For more information, see Enabling Enhanced Networking on the Amazon Linux AMI.

Run the NitroInstanceChecks script

The NitroInstanceChecks script checks your instance and provides a pass/fail status of these requirements:

  • Verifies if the NVMe module is installed on your instance. If yes, then the script verifies that the module is loaded in the initramfs image.
  • Verifies if the ENA module is installed on your instance.
  • Analyzes /etc/fstab and looks for block devices being mounted using device names.

This script is supported on the following OS versions:

  • Red Hat derivatives: Red Hat Linux, Red Hat Enterprise Linux, CentOS
  • Amazon Linux, Amazon Linux 2
  • Debian derivatives: Debian, Ubuntu

To run the NitroInstanceChecks script:

1.    Take a snapshot of your volume or create an Amazon Machine Image (AMI) of an instance before making any changes so that you have a backup.

2.    Change your instance type to its original type.

3.    Download the script to your instance and make it executable:

# chmod +x nitro_check_script.sh

4.    Run the script as a root user or sudo:

# sudo ./nitro_check_script.sh

5.    At the prompt, type y or n (or No): Type y if you want the script to regenerate and modify the /etc/fstab file and replace the device name of each partition with its UUID. The original fstab file is saved as /etc/fstab.backup.$(date +%F-%H:%M:%S). For example, /etc/fstab.backup.2019-09-01-22:06:05. Type n or No to print the correct /etc/fstab file in the output, but not replace it.

A successful output looks like this:

OK  NVMe Module is installed and available on your instance
OK  ENA Module is installed and available on your instance
OK  fstab file looks fine and does not contain any device names.

6.    After all the requirements are met, change the instance to a Nitro-based instance type.

Did this article help?

Do you need billing or technical support?