0

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?

Jason
  • 1,787
  • 4
  • 29
  • 46
  • possible duplicate of [EC2 Instances will not keep elastic IP](http://stackoverflow.com/questions/21609323/ec2-instances-will-not-keep-elastic-ip) (this is normal behavior for EC2 instances in EC2-classic) – Anthony Neace Dec 03 '14 at 18:34

1 Answers1

3

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.

helloV
  • 50,176
  • 7
  • 137
  • 145
  • 1
    Be careful with the word *released*: The EIP gets disassociated, but isn't released (put back into the pool of all available EIPs and it's highly unlikely that you'll ever get back that specific one). If you have disassociated an EIP you can then (manually) release it – xeraa Dec 05 '14 at 01:23