Description
Library name and version
Microsoft.Azure.Batch v15.4.0
Describe the bug
When we deallocate spot/low-priority nodes with the API call RemoveFromPoolAsync , the request is getting allowed to remove a node , even when the pool was steady with 0 nodes, this gave a result to resize to -1 from the Portal as it is visible in the next image
Expected behavior
We are looking to get some fix for the api request to avoid receive this kind of negative resizing request or perform some previous validation about the amount of nodes into the pool and avoid the same.
Since we use a validations over the low-priority nodes count this negative results are impacting in our applications.
As a workaround we are using Math.Max(0, pool.TargetLowPriorityComputeNodes) to handle this situation
Actual behavior
When we deallocate low-priority nodes with the API call RemoveFromPoolAsync , the request is getting allowed to remove a node , even when the pool was steady with 0 nodes, this gave a result to resize to -1 from the Portal as it is visible in the next image
Then at the end we receive the error of the resizing
Reproduction Steps
Batch pool with 0 nodes allocated
We execute the API call RemoveFromPoolAsync and the request is getting accepted
We observe this behavior into the Portal where the pool is scaling down to a negative number as the next image
Environment
Microsoft.Azure.Batch v15.4.0