Suppose I want to scale up/down my Azure Cloud Service Programmatically. The scaling up case is easy. But when scaling down, can I control which instance gets torn down? Is this predictable?
In my particular use case I have a queue of very long-running operations that I fan out to multiple instances based on some criteria. Each operation might take as long as 20 hours, or as little as 2 minutes.
If I use Wasabi or auto scaling, it looks like random instances are selected for tear down (or usually the most recently added instance...but I can't find a guarantee of that). This won't work particularly well for me. For instance, I could spin up 20 workers to process a queue of 20 work units only to have worker #20 stuck with the 20 hour job.
Is there a way to choose which instance will be torn down (either from within the instance, or from a dedicated management node)?