A comprehensive guide to EC2 instance options in AWS

Discuss on Status Check, how to protect instances from termination, and scaling (scale-up/scale-down and scale-out/scale-n)

In this blog post, we will explore the various EC2 instance options available in AWS and help you choose the best one for your workload.

We will start by explaining the

Status Check

Once we launch an EC2 instance on AWS, and after clicking on it there is showing one tab which is the status check

What is the meaning of 2/2 checks passed?

This means, out of 2 checks, 2 checks are passed.

in general, it's like out of 100 marks get 100 marks in academics.

So, one check for the Physical System Status Check

and another one, for Instance Status Check

Let's see how it's done

Explanation of the Above Diagram: -

When we launch the EC2 instance, the Instance will be created in any particular region. There are different availability zones in any region. In one of the availability zones EC2 instances will be created.

In backend operation, AWS has physical servers with good configuration, and using Hypervisor AWS created multiple virtual machines, in AWS terminology we called an EC2 Instance.

The first check is verifying on the physical level (CPU, RAM, HDD, Adapters, etc. ), if there is no issue with the hardware it will pass the first check otherwise it will fail.

And the second check is applied when the virtual machine is created using the hypervisor. Once the Virtual machine is created successfully then it passes the check otherwise it shows the fail status.

How to identify the status check issue?

If it's showing 1/2 checks passed that means the issue with the instance.

And if 0/2 checks passed then the issue is with AWS infrastructure (Physical Server).

To get more information about status checks

How to resolve the issue?

If such an issue occurs, AWS recommended rebooting the system from the action task.


Protect EC2 Instances from termination

Once the EC2 instance is terminated, there is NO WAY to recover it.

So, we have to protect our EC2 instance from accidental termination.

How do we check the accidental termination policy is enabled?

as per the above image, we can terminate the EC2 instance which means the policy is disabled.

How to enable an accidental termination policy?

Follow the below steps

click on enable check box and save it

After that reload the page

Verification

If we are trying to terminate the instance it will show the error message below

This is how we can protect our EC2 instance from accidental termination.


Scaling

In a previous blog we learned a lot about scaling in AWS the link is below

https://hashnode.com/post/clfgie3v2001l09ld3tx16z6k

In scaling, there are two types of scaling operations

  1. Vertical scaling (Scale-up & Scale-down)

  2. Horizontal scaling (Scale-In & Scale-Out)

Vertical Scaling (Scale-up & Scale-down)

The above diagram clearly understand that is what are Vertical Scaling and the term Scale-up and Scale-down

Suppose, we have an EC2 instance, and we require to increase the resources such as RAM, HDD, or CPU, the increase of resources is called as Scale-Up

And decreasing the resources from the existing instance process is called as Scale-Down

How to do Vertical scaling on an AWS EC2 instance?

We are not adding RAM and CPU separately. If we have to increase, then we have to go through the Type of Instance, where the AWS provides the possible combination of CPU and RAM.

  1. Increasing the RAM and CPU

To perform Scale-up and Scale-down first we have to stop the instance

  1. Increasing the Storage

    The root size of any O.S is not decrease

    For Linux instance = 8GB (minimum)

    For Windows Instance = 30GB (Minimum)

We can increase the volume but NO option to shrink the volume

Steps to increase the EBS storage

Note:- Vertical scaling, we have to perform manually

Horizontal Scaling (Scale-In & Scale-Out)

In the Auto-scaling group when the CPU utilization is above the threshold value then it automatically adds the instance as per the instance template.

The process of adding a new instance is called Scale-out.

The process of removing the instance is called Scale-In

To get more information please go through the below link

https://hashnode.com/post/clfgie3v2001l09ld3tx16z6k

Note: - Horizontal scaling is done automatically

By the end of this post, you will better understand the EC2 instance options available in AWS and be equipped with the knowledge to make an informed decision for your use case.

Thank You for reading my blog!