An Azure service that provides cloud-scale job scheduling and compute management.
As an observer watching my Batch pools, I was able to confirm the following behaviors, all of which address my questions. I posted this as a new comment because my empirical observations have a lot of overlap with, but also slight differences from, the other comments posted here.
What happens to a batch node after it gets preempted?
In this case, my observations completely match VarunTha's response. Batch will periodically attempt to re-provision them (this is where I believe Alex Burlachenko is mistaken). The entire time -- even in Preempted state -- the node counts toward the pool size.
The only thing that would remove a Preempted node from the pool is an autoscaling rule doing general scale-in.
Am I being billed for the preempted node?
The VM is gone, so you are not billed for compute. But I observe the hard disk and networking for the node remain while the node is preempted, so you do get billed for those. This is typically a tiny fraction of what the compute cost would have been: In my experience we pay about $1/day/preempted-node (USD).
Autoscaling does not discount this preempted node when it checks if it has enough nodes.
This statement is correct. And it's consistent with the observation that Batch is trying to re-provision the preempted node, so from the autoscaler's point of view, that preempted node might yet do some more work!
One workaround to prevent starvation (when the preempted nodes never recover) may be to over-provision the pool. For example I use this:
lookbackMinutes = 3;
// Nodes preempted in the pool count toward pool size but run nothing,
// so we add additional capacity to avoid task starvation.
$preemptedNodes = max($PreemptedNodeCount.GetSample(TimeInterval_Minute * lookbackMinutes));
$TargetLowPriorityNodes = $targetNodes + $preemptedNodes;
I can't really explain the supply-and-demand of why this works. i.e. How can the autoscaler provision new nodes when existing nodes remained preempted? Oh well, no problem.