Skip to content
Advertisement

How to switch an IP from an instance to another with gcloud

Is there a way to “detach” a reserved internal or external IP address from a VM to assign it to another instance with the gcloud command?

I want to do this as I’m scripting with Python and want to automate this process.

Advertisement

Answer

Following commands might help you –

[1]. To reserve external ip addresses.

JavaScript

[2]. To unset the external ip address.

JavaScript

[3]. To assign a new external ip address to a resource.

JavaScript

[4]. To list available external ip addresses in project

JavaScript

gcp public documentation link –

https://cloud.google.com/compute/docs/ip-addresses/reserve-static-external-ip-address

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement