I have a few EC2 t2 instances, some of them are micro, and some are small and medium. All of these EC2 machines are accessible on port 22 via SSH.
Following are the specifications of my t2 machines:
- OS Ubuntu 14 or Ubuntu 16
- EBS attached
- Type classes are t2 micro, small, medium
- SSH access is given via port 22 in security group inbound rules.
I have decided to upgrade these machines to t3 or t3a class instances to save some cost. I have followed these steps as per the documentation:
- Stop the instance
- Instance Settings -> Change Instance type to t3
- Start the Instance
Everything works fine, no error anywhere in these 3 steps. But after the instance is in the Running
state with both system and instance checks
passed, I am not able to SSH on these machines. Error is
ssh: connect to host machine_ip_here port 22: Connection refused
Then I tried the following methods:
- Revert the class type from
t3 to t2
again, and SSH starts working. - Created a new t2 machine with the latest OS (Ubuntu 22) and upgrade that to t3, and SSH was working fine after the upgrade.
- Created a new t3 machine, and verify SSH is working, detach its EBS, and then detach the root EBS of my t2 machine and connect it to the t3 new machine, SSH stop working.
What exactly is missing here?
2
Answers
Restarting a EC2 instance might make this EC2 instance’s IP change, please check if IP is the same first.
Before any actions, I would check the Instance log screenshot to verify that the instance boot process finished successfully. Also, check compatibility to understand if your resizing options make sense https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/resize-limitations.html
When encountering the issue of not being able to SSH into an EC2 t3 instance after upgrading from t2, two things need to be checked:
group allow access on port 22 from the new IP address.
are enabled.
In general, I suggest checking these two troubleshooting articles to get a better idea what might go wrong with boot process.