How to change an AWS EC2 instance type – A step-by-step guide

Published on August 15, 2018
Share this on

Depending on your EC2 utilization you can discover if an instance is either under-utilized or over-utilized. If you are in one of the two cases then you can easily change the type, for example from a t2.small to a t2.medium or the other way around.

In order to resize an EBS backed instance the following steps need to be taken:

  1. Take a snapshot of the existing root volume;
  2. Plan the migration to happen during off-peak hours;
  3. Verify if the current instance has all needed drivers to run as newer models require different drivers, see the section under limitations.
  4. Go to AWS EC2 Console and pick Instances;
  5. Choose Actions, select Instance State then Stop;In AWS console stop an instance
  6. In the confirmation box choose Yes, Stop;Stopping an EC2 instance
  7. Having the instance select go to Actions -> Instance Settings -> Change Instance Type;Change the EC2 instance type
  8. In the next screen pick the desired Instance Type (e.g t2.large) then select Apply;select the instance type
  9. To restart the stopped instance, select the instance, choose Actions, select Instance State, and then choose Start;

Changing a running AWS EC2 instance type from a C or an M class to a T class takes just minutes! Get 15-55% cost savings by sizing to what you can consume now, rather than on speculative capacity planning or reserving an idle instance for 3 years!

Limitations

In order to properly resize from one instance type to another there are some prerequisites that need to be validated especially when changing from an older generation to a newer generation EC2 instance type:

  • Check virtualization type: There are two types of virtualization, HVM (hardware virtual machine) and PV (paravirtual). You need to make sure that same virtualization type is being used otherwise you won’t be able to migrate from a PV virtualization to an HVM one. Virtualisation type can be seen in Console-> EC2->Instances then pick desired EC2 and under Description, tab look for Virtualization;Where to check HVM or PV
  • Classic IP type: Newer instance types require to be run a VPC. If you are using an EC2 Classic IP then you won’t be able to switch to newer models (C5, M5, T2) that require it to be run inside a VPC. At this step, it might be required to move an existing Elastic IP to a VPC. In Description tab look to see if that instance has a VPC attached if none then it means that involved instance uses EC2 Classic IP;Are you using classic IP
  • Enhanced Networking: Newer models require that “ena” is enabled. Ena stands for enhanced networking and normally its a kernel driver that needs to be loaded. Newer kernels already have it so the only thing that needs to be done is to enable Ena on the image. Check ENA drivers. The only way to verify if this is enabled is by CLI.check if you are using ENA

If you discover your current instance has one of these limitations please check the FAQs below.

My instance type uses an HVM and I need to resize this to a PV instance. How do I make this change?

HVM is preferred and recommended virtualization type and it is rare that you would need to change to a Paravirtual type. The instructions for changing from paravirtual to HVM are here.

My instance type uses an PV virtualization type and I need to resize this to an HVM instance type. How do I make this change?

AWS encourages you to migrate to HVM type to gain improved security, new features, and performance benefits. The specific steps to perform this migration from a paravirtual to a preferred HVM type can be found here.

I am scaling EC2 up to an ena enabled EC2 type. How do I do this?

Enhanced networking support (ena) is recommended and a feature of the newer generation system types. Follow these steps to enable ena support if your EC2 does not have support for ena.

 

For windows based EC2 check if you are using an instance store volume in addition to the above. In this video below watch the steps to check if an instance store volume is used and how to go through the similar steps to change an EC2. Though this AWS video shows you how to scale up, the process to scale down is the same.

If you encounter an issue where you had issues with step 1 – 9 please reach out to us or add a comment and will add this to the above FAQs. 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