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
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.
aws ec2 reboot-instances --instance-ids {InstanceID}
modinfo ena
It should be displayed in various ways unlike the previous one.
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
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