Skip to content

Is it possible to change instance type without terminating and creating new instance? What is the difference?

0

I currently have an instance which is t3.medium and want to see if I can downgrade to t3.small for cost purposes.

Currently my instance is running with an ebs volume size 20 Gib, and that is because my instance is running a docker compose and with docker images stored in there so I do need some space. Would downgrading to t3.small reduce space on my instance for my app?

Im wondering is it possible to downgrade without having to terminate and start a new instance all over again (which I want to avoid since if I were to start a new instance I would have to set it up again which takes time)? or is there some steps I can take to do this carefully without terminating? If there is a specific checklist I should go through before I do this please do tell.

Any help is much appreciated, thanks.

asked a year ago618 views

2 Answers
0

Yes, it is possible to change your EC2 instance type from t3.medium to t3.small without terminating and creating a new instance, as long as your instance is EBS-backed (which yours is). This process is called "resizing" an instance.

Here's how to change your instance type:

  1. First, back up your data as a precautionary measure.
  2. Stop your EC2 instance (this is required as you cannot change the instance type while it's running).
  3. Once the instance is stopped, select it in the EC2 console.
  4. Go to "Actions" > "Instance Settings" > "Change Instance Type".
  5. In the "Change Instance Type" dialog, select "t3.small" as the new instance type.
  6. Click "Apply" to confirm the change.
  7. Start your instance again.

Alternatively, you can use the AWS CLI to modify the instance type with the following command (while the instance is stopped):

aws ec2 modify-instance-attribute --instance-id your-instance-id --instance-type "{\"Value\": \"t3.small\"}"

Regarding your EBS volume size concern: Downgrading from t3.medium to t3.small will not affect your EBS volume size. The 20 GiB EBS volume will remain the same size regardless of the instance type change. Instance type changes only affect compute resources (vCPUs and memory), not storage. Your Docker images and data stored on the EBS volume will be preserved.

The main differences between t3.medium and t3.small are:

  • t3.medium: 2 vCPUs, 4 GiB memory
  • t3.small: 2 vCPUs, 2 GiB memory

Before proceeding with the change, verify that your workload can run with less memory. If your Docker containers and applications require more than 2 GiB of memory, you might experience performance issues after downgrading.

The instance will retain all its configuration, data, and settings after the change. Your IP address might change unless you're using an Elastic IP address.
Sources
Change EC2 instance type | AWS re:Post
Amazon EC2 instance type changes - Amazon Elastic Compute Cloud
Use ModifyInstanceAttribute with a CLI - Amazon Elastic Compute Cloud
How I can change my server? | AWS re:Post

answered a year ago

EXPERT

reviewed a year ago

EXPERT

reviewed a year ago

0

Instance size and EBS volume size are separate. You can modify both without impacting the other. To modify EC2:

  • Stop the instance
  • From console or CLI, change instance type / size (higher or lower size doesn't matter)
  • Start the instance.

To increase EBS volume size:

  • No need to stop instance
  • Open volume in console
  • State new size (has to be higher than current)

To decrease EBS volume size is not directly possible and requires more effort. If you need help with that, let me know.

EXPERT

answered a year ago

EXPERT

reviewed a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.