Reputation: 733
I am trying to remove/delete a static IP address that I do not use any more and do not see a way to do this. The closest I could get from documentation is this page which says:
When an instance is stopped, you can still perform actions that can affect the stopped instance, such as:
- [...]
- Removing or setting a new static IP
P.S. Thanks for pointing me in the right direction. If anyone would like to take a quick glimpse on how to do this here is a short video on how and why it's a good practice to release the IP if not in use. Hope that helps.
Upvotes: 14
Views: 21948
Reputation: 31
I can't comment, so I'll answer here:
You need to specify if you're talking about external or internal IP addresses. The method varies on the use-case.
Also: the solutions just include external IP addresses.
For the sake of being thorough (and not everyone has fast internet for videos), here the second use case:
For static internal IP addresses you need to go into the VM instance and release the static binding to make the IP ephemeral again. The IP will still be in use, but after a reboot it is back in the pool of ephemeral addresses. It might be though, that the same IP will be attached by chance.
The KB entry on this specific case is here.
The main article for external static IPs
The main article for internal static IPs
Upvotes: 3
Reputation: 129
I did face the similiar kind of issue. The solutions referred to select the ip address and click the release ip address button. But the button was not visible. Hence tried the command line way to delete the ip address.
Get the list of ip addresses for the project
Run the delete ip address command. One thing to keep in mind is the region, if the prompt does not show the correct region, say No and then select the number for your region.
After the ip address is deleted see the message as below
Upvotes: 0
Reputation: 1436
You can also do it via the Web interface. In left menu, go to "Networking", then "External IP Addresses".
You can manage your current projects IP's from there.
Link to Google group thread I found this info on
Upvotes: 9
Reputation: 13424
Per the Google Cloud networking docs:
Release a static external IP address
gcloud compute addresses delete ADDRESS --project PROJECT --region REGION
Upvotes: 18