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?