2

I have a requirement in which i have to stop instance group during night hours and then restart in the morning. Is there anyway I can stop instance group for few hours. From console i can change autoscaling to off and set number of instances to 0 but i cant find this option from the API. Please suggest

Grzenio
  • 35,875
  • 47
  • 158
  • 240

1 Answers1

1

You can use:

gcloud compute instance-groups managed stop-autoscaling NAME [--zone ZONE]

and

gcloud compute instance-groups managed set-autoscaling NAME \
    --max-num-replicas MAX_NUM_REPLICAS [--zone ZONE]

Note that stop-autoscaling will not bring down the number of instances to 0 for you, you need set-autoscaling --max-num-replicas.

The corresponding REST API is InstanceGroupManagers: resize.

Dagang
  • 24,586
  • 26
  • 88
  • 133