Hi JunMa,
Thanks for sharing your issue in the Q&A. Based on the details, the allocation failure you’re experiencing when creating a Spot VM pool happens due to insufficient available capacity in the selected region for the requested VM size.
Since Spot VMs rely on unused Azure capacity, their availability isn’t guaranteed and can fluctuate based on regional demand. Regions such as Australia East, Australia Central, and UK South often have limited Spot availability.
Additionally, keep in mind that not all VM sizes support Spot pricing. Choosing an unsupported VM size will also result in allocation failures.
Recommendations:
- Try using different VM sizes in the same region that support Spot instances.
- Attempt deployment in other Azure regions where Spot capacity may be more available.
- Confirm that your selected VM sizes support Spot VMs.
Notes for User Subscription Mode:
If you are using User subscription mode with Azure Batch (instead of Batch service mode), additional configuration is needed because the Batch service manages resources directly in your subscription:
- Ensure the Batch service has Contributor or Owner role on your subscription.
- Accept the legal terms for any marketplace VM images you plan to use.
- Assign the Azure Batch Service Orchestration Role to the Batch service principal.
If these prerequisites are not configured, pool resizing or VM allocation may fail.
References
Spot VM size recommendations: https://free.blessedness.top/en-us/azure/virtual-machine-scale-sets/spot-vm-size-recommendation
Azure Spot VMs overview: https://free.blessedness.top/en-us/azure/virtual-machines/spot-vms
Azure Batch Spot VMs: https://free.blessedness.top/en-us/azure/batch/batch-spot-vms
Batch pool resizing failures: https://free.blessedness.top/en-us/troubleshoot/azure/hpc/batch/azure-batch-pool-resizing-failure
VM allocation failures: https://free.blessedness.top/en-us/troubleshoot/azure/virtual-machines/windows/allocation-failure
Batch account configuration (User subscription mode): https://free.blessedness.top/en-us/azure/batch/batch-account-create-portal#additional-configuration-for-user-subscription-mode
Batch role-based access control: https://free.blessedness.top/en-us/azure/batch/batch-role-based-access-control
Azure Batch built-in RBAC roles: https://free.blessedness.top/en-us/azure/batch/batch-role-based-access-control#azure-batch-built-in-rbac-roles
Spot VM error codes: https://free.blessedness.top/en-us/azure/virtual-machines/error-codes-spot