资源 '' 请求的大小当前在位置 '' 区域中不可用

2024-02-28

问题

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

模板部署失败并出现错误:“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 https://aka.ms/azureskunotavailable了解详情。'.'。 (代码: 无效模板部署)

尝试的解决方案

首先,我确保了可用性。根据这个文档 https://azure.microsoft.com/en-us/global-infrastructure/services/?products=virtual-machines, Fs-series在所有地区均可用。

二、故障排除步骤如下here https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/error-sku-not-available#code-try-1,我能够确认可用性EastUS跑步时Get-AzureRmComputeResourceSku | where {$_.Locations -icontains "eastus"}:

最后,我尝试了解决方案here https://stackoverflow.com/questions/49707339/error-while-creating-virtual-machine-x-the-requested-size-for-resource-y-is-curr,但是选择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')]"
    }
}
}

Edit 1

按照一项建议,运行Get-AzVMSize -Location 'eastus'证实F1s应该可用:


我相信要获取您的订阅\位置组合实际可用的内容,您应该使用:

Get-AzVMSize -Location %location%

Since Get-AzComputeResourceSku返回该位置所有可能的 SKU,无论您的订阅限制如何

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

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

资源 '' 请求的大小当前在位置 '' 区域中不可用 的相关文章

随机推荐