I have deleted a Pool but it is stuck in resizing state even if the Dedicated and Spot nodes count is zero

Shubham 0 Reputation points
2023-12-17T08:29:51.47+00:00

I have deleted a Pool but it is stuck in resizing state even if the Dedicated and Spot nodes count is zero.

Azure Batch
Azure Batch
An Azure service that provides cloud-scale job scheduling and compute management.
303 questions
{count} votes

1 answer

Sort by: Most helpful
  1. v-vvellanki-MSFT 3,815 Reputation points Microsoft Vendor
    2023-12-18T04:24:57.5566667+00:00

    Hi @Shubham,

    Thanks for contacting Microsoft Q&A platform.

    The issue you are facing might happen in the following scenarios.

    Cause 1: The batch service can't delete the load balancer, as shown by the following activity log entry:

    The scope '/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.Network/loadBalancers/<guid>-azurebatch-cloudserviceloadbalancer' cannot perform delete operation because following scope(s) are locked: '/subscriptions/<subscription-id>/resourceGroups/<resource-group-name>. Please remove the lock and try again.

    Fix: Remove resource locks on the extra networking resources

    Remove the resource lock from the resource group that contains the virtual network. The pool should then be fully deleted after about 20 minutes.

    Cause 2:
     The batch service can't delete the network security group (NSG), as shown by the following activity log entry:

    Network security group /subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.Network/networkSecurityGroups/<guid>-azurebatch-cloudservicenetworksecuritygroup cannot be deleted because it is in use by the following resources: /subscriptions/<subscription-id>/resourceGroups/<resource-group-name>/providers/Microsoft.Network/virtualNetworks/<virtual-network-name>/subnets/<subnet-name>. In order to delete the Network security group, remove the association with the resource(s). To learn how to do this, see Delete a network security group.

    Fix: Disassociate the resource dependencies

    Remove the batch pool dependencies on the resources that are used outside the batch pool. For this example, you would disassociate the NSG from the subnet. After you make this change, the batch service finishes deleting the batch pool after about 20 minutes.

    Reference: https://learn.microsoft.com/en-us/troubleshoot/azure/general/azure-batch-pool-deletion-failure#scenario-2-batch-pool-is-stuck-in-resizing-mode-after-an-attempted-pool-deletion

    Hope this helps you.