Upgrading EC2 Instance Type for Better Performance

Upgrade EC2 Instance Type

Question

You have an EC2 Instance which is an EBS backed Instance.

An application hosted on this instance is having issues.

To resolve the issue, the best bet is to upgrade the instance to a higher instance type.

How can you achieve this?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer: B.

According to the AWS Documentation, EBS-backed instances must be stopped before changing the instance type.

Options A, C and D are invalid for the scenario.

For more information on Resizing EC2 Instances, please refer to the below URL-

https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-resize.html
Resizing an Amazon EBS-backed Instance

You must stop your Amazon EBS-backed instance before you can change its instance type. When you stop and start an instance, be aware of
the following:

* We move the instance to new hardware; however, the instance ID does not change.

* If your instance is running in a VPC and has a public IPv4 address, we release the address and give it a new public IPv4 address. The
instance retains its private IPv4 addresses, any Elastic IP addresses, and any IPv6 addresses.

* If your instance is running in EC2-Classic, we give it new public and private IP addresses, and disassociate any Elastic IP address that's
associated with the instance. Therefore, to ensure that your users can continue to use the applications that you're hosting on your
instance uninterrupted, you must re-associate any Elastic IP address after you restart your instance.

* If your instance is in an Auto Scaling group, the Amazon EC2 Auto Scaling service marks the stopped instance as unhealthy, and may
terminate it and launch a replacement instance. To prevent this, you can suspend the scaling processes for the group while you're
resizing your instance. For more information, see Suspending and Resuming Scaling Processes in the Amazon EC2 Auto Scaling User
Guide.

* Ensure that you plan for downtime while your instance is stopped. Stopping and resizing an instance may take a few minutes, and
restarting your instance may take a variable amount of time depending on your application's startup scripts.

To upgrade an EC2 instance to a higher instance type, there are several options available, but the most appropriate one will depend on the specific situation and requirements. Let's analyze each answer option:

A. Directly change the instance type from the AWS Console: This is a valid option if the instance is not currently running any critical workloads, and if there are no dependencies on the instance's current state. If the instance is running an application with active user sessions, changing the instance type directly can cause downtime and session loss.

B. Stop the Instance and then change the Instance Type: This option is suitable if there is no concern about potential downtime during the instance upgrade. Stopping the instance will temporarily halt the application running on it, and any data stored on the instance's ephemeral storage will be lost. Before proceeding with this option, ensure that the instance can be stopped and restarted safely.

C. Detach the underlying EBS volumes and then change the Instance Type: This option is a good choice if the instance is running a workload that requires persistent data storage. Detaching the EBS volumes allows you to preserve the data stored on them while the instance is upgraded. After the instance upgrade, you can reattach the volumes and resume the application's operation.

D. Detach the underlying ENI and then change the Instance Type: This option is not suitable for upgrading the instance type. Detaching the ENI will result in the instance losing network connectivity, which will disrupt any workloads running on it.

In summary, the most appropriate option to upgrade an EC2 instance to a higher instance type depends on the specific requirements of the application and the desired level of downtime. Option C, detaching the underlying EBS volumes, is generally a good choice if the instance is running a workload that requires persistent data storage.