Reputation: 650
I have google cloud compute engine which is centOS 7. It was located in asia-southeast1 (SG). However, I checked the external IP it was on the Mountain View, CA.
Is it possible to change the IP where it can be located to Singapore?
Thanks, Edmhar
Upvotes: 1
Views: 3360
Reputation: 939
Sure. At this moment you need to: 1 Reserve a new IP in the wanted region. 2 Stop your VM. 3 Assign the new IP to your VM. 4 Re-Start your VM
It is easier to do it through the console, but will take more time. If you decide to do it with gcloud. You need to delete the access and Assign the new one.
Delete access gcloud compute instances describe [INSTANCE_NAME]
gcloud compute instances delete-access-config [INSTANCE_NAME] \ --access-config-name "[ACCESS_CONFIG_NAME]"
Define the new IP reserved ( here you specify the actual IP x.x.x.x, not its name)
gcloud compute instances add-access-config [INSTANCE_NAME] \ --access-config-name "[ACCESS_CONFIG_NAME]" --address [IP_ADDRESS]
Assign the IP to the VM
gcloud compute instances add-access-config [INSTANCE_NAME] \ --access-config-name "[ACCESS_CONFIG_NAME]"
The official documentation has also the step by step. https://cloud.google.com/compute/docs/configure-ip-addresses
Upvotes: 1