How to setup GCE autoscaling for instance group basing on the amount of running VMs in another instance group. I have 'main-instance-group' with its own scaling policies. I want the second instance group 'additional-instance-group' to scale from 0 to 1 when there is no running VMs inside 'main-instance-group'.
Is it possible to achieve this using Stackdriver Monitoring metrics?
I've found pretty close metric named compute.googleapis.com/instance/uptime
and it goes to 0 when there are no instances inside 'main-instance-group'. But as far as I see only possible ways to scale up are stackdriver-metric-single-instance-assignment
and stackdriver-metric-utilization-target
both of them doesn't match my case as far as they require some non zero targets to match.