I changed my Amazon Elastic Compute Cloud (Amazon EC2) Linux instance to a Nitro-based instance type, and now it doesn't boot.
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 turned on and that your Linux instance meets the Nitro-based instance module and file system mounting requirements.
Or, you can also run the AWSSupport-MigrateXenToNitroLinux Systems Manager Automation runbook. This runbook migrates an Amazon EC2 Linux Xen without manual configuration. For more information, see AWSSupport-MigrateXenToNitroLinux.
Make sure that ENA is turned on
1. To confirm that ENA is turned on, see Test whether enhanced networking is turned on, and then follow the instructions under Instance Attribute (enaSupport).
2. If ENA isn't turned on, run the modify-instance-attribute action. For more information, see Turn on 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 that the NVMe module is installed on your instance. If it is installed, then the script verifies that the module is loaded in the initramfs image.
- Verifies that 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
Note: For more information on the ENA driver on Red Hat, see How do I install and activate the latest ENA driver for enhanced network support on an Amazon EC2 instance running Red Hat 6/7?
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 for the script to regenerate and modify the /etc/fstab file, and then 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.