2017-06-20 79 views
0

我收到以下錯誤VMSS自定義圖像& ELBAzure的部署狀態VMSS失敗,自定義圖像與ELB

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

Error: "error": { "details": [ { "code": "NotFound", "message": "Resource /subscriptions/6793721a-ea46-406d-ac42-d4488d1a5c0d/resourceGroups/EMC-US-WEST/providers/Microsoft.Network/loadBalancers/AZURE-TESLB not found." } ], "code": "InvalidResourceReference", "message": "Resource /subscriptions/6793721a-ea46-406d-ac42-d4488d1a5c0d/resourceGroups/EMC-US-WEST/providers/Microsoft.Network/loadBalancers/AZURE-TESLB referenced by resource /subscriptions/6793721a-ea46-406d-ac42-d4488d1a5c0d/resourceGroups/EMC-US-West/providers/Microsoft.Compute/virtualMachineScaleSets/azure-tes was not found. Please make sure that the referenced resource exists, and that both resources are in the same region." } }

回答

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

現在它在負載均衡器之前創建,這就是爲什麼它的錯誤。

+0

我已經添加了參數,但現在正在獲取驗證錯誤:部署模板驗證失敗:'模板資源'Microsoft.Compute/virtualMachineScaleSets/emc-west-'無法引用自身。有關使用詳情,請參閱https://aka.ms/arm-template-expressions/#reference。'。 (代碼:InvalidTemplate) –

+0

我忘了修復這個錯字,你顯然需要依靠ilb,而不是依靠它本身@SagarMalve – 4c74356b41