[LINUX] Change AWS EC2 instance from t2 to t3

At first

I think it's okay to just change the instance type for a relatively new instance, but it is possible that the old one does not support ENA. That's exactly what I wanted to change this time. The OS was CentOS 7 series, but it was a little old, so it did not support ENA. So, we will start with ENA support.

About ENA https://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/enhanced-networking-ena.html

ENA compliance confirmation

modinfo ena

If not supported

modinfo: ERROR: Module ena not found.

Seems to come out

update CentOS can be updated with yum to support ENA

sudo yum update

This time it was an old instance, so update failed. In that case, comment out the mirror of the repo information and enable baseurl.

Instance restart

aws ec2 reboot-instances --instance-ids {InstanceID}

ENA compliance confirmation

modinfo ena

It should be displayed in various ways unlike the previous one.

ENA activation

You need to shut down the instance for ENA to take effect.

#Stop the instance
aws ec2 stop-instances --instance-ids {InstanceID}
#Check if ENA is valid
aws ec2 describe-instances --instance-ids {InstanceID} --query "Reservations[].Instances[].EnaSupport"

It's not enabled at this time, so it will probably return [].

#ENA activation
aws ec2 modify-instance-attribute --instance-id {InstanceID} --ena-support
#Check if ENA is valid
aws ec2 describe-instances --instance-ids {InstanceID} --query "Reservations[].Instances[].EnaSupport"

With confirmation here

[
    true
]

Is OK when

Change to t3

Finally change to t3

#Change
aws ec2 modify-instance-attribute --instance-id {InstanceID} --attribute instanceType --value t3.{InstanceSize}
#Start-up
aws ec2 start-instances --instance-ids {InstanceID}

It seems that I was able to change it safely.

Recommended Posts

Change AWS EC2 instance from t2 to t3
AWS EC2 2nd SSH connection to EC2 Instance (Amazon Linux2)
Did not change from Python 2 to 3
Things to note when running Python on EC2 from AWS Lambda
Seamlessly join a Linux EC2 instance to AWS Managed Microsoft AD
[Refactoring Catalog] Change from reference to value
AWS EC2 instance launch and ssh connection
[2020 version] How to install Python3 on AWS EC2
Sum from 1 to 10
Change the decimal point of logging from, to.
Creating an AWS EC2 EC2 Instance (Amazon Linux AMI) 2
Create an AWS GPU instance to train StyleNet
[AWS] Migrate data from DynamoDB to Aurora MySQL
How to terminate an AWS EC2 instance (remove security G and delete key pair)
# 2 Build a Python environment on AWS EC2 instance (ubuntu18.04)
Terraform configured to launch AWS Lambda from Amazon SQS
Deployment procedure on AWS (2) Server (EC2 instance) environment settings
From python to running instance on google cloud platform
[Python] Change standard input from keyboard to text file
Copy files directly from Amazon EC2 (Amazon linux) to S3
How to change static directory from default in Flask
[AWS EC2] How to install Maven on Amazon Linux 2
[Amazon Linux 2] Change from public key authentication to password authentication
Changes from Python 3.0 to Python 3.5
Changes from Python 2 to Python 3.0
Transition from WSL1 to WSL2
Tweet from AWS Lambda
From editing to execution
[AWS] I tried using EC2, RDS, Django. Environment construction from 1
[AWS] Install node.js on EC2 instance and execute sample program
How to launch AWS Batch from a python client app
[AWS EC2] Settings you want to do on Amazon Linux 2
Building an environment to execute python programs on AWS EC2
A quick explanation from creating AWS Lambda Layers to linking
Send a request from AWS Lambda to Amazon Elasticsearch Service
Sample script to monitor Load Average on CloudWatch on AWS EC2