user
user

Reputation: 1351

The requested size for resource '' is currently not available in location '' zones

The Problem

I am receiving the following error when attempting to deploy a Windows 10 VM of size F1S on Azure using my action pack license:

The template deployment failed with error: 'The resource with id: '/subscriptions/7d01bbc6-ef9b-4ad6-8c6e-baea1e0bd02d/resourceGroups/AzTech/providers/Microsoft.Compute/virtualMachines/Windows10' failed validation with message: 'The requested size for resource '/subscriptions/7d01bbc6-ef9b-4ad6-8c6e-baea1e0bd02d/resourceGroups/AzTech/providers/Microsoft.Compute/virtualMachines/Windows10' is currently not available in location 'eastus' zones '' for subscription '...'. Please try another size or deploy to a different location or zones. See https://aka.ms/azureskunotavailable for details.'.'. (Code: InvalidTemplateDeployment)

Attempted Solutions

First, I've ensured availability. According to this documentation, Fs-series are available in all regions.

Second, following troubleshooting steps here, I am able to confirm availability for EastUS when running Get-AzureRmComputeResourceSku | where {$_.Locations -icontains "eastus"}:

enter image description here

Last, I have attempted the solution here, but selecting HDD did not work.

Additional Info

In case it's useful, the template for this VM is here:

    {
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
    "location": {
        "type": "string"
    },
    "networkInterfaceName": {
        "type": "string"
    },
    "networkSecurityGroupName": {
        "type": "string"
    },
    "networkSecurityGroupRules": {
        "type": "array"
    },
    "subnetName": {
        "type": "string"
    },
    "virtualNetworkName": {
        "type": "string"
    },
    "addressPrefixes": {
        "type": "array"
    },
    "subnets": {
        "type": "array"
    },
    "publicIpAddressName": {
        "type": "string"
    },
    "publicIpAddressType": {
        "type": "string"
    },
    "publicIpAddressSku": {
        "type": "string"
    },
    "virtualMachineName": {
        "type": "string"
    },
    "virtualMachineRG": {
        "type": "string"
    },
    "osDiskType": {
        "type": "string"
    },
    "virtualMachineSize": {
        "type": "string"
    },
    "adminUsername": {
        "type": "string"
    },
    "adminPassword": {
        "type": "secureString"
    }
},
"variables": {
    "nsgId": "[resourceId(resourceGroup().name, 'Microsoft.Network/networkSecurityGroups', parameters('networkSecurityGroupName'))]",
    "vnetId": "[resourceId(resourceGroup().name,'Microsoft.Network/virtualNetworks', parameters('virtualNetworkName'))]",
    "subnetRef": "[concat(variables('vnetId'), '/subnets/', parameters('subnetName'))]"
},
"resources": [
    {
        "name": "[parameters('networkInterfaceName')]",
        "type": "Microsoft.Network/networkInterfaces",
        "apiVersion": "2019-07-01",
        "location": "[parameters('location')]",
        "dependsOn": [
            "[concat('Microsoft.Network/networkSecurityGroups/', parameters('networkSecurityGroupName'))]",
            "[concat('Microsoft.Network/virtualNetworks/', parameters('virtualNetworkName'))]",
            "[concat('Microsoft.Network/publicIpAddresses/', parameters('publicIpAddressName'))]"
        ],
        "properties": {
            "ipConfigurations": [
                {
                    "name": "ipconfig1",
                    "properties": {
                        "subnet": {
                            "id": "[variables('subnetRef')]"
                        },
                        "privateIPAllocationMethod": "Dynamic",
                        "publicIpAddress": {
                            "id": "[resourceId(resourceGroup().name, 'Microsoft.Network/publicIpAddresses', parameters('publicIpAddressName'))]"
                        }
                    }
                }
            ],
            "networkSecurityGroup": {
                "id": "[variables('nsgId')]"
            }
        }
    },
    {
        "name": "[parameters('networkSecurityGroupName')]",
        "type": "Microsoft.Network/networkSecurityGroups",
        "apiVersion": "2019-02-01",
        "location": "[parameters('location')]",
        "properties": {
            "securityRules": "[parameters('networkSecurityGroupRules')]"
        }
    },
    {
        "name": "[parameters('virtualNetworkName')]",
        "type": "Microsoft.Network/virtualNetworks",
        "apiVersion": "2019-09-01",
        "location": "[parameters('location')]",
        "properties": {
            "addressSpace": {
                "addressPrefixes": "[parameters('addressPrefixes')]"
            },
            "subnets": "[parameters('subnets')]"
        }
    },
    {
        "name": "[parameters('publicIpAddressName')]",
        "type": "Microsoft.Network/publicIpAddresses",
        "apiVersion": "2019-02-01",
        "location": "[parameters('location')]",
        "properties": {
            "publicIpAllocationMethod": "[parameters('publicIpAddressType')]"
        },
        "sku": {
            "name": "[parameters('publicIpAddressSku')]"
        }
    },
    {
        "name": "[parameters('virtualMachineName')]",
        "type": "Microsoft.Compute/virtualMachines",
        "apiVersion": "2019-07-01",
        "location": "[parameters('location')]",
        "dependsOn": [
            "[concat('Microsoft.Network/networkInterfaces/', parameters('networkInterfaceName'))]"
        ],
        "properties": {
            "hardwareProfile": {
                "vmSize": "[parameters('virtualMachineSize')]"
            },
            "storageProfile": {
                "osDisk": {
                    "createOption": "fromImage",
                    "managedDisk": {
                        "storageAccountType": "[parameters('osDiskType')]"
                    }
                },
                "imageReference": {
                    "publisher": "MicrosoftWindowsDesktop",
                    "offer": "Windows-10",
                    "sku": "19h2-pro",
                    "version": "latest"
                }
            },
            "networkProfile": {
                "networkInterfaces": [
                    {
                        "id": "[resourceId('Microsoft.Network/networkInterfaces', parameters('networkInterfaceName'))]"
                    }
                ]
            },
            "osProfile": {
                "computerName": "[parameters('virtualMachineName')]",
                "adminUsername": "[parameters('adminUsername')]",
                "adminPassword": "[parameters('adminPassword')]",
                "windowsConfiguration": {
                    "enableAutomaticUpdates": true,
                    "provisionVmAgent": true
                }
            },
            "priority": "Spot",
            "evictionPolicy": "Deallocate",
            "billingProfile": {
                "maxPrice": -1
            }
        }
    }
],
"outputs": {
    "adminUsername": {
        "type": "string",
        "value": "[parameters('adminUsername')]"
    }
}
}

Edit 1

Following one suggestion, running Get-AzVMSize -Location 'eastus' confirms that F1s should be available:

enter image description here

Upvotes: 4

Views: 6957

Answers (2)

sk1me
sk1me

Reputation: 228

Spot VMs are not available for all subscriptions and I presume this is your issue here, please look at the table: enter image description here

To create desired Spot VM please switch to a subscription which allows it.

Upvotes: 3

4c74356b41
4c74356b41

Reputation: 72171

I believe to get what is actually available for your subscription\location combination you should use:

Get-AzVMSize -Location %location%

Since Get-AzComputeResourceSku returns all the possible SKUs available for the location disregarding limitations of your subscription

Edit: In this case the issue was with the fact that the template was deploying a spot instance, not a regular vm, by removing the spot instance OP was able to use the desired VM size.

Upvotes: 2

Related Questions