2

What is the best way to change the instance type of a machine that is part of a load balanced instance group? I'd like to avoid losing the machine name and data if possible.

For a non load balanced instance, I see that you can change the instance once it is stopped. But I cannot stop the machine when it is part of a load balancer.

I have set up my instance group as following:

autoscaling: off
number of instances: 1
autohealing: no health check

I've tried to stop it by * going to the compute instance and clicking stop on top. But it restarts right away. * by changing the number of instances to 0, but then it deletes the current instance.

Load Balance Details Incoming requests are directed to a single server, on port 80. I have maximum CPU utilization set to 100 and balancing mode is set to Utilization.

Grzenio
  • 35,875
  • 47
  • 158
  • 240
Keyur Shah
  • 21
  • 2
  • Can you add more details about how you've set up your load balancing, and how you've attempted to stop the load-balanced instance? Using a naive TCP L4 load-balancing setup, I have no problem stopping the instance, editing the machine-type, then restarting the instance through the developer console. – Kevin Sep 06 '16 at 21:16

1 Answers1

0

One workaround to avoid loosing data would be to create an image from your current disk and than create a new template with this image selecting your desired machine type. Once done, update your group with this new template and recreate the instance in the group using gcloud compute instance-groups managed recreate-instances.

Faizan
  • 1,937
  • 13
  • 18