How ephemeral (short lived) is the IP on a gcloud Compute Engine?

grabbag asked:

VM instance details report the external IP is ephemeral.
Dictionary says this means “lasting for a very short time”.

Does anyone know how short?
Static enough to aim DNS to this?
If not very short, how does one get a less temporary IP address for
a gcloud compute engine instance?

My answer:

The IP address remains attached to the VM until you stop it. If you reboot the VM, you will get a new ephemeral IP address.

From the documentation:

Ephemeral external IP addresses are available to VM instances and forwarding rules. Ephemeral external IP addresses remain attached to a VM instance only until the VM is stopped and restarted or the instance is terminated. If an instance is stopped, any ephemeral external IP addresses assigned to the instance are released back into the general Compute Engine pool and become available for use by other projects. When a stopped instance is started again, a new ephemeral external IP address is assigned to the instance.

If you need an IP address to last longer than that, you need to reserve a static external IP address and attach it to that VM. It will remain attached to that VM until explicitly detached, or the VM is deleted.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.