Enabling ENA support on your AWS EC2
Idris Rampurawala

Idris Rampurawala @idrisrampurawala

About: A Full Stack Developer specializes in Python (Django, Flask), Go, & JavaScript (Angular, Node.js). Experience designing, planning, and building complete web applications with backend API systems.

Location:
Toronto, Canada
Joined:
Jan 22, 2019

Enabling ENA support on your AWS EC2

Publish Date: Oct 12 '19
10 9

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 😋

Comments 9 total

  • Thomas H Jones II
    Thomas H Jones IIOct 12, 2019

    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).

    • Idris Rampurawala
      Idris RampurawalaOct 13, 2019

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

      • Thomas H Jones II
        Thomas H Jones IIOct 14, 2019

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

  • Shabin Muhammed
    Shabin MuhammedFeb 5, 2020

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

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

    • Idris Rampurawala
      Idris RampurawalaFeb 5, 2020

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

  • paul-kelly
    paul-kellyMay 31, 2020

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

    • Idris Rampurawala
      Idris RampurawalaMay 31, 2020

      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. 😉

      • paul-kelly
        paul-kellyMay 31, 2020

        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)

Add comment