Do ephemeral IP addresses remain the same if you don't stop the server manually?

631 views
Skip to first unread message

Bruno Vincent

unread,
Feb 26, 2022, 8:45:14 PM2/26/22
to gce-discussion
I want to use the free tier to host some case studies from website prototypes, WP instances.

Now I use the ephemeral IP addresses for that, and I realize that if you restart, they IP changes.

But if I don't touch anything and let it run, will it change, maybe if server crashes accidentally or for updates etc...?

osaeed

unread,
Feb 28, 2022, 12:43:09 PM2/28/22
to gce-discussion

Hello,

You are correct. As long as the machine stays up the ephemeral external IP will be assigned to it. Ephemeral external IP addresses are released from a resource if you delete the resource. For VM instances, the ephemeral external IP address is also released if you stop the instance. After you restart the instance, it is assigned a new ephemeral external IP address[1].


[1]https://cloud.google.com/compute/docs/ip-addresses#ephemeraladdress

Bruno Vincent

unread,
Apr 20, 2022, 10:46:24 PM4/20/22
to gce-discussion
Thanks,

Now if I don't restart the machine, ever, will it restart on it's own for maintenance and IP address will change?

Derek Murphy

unread,
Apr 21, 2022, 11:27:37 AM4/21/22
to gce-discussion

If you wish to make sure that your VM’s ephemeral IP address is the same after a maintenance event I would suggest that you set the VM to live migration (this is the default setting). See these links[1][2][3][4] for more information.



[1] Maintenance events : 

https://cloud.google.com/compute/docs/instances/host-maintenance-overview#maintenanceevents


[2] Live migration during maintenance events : 

https://cloud.google.com/compute/docs/instances/live-migration?hl=en


[3] Set VM availability policies : Set availability policies :  

https://cloud.google.com/compute/docs/instances/setting-instance-scheduling-options?hl=en#settingoptions


[4] Stopping, suspending, or resetting a VM : 

https://cloud.google.com/compute/docs/instances/instance-life-cycle?hl=en#stopping_suspending_or_resetting_an_instance

Reply all
Reply to author
Forward
0 new messages