I changed my Linux instance type to C5 or M5 and now it won’t boot. How do I fix that?
Our Linux instance might not boot after you change its type to C5 or M5 for the following reasons:
- The enhanced networking adapter (ENA) enaSupport attribute is disabled for the instance.
- The Elastic Network Adapter module is not installed on the instance.
- The NVMe module is not installed on the instance, or, if installed, the NVMe module is not loaded in the initramfs image of the instance.
- You are trying to mount the file systems at boot time in the
/etc/fstabfile using a device name. 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.
You can remedy these issues by taking steps to be sure that ENA is enabled, and that your Linux instance meets the C5 or M5 module and file system mounting requirements.
How to resolve ?
Be sure that ENA is enabled
To be sure that ENA is enabled, see Instance Attribute (enaSupport) under Testing Whether Enhanced Networking with ENA is Enabled. If ENA is disabled, use the modify-instance-attribute action to enable ENA support. For detailed steps, see To enable enhanced networking with ENA (EBS-backed instances) under Enabling Enhanced Networking with ENA on Amazon Linux.
The c5_m5_checks_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 intiramfs image.
- Verifies if ENA module is installed on your instance
- Analyzes the
/etc/fstaband 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 c5_m5_checks_script:
- Take a snapshot of your volume or create an AMI of an instance before making any changes so that you have a backup.
- Change your instance type to its original type.
- Place the script on your instance and make it executable:
- Download the script file
wget -O c5_m5_checks_script.sh https://raw.githubusercontent.com/awslabs/aws-support-tools/master/EC2/C5M5InstanceChecks/c5_m5_checks_script.sh
- Then make the file executable
chmod +x c5_m5_checks_script.sh
- Download the script file
- Run the script as a “root” user or “sudo”:
- At the prompt, type y or n (or No) to regenerate and modify your current
/etc/fstabfile to replace the device name of each partition with its UUID. Type y if you want the script to rewrite the current
/etc/fstabfile. The original fstab file is saved as
/etc/fstab.backup.$(date +%F-%H:%M:%S)For example,
/etc/fstab.backup.2018-05-01-22:06:05Type n or No to print the correct
/etc/fstabfile in the output, but not replace it. If everything is fine, you will receive the following output:
------------------------------------------------ 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. ------------------------------------------------
- After all the requirements are met, change the instance type to C5 or M5.
After you’re done with step above you might be give a try with diassociate Elastic IP to your current instance into the new instance, We recommend you make an image and deploy as new instance to make sure minimum downtime for your services.