Forum Discussion

Petri-X's avatar
Petri-X
Bronze Contributor
Nov 30, 2023

How to avoid "This Size is not available in zone. . ."

Hi,

Anybody has found the optimal solution to avoiding the following text, when selecting the VM on Azure:

This size is not available in zone 2. Zones '1' are supported.

Of course the zone numbers can be mixing.

 

I tried to use the Get-AzComputeResourceSku CMDlet, but did not got any smarter:

PS C:\> Get-AzComputeResourceSku -Location "westeurope" | Where-Object { $_.name -EQ "Standard_D4_v5" }

ResourceType              Name   Location     Zones RestrictionInfo
------------              ----   --------     ----- ---------------
virtualMachines Standard_D4_v5 westeurope {1, 2, 3} type: Zone, locations: westeurope, zones: 2, 3

 

Basically Zones says, this should be available, but when trying to select that on portal or run PS. PowerShell gives the following error:

New-AzVM: The requested size for resource '/subscriptions/.../virtualMachines/myVM' is currently not available in location 'westeurope' zones '2' for subscription '111.....111'. Please try another size or deploy to a different location or zones.
ErrorCode: SkuNotAvailable
ErrorTarget:
StatusCode: 409
ReasonPhrase: Conflict

The funny thing is, this speaks about "subscription" and if I choose a different subscription this VM size is available on the same zone.

 

So I'm interest to hear what others are using for listing available VM sizes, to see how to choose similar VMs on all zones? I have tested with different sizes, and seems to be the case a bit randomly. 

  • Petri-X 

     

    You may add a PowerShell to list and filter for different size:

     

    Get-AzVMSize -Location "REGION" | Where {$_.NumberOfCores -gt 128}

  • Hi Petri-X,

     

    First of, to list what location are available for your subscription, use the following command:

     

    Get-AzVMSize -Location westeurope | where-object {$_.name -EQ "Standard_D4_v5"}

     

    Because Get-AzComputeResourceSku returns all the possible SKUs available for a location disregarding the limitations of your subscription. So, as a first troubleshooting step execute this command on both subscriptions to check if the SKU is available for the corresponding subscription.

     

    Also it could be that some VM sizes are unavailable as there is currently high demand for VMs in certain regions (this is especially true for free trial accounts VM sizes). The solution is to create your VM resources in neighboring regions.

     

    But the best solution I think, is to directly Contact Microsoft Support If a SKU isn't available for your subscription, submit a SKU request to Azure Support.

    • Petri-X's avatar
      Petri-X
      Bronze Contributor

      Big thanks samy_vanderspikken for your proposal. Need to play with them,

       

      But as you said:

      "Also it could be that some VM sizes are unavailable as there is currently high demand for VMs in certain regions"

       

      I was not able to understand how this could be hapen:

      # Set the Context to one of my subscription:
      PS C:\> set-azcontext -SubscriptionName mySub01
      
      # Check the status:
      PS C:\> Get-AzComputeResourceSku -Location "westeurope" | Where-Object { $_.name -EQ "Standard_D4ls_v5" }
      
      ResourceType                Name   Location     Zones RestrictionInfo
      ------------                ----   --------     ----- ---------------
      virtualMachines Standard_D4ls_v5 westeurope {3, 2, 1} type: Zone, locations: westeurope, zones: 1
      
      
      # Set the Context to one of my subscription:
      PS C:\> set-azcontext -SubscriptionName mySub02
      
      # Check the status:
      PS C:\> Get-AzComputeResourceSku -Location "westeurope" | Where-Object { $_.name -EQ "Standard_D4ls_v5" }
      
      ResourceType                Name   Location     Zones RestrictionInfo
      ------------                ----   --------     ----- ---------------
      virtualMachines Standard_D4ls_v5 westeurope {1, 2, 3} type: Zone, locations: westeurope, zones: 3

       

      As you see, by changing only the subscription that affects to the availability:

      RestrictionInfo: Zones: 1

      RestrictionInfo: Zones: 3

       

      I though to ask this from Microsoft as well, but thought to ask here if there is something which I do not know.

      • kiweezi's avatar
        kiweezi
        Copper Contributor
        As it has been said, I think this is due to the demand for that sku in the specific zone.

        As to the reason why it shows a different zone in a different subscription:
        When a subscription is first created, it maps to a fixed set of zones, that aren't neccessarily the same as another subscription in the same location. I don't think it is known how the subscription picks the zones to map to, or in what order to do it.
        This means a subscription 'sub1' zone 1 could be the same as another subscription 'sub2' zone 3, etc.
        That might describe the behaviour you're seeing. The command is showing a shortage of VMs in the same zone, it's just each subscription has mapped the zones in a different order.

        Appreciate it's been sometime since this was posted.

Resources