- Newest
- Most votes
- Most comments
If you're using the console:
- Stop the instance by selecting it then go to the "Instance state" menu and choose "Stop instance". Note that this doesn't terminate (delete) the instance, it only shuts it down.
- Change the instance type in the "Actions" menu by choosing "Instance settings" and then "Change instance type".
- Restart the instance from the "Instance state" menu by choosing "Start instance".
This is commonly known as "vertical scaling" - changing the size of the instance to be larger or smaller. Horizontal scaling adds (and removes) instances from the fleet which is done using auto-scaling.
First part of your question, the answer would be no, because if you go "Action" menu, the drop dwon menu "Change instance type" is deemed.
Before configuring "Auto Scaling Groups", you need to configure "Target Groups", if the instance is "Stopped" state you will not see any instance on the "Target Groups" console.
With my understanding, first you stop the instance, change the instance type, restart the instance and configure the "Target Groups" as well as "Auto Scaling Groups". But you can attach the instance when it is running, if you have any auto scaling group. Look if you have load balancer - the answer would be different.
Every question has its own merit, and explanation.
Please do not forget to update your public IP address (in case of auto enabled IP) in Route 53, if your instance has any website configuration after restarting.
I am sorry to mention, please create a snapshot, before you do any changes.
EC2 AutoScaling is designed for horizontal scaling (adding and removing instances), not vertical scaling (changing the size of existing instances). EC2 doesn't support updating the instance size for a running instance, so it has to be stopped to change the size. Do NOT stop an instance in an AutoScaling Group (ASG), or it will most likley end up being marked as unhealthy and replaced (terminated).
If you aren't using an ASG and want to vertically scale, here's an example solution for it (but there is downtime for the stop/start) https://aws.amazon.com/blogs/architecture/aws-ops-automator-v2-features-vertical-scaling-preview/
Relevant content
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
Quick note since AutoScaling was mentioned: If the instance is in an ASG, there is a strong chance the ASG will see the instance as no longer running and terminate/replace it (unless the stop/start is very fast with lucky timing)
Thanks, my linux server got stuck, and this method helped to relieve, upgrade and restart server