OnDemand: Question about size of auto-scale group when using gcloud
This issue is seen when using gcloud to create an auto-scaling/managed instance group.
According to output of "gcloud compute instance-groups managed create --help", one can use 'size' option to specify minimum/initial number of VMs in the auto-scaling group.
The initial number of instances you want in this group.
I've ran this command many times over last couple of days, and each time, specifying value of '1', results in '2' instances being created.
Example of such a command is as follows -
gcloud compute instance-groups managed create sc-demo-2016-squid-us-central1-a --size 1 --template sc-demo-2016-squid-template
Is this a bug or behavior that I don't understand?
Check with Google!
#2 Updated by Neha Sharma over 4 years ago
As per email exchange with Solomon, this happened because
I did not specify -min-num-replicas option when configuring auto scaling group and max-num-replicas was set to 5.
In this case, autoscaler decides the min replica number, based on value of max-num-replicas and ignores the value of "size" used when creating the auto scaling group
gcloud compute instance-groups managed set-autoscaling sc-demo-2016-squid-us-central1-a --max-num-replicas 5 --target-load-balancing-utilization 1.0 --cool-down-period 260
He will file a bug report. In the meantime, command to use would be something like
gcloud compute instance-groups managed set-autoscaling sc-demo-2016-squid-us-central1-a --min-num-replicas 1 --max-num-replicas 5 --target-load-balancing-utilization 1.0 --cool-down-period 260