I'm running a cloud foundry app with multiple instances, that I usually scale manually. The app processes fairly large tasks, one task can take between a few minutes to a few hours.
Now, when I need to scale down my app, I don't want to terminate the instance that has been crunching on a task for 2 hours already (as an interrupted task means we have to start all over again later), but I'd rather end the instance(s) that are either doing nothing (just waiting for a new task), or have only just started a new task.
So, is there a way to scale down an app, and specify which instances I'd like to be terminated? Or, alternatively, to send a signal to an instance that says "terminate this instance, and tell the scaler that it shouldn't restart the process I've just terminated"?
I have found the way to terminate a specific instance (via .186.0/index.html#terminate-a-process-instance), but this causes a new instance to be started again.
As for cf scale
, as far as I'm aware the instances that are shut down are undetermined, and seem pretty random to me.