DEV Community

Cover image for Enabling ENA support on your AWS EC2
Idris Rampurawala
Idris Rampurawala

Posted on • Edited on

Enabling ENA support on your AWS EC2

AWS provides a wide range of EC2 instance types for different purposes. I wanted to change one of my EC2 instances type from m4 to t3. Generally, EC2 instance type can be changed directly from the AWS console after you stop your instance. When I tried the same, guess what? I ran into this error

Enhanced networking with the Elastic Network Adapter (ENA) is required for the 't3.2xlarge' instance type. Ensure that your instance 'i-XXXXXXXXXXXXXXXXX' is enabled for ENA

As I am not an expert in networking, I did not know what is this all about. After reading out some of the AWS guide pages, I got to know that Enhanced networking provides higher bandwidth, higher packet-per-second (PPS) performance, and consistently lower inter-instance latencies. And in order to move to the latest available instance types, ENA has to be installed and enabled.

I quickly started looking for ways to enable ENA on my m4 instance so that I can move to t3 instance type. But as always, I got confused reading AWS documentation for the same. Later, was able to convert it and thought of sharing these easy steps for the needy to quickly achieve the result.

📘 NOTE
There are multiple ways of enabling ENA on EC2 instance, I will be using aws-cli for the same. Check configuring aws-cli to set up aws-cli on your local machine

1. Make sure you have installed aws-cli on your local machine and have required permission on your AWS secret to modify the EC2 instances

2. Stop the instance

$ aws ec2 stop-instances --instance-ids <your-instance-id> --region <your-region>  
Enter fullscreen mode Exit fullscreen mode

3. Check if ENA is already enabled on your EC2

$ aws ec2 describe-instances --instance-id <your-instance-id> --query "Reservations[].Instances[].EnaSupport" --region <your-region>

# if it is enabled, then you will get the following output
[
    true
]

#if it is not enabled, you will get an empty array
[]
Enter fullscreen mode Exit fullscreen mode

4. If ENA is not enabled, then run following command to enable it

# Note: following command won't return any response
$ aws ec2 modify-instance-attribute --instance-id <your-instance-id> --ena-support --region <your-region>

# Verify if above command was a success
$ aws ec2 describe-instances --instance-id <your-instance-id> --query "Reservations[].Instances[].EnaSupport" --region <your-region>  
[
    true
]
Enter fullscreen mode Exit fullscreen mode

5. Voila! Now change your instance type if not already changed from aws console, and start the instance

$ aws ec2 start-instances --instance-ids <your-instance-id> --region <your-region>
Enter fullscreen mode Exit fullscreen mode

Congratulations! 👏 You have successfully enabled ENA support on your EC2 instance with these easy steps. Leave a comment if you face any issues.

See ya! until my next post 😋

Top comments (9)

Collapse
 
ferricoxide profile image
Thomas H Jones II

ENA was part of why we went to maintaining our own AMIs: if you enable in the AMI, you don't have to worry about enabling it in the resultant EC2s (plus, if you're using a non-ENA AMI to build ENA-enabled EC2s from, it makes for a really annoying provisioning-process (create EC2 from AMI → stop EC2 → modify EC2 → restart EC2).

Collapse
 
idrisrampurawala profile image
Idris Rampurawala

Thanks Thomas for the info. Frankly, I didn't know that ENA can be enabled in AMI as well 😅😀

Collapse
 
ferricoxide profile image
Thomas H Jones II

Two key arguements to aws ec2 register-image when you want AMIs with high-speed networking:
--ena-support
--sriov-net-support simple

Thread Thread
 
idrisrampurawala profile image
Idris Rampurawala

Killer! Thanks a lot 😊

Collapse
 
paulkelly profile image
paul-kelly

If you stop the instance, how do you access the CLI - the server has stopped?

Collapse
 
idrisrampurawala profile image
Idris Rampurawala

We are not performing an ssh session here. We are using aws-cli which is setup on locally on your machine (not on server). I hope that resolves your query. 😉

Collapse
 
paulkelly profile image
paul-kelly

Idris,

thanks for the quick reply.

I was going to do a knee jerk reply and say no, but I took a deep breath and realised on W10 you installed the cli and remotely logged in.

All worked fine after, so many thanks.

BTW, I have done the same - M4 - T3(a)

Collapse
 
shabinslr profile image
Shabin Muhammed

Step 4 command should contain "--ena-support" flag

aws ec2 modify-instance-attribute --instance-id --ena-support --region

Collapse
 
idrisrampurawala profile image
Idris Rampurawala

Added. Thanks for pointing it out. Seems like I mistakenly removed it in my last edit to this post 😅