-4

I want to upgrade the RAM from 8 GB to 16 or 32 GB of my current Google cloud server without facing any IP and long down time issue.

tripleee
  • 1,416
  • 3
  • 15
  • 24
  • 2
    Call google support. You likely will be told that it does not matter what you want, you can only do what they support. Which requires downtime and a restart fora config change. – TomTom Apr 20 '20 at 11:07

1 Answers1

1

As per the comments, ultimately you will need to shutdown the VM before you can change the machine type to increase the RAM. Two things to take into account to minimise downtime and ensure you don't have IP issues.

First, IP issues. You need to ensure your VM has a static IP, that way it will retain its IP across restarts. To assign static IPs internally see:

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

Then to assign static IPs externally see:

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

Second, assuming you now have static IPs, you want to minimise the length of time to conduct the change in memory, the best way to do this is using the 'gcloud' command line tool, which you can access via the Cloud Shell icon in the portal or install locally.

Then you can run these three commands:

gcloud compute instances stop <instance_name>
gcloud compute instances set-machine-type <instance_name> --machine-type <instance_type>
gcloud compute instances start <instance_name>

Replacing with the name of the VM and with the 16GB or 32GB variant you would like to use - e.g. n1-standard-16 or n1-standard-32

If you run all three commands in a single script you should minimise downtime to the VM.

More details here:

https://cloud.google.com/compute/docs/instances/changing-machine-type-of-stopped-instance

Alex Moore
  • 1,704
  • 5
  • 12