首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何修复失败的VMSS部署,并显示错误“未知网络分配错误”

问如何修复失败的VMSS部署,并显示错误“未知网络分配错误”
EN

Stack Overflow用户
提问于 2019-05-15 10:00:46
回答 1查看 648关注 0票数 1

我正在尝试使用Azure Azure CLI和带参数的自定义ARM模板将3层架构部署到PowerShell。我对powershell脚本或模板的有效性没有任何问题。

在模板中,除其他外,还有两个虚拟机比例集,一个用于前端,另一个用于后端。前端是windows,后端是红帽。前端位于应用程序网关之后,而后端位于负载均衡器之后。奇怪的是,前端VMSS部署没有问题,一切都很好。每次我尝试部署后端VMSS时,它都会失败,并显示一条模糊的"Unknown network allocation error“消息,我不知道如何调试(因为它没有提供与目前为止所有其他错误消息不同的细节)。

我将ARM模板基于来自另一个资源组中此架构的工作模型的导出模板,并修改了参数,并花费了一些时间来清理Azure导出模板的问题和错误。我尝试删除并从头开始,但似乎不能解决这个问题。我认为有可能达到免费订阅处理器的限制,所以我尝试使前端VMSS依赖于后端VMSS,以便首先创建后端VMSS,但同样的问题仍然发生。

以下是模板的后端VMSS部分:

代码语言:javascript
复制
{
      "type": "Microsoft.Compute/virtualMachineScaleSets",
      "apiVersion": "2018-10-01",
      "name": "[parameters('virtualMachineScaleSets_JakeAppBESS_name')]",
      "location": "westus2",
      "dependsOn": [
        "[parameters('loadBalancers_JakeAppBESSlb_name')]"
      ],
      "sku": {
        "name": "Standard_B1ls",
        "tier": "Standard",
        "capacity": 1
      },
      "properties": {
        "singlePlacementGroup": true,
        "upgradePolicy": {
          "mode": "Manual"
        },
        "virtualMachineProfile": {
          "osProfile": {
            "computerNamePrefix": "jakeappbe",
            "adminUsername": "Jake",
            "adminPassword": "[parameters('JakeApp_Password')]",
            "linuxConfiguration": {
              "disablePasswordAuthentication": false,
              "provisionVMAgent": true
            },
            "secrets": []
          },
          "storageProfile": {
            "osDisk": {
              "createOption": "FromImage",
              "caching": "ReadWrite",
              "managedDisk": {
                "storageAccountType": "Premium_LRS"
              }
            },
            "imageReference": {
              "publisher": "RedHat",
              "offer": "RHEL",
              "sku": "7.4",
              "version": "latest"
            }
          },
          "networkProfile": {
            "networkInterfaceConfigurations": [
              {
                "name": "[concat(parameters('virtualMachineScaleSets_JakeAppBESS_name'), 'Nic')]",
                "properties": {
                  "primary": true,
                  "enableAcceleratedNetworking": false,
                  "dnsSettings": {
                    "dnsServers": []
                  },
                  "enableIPForwarding": false,
                  "ipConfigurations": [
                    {
                      "name": "[concat(parameters('virtualMachineScaleSets_JakeAppBESS_name'), 'IpConfig')]",
                      "properties": {
                        "subnet": {
                          "id": "[concat('/subscriptions/', parameters('subscription_id'), '/resourceGroups/', parameters('resource_Group'), '/providers/Microsoft.Network/virtualNetworks/', parameters('virtualNetworks_JakeAppVnet_name'), '/subnets/BEsubnet')]"
                        },
                        "privateIPAddressVersion": "IPv4",
                        "loadBalancerBackendAddressPools": [
                          {
                            "id": "[concat('/subscriptions/', parameters('subscription_id'), '/resourceGroups/', parameters('resource_Group'), '/providers/Microsoft.Network/loadBalancers/', parameters('loadBalancers_JakeAppBESSlb_name'), '/backendAddressPools/bepool')]"
                          }
                        ],
                        "loadBalancerInboundNatPools": [
                          {
                            "id": "[concat('/subscriptions/', parameters('subscription_id'), '/resourceGroups/', parameters('resource_Group'), '/providers/Microsoft.Network/loadBalancers/', parameters('loadBalancers_JakeAppBESSlb_name'), '/inboundNatPools/natpool')]"
                          }
                        ]
                      }
                    }
                  ]
                }
              }
            ]
          },
          "priority": "Regular"
        },
        "overprovision": true
      }
    },


For reference, here's the front-end VMSS's part of the template so you can compare and see that there aren't many differences:

`    {
      "type": "Microsoft.Compute/virtualMachineScaleSets",
      "apiVersion": "2018-10-01",
      "name": "[parameters('virtualMachineScaleSets_JakeAppFESS_name')]",
      "location": "westus2",
      "dependsOn": [
        "[parameters('applicationGateways_JakeAppFE_AG_name')]",
      ],
      "sku": {
        "name": "Standard_B1ls",
        "tier": "Standard",
        "capacity": 1
      },
      "properties": {
        "singlePlacementGroup": true,
        "upgradePolicy": {
          "mode": "Manual"
        },
        "virtualMachineProfile": {
          "osProfile": {
            "computerNamePrefix": "jakeappfe",
            "adminUsername": "Jake",
            "adminPassword": "[parameters('JakeApp_Password')]",
            "windowsConfiguration": {
              "provisionVMAgent": true,
              "enableAutomaticUpdates": true
            },
            "secrets": []
          },
          "storageProfile": {
            "osDisk": {
              "createOption": "FromImage",
              "caching": "ReadWrite",
              "managedDisk": {
                "storageAccountType": "Premium_LRS"
              }
            },
            "imageReference": {
              "publisher": "MicrosoftWindowsServer",
              "offer": "WindowsServer",
              "sku": "2016-Datacenter",
              "version": "latest"
            }
          },
          "networkProfile": {
            "networkInterfaceConfigurations": [
              {
                "name": "[concat(parameters('virtualMachineScaleSets_JakeAppFESS_name'), 'Nic')]",
                "properties": {
                  "primary": true,
                  "enableAcceleratedNetworking": false,
                  "dnsSettings": {
                    "dnsServers": []
                  },
                  "enableIPForwarding": false,
                  "ipConfigurations": [
                    {
                      "name": "[concat(parameters('virtualMachineScaleSets_JakeAppFESS_name'), 'IpConfig')]",
                      "properties": {
                        "subnet": {
                          "id": "[concat('/subscriptions/', parameters('subscription_id'), '/resourceGroups/', parameters('resource_Group'), '/providers/Microsoft.Network/virtualNetworks/', parameters('virtualNetworks_JakeAppVnet_name'), '/subnets/FEsubnet')]"
                        },
                        "privateIPAddressVersion": "IPv4",
                        "applicationGatewayBackendAddressPools": [
                          {
                            "id": "[concat('/subscriptions/', parameters('subscription_id'), '/resourceGroups/', parameters('resource_Group'), '/providers/Microsoft.Network/applicationGateways/', parameters('applicationGateways_JakeAppFE_AG_name'), '/backendAddressPools/appGatewayBackendPool')]"
                          }
                        ]
                      }
                    }
                  ]
                }
              }
            ]
          },
          "priority": "Regular"
        },
        "overprovision": true
      }
    },

我原以为他们两个人的行为类似。当然,后端是RH linux,前端是windows,前端在应用程序网关之后,而后端在负载均衡器之后,但这种设置在我的其他资源组中工作得很好,这些资源组是通过门户而不是通过ARM部署的。但是每次我尝试部署它的时候,我都会得到这个错误:

代码语言:javascript
复制
New-AzureRmResourceGroupDeployment : 1:30:56 AM - Resource Microsoft.Compute/virtualMachineScaleSets 'ProdBESS' failed with message '{
  "status": "Failed",
  "error": {
    "code": "ResourceDeploymentFailure",
    "message": "The resource operation completed with terminal provisioning state 'Failed'.",
    "details": [
      {
        "code": "NetworkingInternalOperationError",
        "message": "Unknown network allocation error."
      }
    ]
  }
}'
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-05-18 06:56:38

好了,我终于找出了问题所在,所以如果任何人在未来的搜索中发现这个帖子有同样的错误:

显然,模板中处理VMSS负载均衡器的部分(从azure门户导出)有两个冲突的入站nat池(重叠的端口范围)。一旦我删除了模板的一部分,创建了冲突的额外nat池,我的VMSS就正确地部署了,没有问题。

完全不知道为什么azure门户网站给我导出了一个带有额外nat池的模板,而这个nat池从来就不存在(在我从中导出模板的原始LB上只有1个)。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56140838

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档