Solved – Upgrading AWS EC2 instances from M4 to M5 type

AWS had recently launched M5 instance type; which are essentially upgrade to M4 instances. We wanted to use the latest instances so we decided to upgrade our server infrastructure.

But it’s a tricky processes then we had anticipated and AWS documentation has tooo much information. Here are the steps we took:

    • Before you start – Create an image of your current system
    • Assumption – You have an active M4 instance
    • Check if ENA (Elastic Network Adapter) support is available on your machine. This is must for M5 instance. From your local console (assumption aws cli has been installed)

      aws ec2 describe-instances --instance-ids instance_id --query "Reservations[].Instances[].EnaSupport"

      If you get empty response then it means it’s not enabled.

      []

    • Stop Instance

      aws ec2 stop-instances --instance-id ${INSTANCE_ID}

    • Add ENA support

      aws ec2 modify-instance-attribute --instance-id ${INSTANCE_ID} --ena-support

    • Do step 3. Now if you see following response then you are all set for upgrade.

      [true]

    • Modify your instance type.

      aws ec2 modify-instance-attribute --instance-id ${INSTANCE_ID} --instance-type "{\"Value\": \"m5.large\"}"

    • Now boot your instance

      aws ec2 start-instances --instance-id ${INSTANCE_ID}

    • Now check on the instance

      [ec2-user ~]$ ethtool -i eth0
      driver: ena
      version: 1.5.0g

      If you spot ‘ena’ in the description then your upgrade was successful.

Source: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/enhanced-networking-ena.html#test-enhanced-networking-ena

Leave a comment

Your comment

*