Elastic IP needed to be "re-associated" after stop/start

1.8k views Asked by At

I had an issues with my AWS EC2 instance today. It was hanging with cpu at 100%...not sure why, but that's for another post.

I stopped the instance, and restarted it. After that, I couldn't get to my website. The Public DNS changed (I think this is normal as amazon may have moved me to another machine). I then looked at Elastic IP, and the entry is still there, but in the 'Instance' column, it was blank. I had to click 'Associate Address' and set the instance.

Is this normal? I was under the impression that Elastic IP should not need to be touched even after a stop/start. Did something go wrong? Is there something I can to find out why this happened?

1

There are 1 answers

1
helloV On BEST ANSWER

Is the instance in EC2 classic or EC2 VPC?

The elastic IP is disassociated when you stop the instance in EC2-Classic, but is retained in EC2-VPC. So I assume your instance is in EC2-Classic, where the elastic IP is disassociated when the instance is stopped. You need to re-associate when you start the instance.

For more info

EC2-Classic: We disassociate any Elastic IP address (EIP) that's associated with the instance. You're charged for Elastic IP addresses that aren't associated with an instance. When you restart the instance, you must associate the Elastic IP address with the instance; we don't do this automatically.

EC2-VPC: The instance retains its associated Elastic IP addresses (EIP). You're charged for any Elastic IP addresses associated with a stopped instance.