Is there an option to control whether newest instance gets terminated or older one in GCP Autoscaling

Viewed 73

Is there an option to control whether newest instance gets terminated or an older one in GCP Autoscaling

Basically needs to handle downscaling of GCP servers based on their creation time

1 Answers

*TL;DR: No. When the autoscaler scales down, it determines the number of VM instances it needs to shut down, and selects VM instances that have low utilization to terminate from the instance group. You can’t modify this behavior.

Google published a document named Understanding autoscaler decisions which outlines the process on how autoscaler makes decisions. MIGs can only make decisions based on utilization.

Now, on MIGs, since they are created based on the same template, all VMs are the same and they will only change if you rollout an updated version. So making decisions based on the age of a VM is not quite useful since all VMS are a clones of the "instance template".

Related