Leverage task slot information in autoscaling formula
Feature Request Description
When using a pool with multiple task slots per node and task with >1 required slots, it is not possible to correctly scale the pool using autoscale formulas. Example: Pool P can deploy node with 2 task slots. No node is deployed, no task is running. Job A has 1 active task Ta, which requires 1 slot to be run. Job B has 1 active task Tb, which requires 1 slot to be run. Job C has 1 active task Tc, which requires 2 slots to be run. Job D has 1 active task Td, which requires 2 slots to be run.
To run every task in parallel, I need 3 nodes (1 for Ta and Tb, 1 for Tc and 1 for Td).
But $PendingTasks = 4 / $ActiveTasks = 4.
The simple formula $TargetDedicatedNodes = $PendingTasks / $TaskSlotsPerNode + 0.9 will be evaluated to 2.9, truncated to 2. It is impossible to obtain 3 bar assumptions on the tasks.
Describe Preferred Solution
Add $PendingSlots, $ActiveSlots, $RunningSlots values, that are simply SUM_i(Ti * TaskSlotsFor(Ti)) for Pending/Active/Running tasks.
Describe Alternatives Considered
No alternative is possible, per Microsoft support.
Additional Context
/
@bwatrous for visibility