Description: Upgrade an Amazon EC2 instance to a newer version. Upgrading to a newer instance family from t2.* to t3a.*, if Linux server
There are two methods to upgrade an earlier version of a Server running on an instance: in-place upgrade and migration (also called side-by-side upgrade). An in-place upgrade upgrades the operating system files while your personal settings and files are intact. A migration involves capturing settings, configurations, and data and porting these to a newer operating system on a fresh Amazon EC2 instance.
AWS Services:
Elastic Compute Cloud (EC2) is a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers. EC2's simple web service interface allows you to obtain and configure capacity with minimal friction.
AWS Elastic Beanstalk is an easy-to-use service for deploying and scaling web applications and services. You can simply upload your code and Elastic Beanstalk automatically handles the deployment, from capacity provisioning, load balancing, auto-scaling to application health monitoring. At the same time, you retain full control over the AWS resources powering your application and can access the underlying resources at any time.
Key Features:
Fast and simple to begin
Developer productivity
Impossible to outgrow
Complete resource control
Description of the finding:
AWS offers several sizes for every instance option, and for many users, the default behavior is to choose the largest size available. After all, you don’t know what capacity you might need in the future that incurs the cost for unused resources which drives up your monthly cost. AWS launches new instance types from time to time. The new generation instances are more affordable and have more processing power.
Recommendation:
Consider upgrading to a newer instance family from t2.* to t3a.*, if Linux server.
Use CloudWatch metrics to get a report of EC2 instances that are either idle or have low CPU utilization, basically which are driving up the cost by wasting the resources. Based on the report we can choose the appropriate instance type that suits our needs. As of now, we are going to upgrade the instance type from t2.* to t3a.* that can really lower your costs.
*Resource information Listed below*
Note: Coordinate with client to get Approval to Proceed to Remediate issue. THIS REMEDIATION WILL REQUIRE DOWNTIME.
Affected Service Dependencies:
- EC2 instances
- Elastic Load balancers
- Elastic IP
- Snapshots
Implementation Plan:
Pre Requisites:
Should have a Linux instance that is t2.*
Compute info needs to be identified; CPU/Memory/Storage
Approval Required from the client for the downtime of the instance
Check if there is a dependency on the IP address; or if Elastic IP is associated
Make sure all the configurations are noted: KMS Keys; Network related configs; IAM roles
Perform Snapshot of the t2.* instance as a backup
Current Status: (Check which Instance type is using currently)
Sign in to AWS console
Navigate to EC2 service https://console.aws.amazon.com/ec2/
Click on the Instances, under Instances in the left navigation pane
Select the instance that you want to examine
You can find the current instance type from the details shown by selecting the instance
Implementation steps:
Sign in to the AWS Management console
Navigate to EC2 service https://console.aws.amazon.com/ec2/
Click on the Instances, under Instances in the left navigation pane
Select the instance that you want to upgrade
Click on the Instance State on top and select stop Instance from the dropdown options (Note: we can not change the instance type when the instance is running)
Click on the Actions button on the top and select the Instance settings from the dropdown options
Click on the Change instance type
Change instance type window will open and then click on the down arrow, it will show all the instances types available
Select the t3a Instance type from the options shown
Click on Apply
Status after Implementation:
The instance type column of the particular EC2 instance that you changed has to show the type that you selected i.e, t3a. Follow the steps of the current status to check. Make sure the instance type that you changed(t3a) is shown in the instance type column.
Back Out Plan: (If you want to rollback to the previous type)
If you want to roll back to the previous instance type at any moment, just follow the steps that you followed in the Implementation steps section, and then in the step where we want to choose instance type, select t2.* type instance for the rollback or follow the steps below
Perform restoration of the volume from the snapshot
Sign in to AWS console; Navigate to EC2 service https://console.aws.amazon.com/ec2/
Click on snapshots under Elastic Block Storage, in the left navigation pane
Select the snapshot that needs to restore from the list of snapshots available in your account and click on the Actions dropdown button and then click on create Volume
Total Cost Savings(Yearly)
Pricing examples
Product Details - t2.*
t2 instances are a low-cost, general-purpose instance type that provides a baseline level of CPU performance with the ability to burst above the baseline when needed. With On-Demand Instance prices starting at $0.0058 per hour
Name | vCPUs | RAM (GiB) | CPU Credits/hr | On-Demand Price/hr* | 1-yr Reserved Instance Effective Hourly* | 3-yr Reserved Instance Effective Hourly* |
---|---|---|---|---|---|---|
t2.nano | 1 | 0.5 | 3 | $0.0058 | $0.003 | $0.002 |
t2.micro | 1 | 1.0 | 6 | $0.0116 | $0.007 | $0.005 |
t2.small | 1 | 2.0 | 12 | $0.023 | $0.014 | $0.009 |
t2.medium | 2 | 4.0 | 24 | $0.0464 | $0.031 | $0.021 |
t2.large | 2 | 8.0 | 36 | $0.0928 | $0.055 | $0.037 |
t2.xlarge | 4 | 16.0 | 54 | $0.1856 | $0.110 | $0.074 |
t2.2xlarge | 8 | 32.0 | 81 | $0.3712 | $0.219 | $0.148 |
*Prices shown are for Linux/Unix in US East (Northern Virginia) AWS Region. Prices for 1-year and 3-year reserved instances are for "Partial Upfront" payment options or "No upfront" for instances without the Partial Upfront option. For full pricing details, see the Amazon EC2 pricing page.
Product Details - t3a.* instances
The t3a.* instances feature AMD EPYC, 7000 series processors, with an all-core turbo clock speed of 2.5 GHz. The AMD-based instances provide additional options for customers that do not fully utilize the compute resources and can benefit from a cost savings of 10%.
$Name | vCPUs | Memory (GiB) | Baseline Performance/vCPU | CPU Credits earned/hr | Network burst bandwidth (Gbps) | EBS burst bandwidth (Mbps) | On-Demand Price/hr* | 1-yr Reserved Instance Effective Hourly* | 3-yr Reserved Instance Effective Hourly* |
---|---|---|---|---|---|---|---|---|---|
t3a.nano | 2 | 0.5 | 5% | 6 | 5 | Up to 2,085 | $0.0047 | $0.0028 | $0.0019 |
t3a.micro | 2 | 1.0 | 10% | 12 | 5 | Up to 2,085 | $0.0094 | $0.0056 | $0.0038 |
t3a.small | 2 | 2.0 | 20% | 24 | 5 | Up to 2,085 | $0.0188 | $0.0112 | $0.0075 |
t3a.medium | 2 | 4.0 | 20% | 24 | 5 | Up to 2,085 | $0.0376 | $0.0224 | $0.0150 |
t3a.large | 2 | 8.0 | 30% | 36 | 5 | Up to 2,780 | $0.0752 | $0.0449 | $0.0301 |
t3a.xlarge | 4 | 16.0 | 40% | 96 | 5 | Up to 2,780 | $0.1504 | $0.0898 | $0.0602 |
t3a.2xlarge | 8 | 32.0 | 40% | 192 | 5 | Up to 2,780 | $0.3008 | $0.1796 | $0.1203 |
Reference:
https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/ce-rightsizing.html