Know the available resources before VM creation ?

Antoine BitLogiK 1 Reputation point
2021-08-09T11:37:18.547+00:00

Some resources for VMS are exhausted, and all the validations pass, but the spot deployment fails afterwards.

{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.","details":[{"code":"OverconstrainedAllocationRequest","message":"Allocation failed. VM(s) with the following constraints cannot be allocated, because the condition is too restrictive. Please remove some constraints and try again. Constraints applied are:\n - Low Priority VMs\n - Networking Constraints (such as Accelerated Networking or IPv6)\n - Preemptible VMs (VM might be preempted by another VM with a higher priority)\n - VM Size\n"}]}

Running the diagnostic on the failure :

There are currently not enough cores of the VM Size Family you requested in this region.
This is not a quota issue. To self-mitigate, please use a different VM Size Family or a different region.

When a VM creation fails, there are the networks and the disk objects created for this VM, requiring a deletion after the failures. The overall process is quite painful, as when we have a failure on a creation, then one needs a cleaning of the created "partial" resources.

How to know or look, in the portal, the availability without trying to instantiate new VM ? Is there any method to see the machine availability before sending a request to create a new VM ?
Same question applies for a VM set, which is useful to create multiple identical VMs.
Additionally, why is the verification pass when there is no resource available?

This issue is occurring often when creating spot instances, and it is very annoying for the VM management.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,160 questions
System Center Virtual Machine Manager
Azure Virtual Machine Scale Sets
Azure Virtual Machine Scale Sets
Azure compute resources that are used to create and manage groups of heterogeneous load-balanced virtual machines.
348 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Cristian SPIRIDON 4,471 Reputation points
    2021-08-09T20:14:17.147+00:00

    It might not be possible to know in advance if you can create a spot instance or not.
    I think the best way to deal with spot instances is programmatically. You can create each resource you need (disk, network, ...) beforehand and if VM creation fail you will delete unneeded resources with a script.

    Hope this helps.

    0 comments No comments

  2. Suresh Udhayakumar 6 Reputation points
    2021-11-10T18:46:16.977+00:00

    facing similar issue [ { "code": "OverconstrainedZonalAllocationRequest", "message": "Allocation failed. VM(s) with the following constraints cannot be allocated, because the condition is too restrictive. Please remove some constraints and try again. Constraints applied are:\n - Availability Zone\n - VM Size\n" } ]

    0 comments No comments