【问题标题】:The requested size for resource '' is currently not available in location '' zones资源 '' 请求的大小当前在位置 '' 区域中不可用
【发布时间】:2020-07-04 05:28:27
【问题描述】:

问题

尝试使用我的操作包许可证在 Azure 上部署大小为 F1S 的 Windows 10 VM 时收到以下错误:

模板部署失败并出现错误:'具有 id 的资源: '/subscriptions/7d01bbc6-ef9b-4ad6-8c6e-baea1e0bd02d/resourceGroups/AzTech/providers/Microsoft.Compute/virtualMachines/Windows10' 验证失败并显示消息:'请求的资源大小 '/subscriptions/7d01bbc6-ef9b-4ad6-8c6e-baea1e0bd02d/resourceGroups/AzTech/providers/Microsoft.Compute/virtualMachines/Windows10' 目前在位置 'eastus' 区域 '' 中不可用 订阅'...'。请尝试 另一个大小或部署到不同的位置或区域。看 https://aka.ms/azureskunotavailable 了解详情。'.'。 (代码: 无效模板部署)

尝试的解决方案

首先,我确保了可用性。 According to this documentationFs-series 在所有地区都可用。

其次,按照故障排除步骤here,我可以在运行Get-AzureRmComputeResourceSku | where {$_.Locations -icontains "eastus"} 时确认EastUS 的可用性:

最后,我尝试了here的解决方案,但选择HDD不起作用。

其他信息

如果有用的话,这个虚拟机的模板在这里:

    {
"$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')]"
    }
}
}

编辑 1

根据一项建议,运行 Get-AzVMSize -Location 'eastus' 确认 F1s 应该可用:

【问题讨论】:

    标签: azure virtual-machine


    【解决方案1】:

    我相信可以获得实际可用的订阅\位置组合,您应该使用:

    Get-AzVMSize -Location %location%
    

    由于Get-AzComputeResourceSku 返回所有可能的 SKU,可用于该位置,而无视您的订阅限制

    编辑:在这种情况下,问题在于模板正在部署一个现货实例,而不是常规虚拟机,通过删除现货实例 OP 能够使用所需的虚拟机大小。

    【讨论】:

    • 这证实了我的订阅可以使用 F1S。请参阅编辑。
    • 可能无法作为 Spot 实例使用。您可以通过门户确认相同的工作吗?另外,您能否确认您正在部署到同一个订阅?
    • 关闭 Spot 实例。这么多正确的错误消息...感谢帮助。
    • 想更改您的答案以反映?希望确保人们在未来获得正确的信息。很高兴之后投票。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-05-26
    • 2011-11-30
    • 1970-01-01
    • 1970-01-01
    • 2019-11-01
    • 1970-01-01
    相关资源
    最近更新 更多