具有自定义映像和VMSS的VMSS的Azure配置状态失败。 ELB

时间:2017-06-20 08:13:37

标签: azure azure-vm-scale-set azure-vm-templates

我对自定义图像&的VMSS的误差低于ELB

我的模板链接:https://github.com/linuxgambler/azure/blob/master/vmss_elb.json

  

错误:            “错误”:{            “细节”: [                      {                      “code”:“NotFound”,                      “message”:“资源/subscriptions/6793721a-ea46-406d-ac42-d4488d1a5c0d/resourceGroups/EMC-US-WEST/providers/Microsoft.Network/loadBalancers/AZURE-TESLB   未找到。”                    }                 ]                “code”:“InvalidResourceReference”,               “message”:“资源/subscriptions/6793721a-ea46-406d-ac42-d4488d1a5c0d/resourceGroups/EMC-US-WEST/providers/Microsoft.Network/loadBalancers/AZURE-TESLB   由资源引用   未找到/subscriptions/6793721a-ea46-406d-ac42-d4488d1a5c0d/resourceGroups/EMC-US-West/providers/Microsoft.Compute/virtualMachineScaleSets/azure-tes。请确保引用的资源存在,   并且两种资源都在同一地区。“             }        }

1 个答案:

答案 0 :(得分:0)

您需要将dependsOn属性添加到VMSS定义。

"type": "Microsoft.Compute/virtualMachineScaleSets",
"name": "[variables('vmssName')]",
"location": "[resourceGroup().location]",
"apiVersion": "2016-04-30-preview",
"dependsOn": [
    "[variables('lbID')]"
],
"sku": {
    "name": "[parameters('vmSku')]",
    "tier": "Standard",
    "capacity": "[parameters('instanceCount')]"
},

现在它已经在负载均衡器之前创建了,这就是它出错的原因。