How to change an AWS C3 instance to C5

Published on September 16, 2018
Share this on

The C5 instance type is in general about 15-20% lower in cost than the older C3 instance type across hourly pricing. The C5 also has better CPU, slightly more memory, however, if you try to change the EC2 type by following the steps of (Stop instance –> Change type –> Start instance) you will get presented with an error like:

“The requested configuration is currently not supported. Please check the documentation for supported configurations.”

This tends to be the case for migrating many older instance types to the newer, like a T1 or M1 to T2, M1 or M3 to an M5, a G2 to G3 and other such previous generations. In this article will go through the steps to overcome this issue, get the savings associated with newer generation classes and migrate specifically a C3 to a C5 instance type. The error screen looks like:
Older to newer generation migration

Due to various changes in the infrastructure, it is not so easy to just change the instance type and start. By changes, I refer to:

  • Classic EIP doesn’t work with newer models so the EIP needs to be migrated to VPC;
  • Kernel module required on the EC2 to be loaded in order to take advantage of ENA (Enhanced network);
  • ENA needs to be enabled on the AMI;
  • EC2 needs to be part of a VPC on any new generation EC2;

In this example, we are going to convert an instance from C3 type to C5. The steps here apply to Linux based systems, and Windows OS should follow similar equivalent steps.

  1. Login via ssh on the EC2 and make sure you have the latest kernel and that the ena kernel module is present.To verify just run:

    root@tracker3:~# lsmod | grep ena
    ena 86016 0

    If it returns ena (Enhanced Network Adapter) enabled then all is good. More details on ENA can be found here. If ena is not enabled refer to resizing EC2 steps and step 5 of this article on how to alter this.

  2. If ena is enabled then stop the C3 instance;
  3. Identify the root volume by going to Details tab of the EC2, then click on the EBS ID;identify root volume of C3 instance
  4. Once on the Volumes page select Create a snapshot on that EBS;Create a snapshot of root volume
  5. Once the snapshot is created use the AWS CLI to create an AMI image. I recommend using the AWS CLI because this way you can also enable ENA (Enhanced networking) for that AMI. There is no option to do this from the AWS Console. All newer generation EC2 require to have ENA enabled. To enable ena on the image run:

    aws –region ap-southeast-2 ec2 register-image –architecture x86_64 –description NEWS-AMI –name NEWS-September –sriov-net-support simple –ena-support –virtualization-type hvm –block-device-mappings ‘[{“DeviceName”: “/dev/sda1″,”Ebs”: {“SnapshotId”: “snap-xxxxx”}}]’ –root-device-name /dev/sda1

    Replace snap-xxxxx with your snapshot id. This will output an AMI ID.

  6. Next step involves moving the Classic IP to a VPC. First, pick the EIP and dissociate it from the EC2 then Actions->Move to VPC Scope then confirm by selecting Move Elastic IP;C3 to C5 move to VPC
  7. At this point, you should be able to start a new EC2 using the AMI ID from step 5.
    The process is the same for starting a new EC2.

One other aspect that needs to be mentioned is that if you have other EBS attached to the EC2 then you need to ensure attaching them on to the new instance that you just started as a C5 type. Additional details on creating an AMI from your snapshot and resizing your EC2 instance type may be helpful.

If you encounter an issue where you had issues with step 1 – 7 please reach out to us or add a comment and will add this to the FAQs on changing EC2 instance types. If you would like to partner with us and develop AWS open source scripts for these steps, reach out to us.

Download the whitepaper that explains why cloud capacity planning needs a different thought process from traditional on-premise infrastructure.

We wont spam you or sell your email address

Learn more