Hi,
Based on the documentation of ephemeral IP addresses, I know that an ephemeral IP address should be released on termination of resource unless it's reserved.
With that being I would like to take advantage of using ephemeral external IP addresses, but after some tests I see that a vm that had been created after the previous one's termination takes the same external IP address.
Also couldn't figure out any release time of ephemeral external IP address, as it gives me the same external IP address which I used and terminated an instance from previous day.
I am sure that I have no reserved IP addresses that can potentially use on my vm's.
Could you help me to understand if this is an expected behaviour by design or is there any solution to use make vm get a new ephemeral external IP address which will be different from the previous one?
thanks.
Hi @rumai ,
When you finish using a virtual machine and start a new one, the new machine might get the same external IP address as the old one. This happens because the system assigns these IP addresses from a common pool. When you close a virtual machine, its IP address goes back to the pool. So, when you launch a new virtual machine, it could get an IP address from that same pool, potentially being the one used by the previous machine.
Try releasing the IP address manually if it is still associated or using the previous IP adddress:
gcloud compute instances delete INSTANCE_NAME --delete-disks=all
Using the gcloud
command above, manually release the ephemeral external IP address from the previous instance. It may take some time for the released IP address to be returned to the pool and become available for allocation.
You may find this community discussion helpful as it is related to your inquiry.
Hope this answers your question.