我需要创建40 an从一个图像连接到一个单一的负载平衡器使用ARM模板。是否有一种方法来指定VM资源数量的计数?
我不是在寻找规模设定的解决方案。
发布于 2020-03-12 01:53:36
您可以使用copyIndex函数作为copyIndex(loopName, offset)。
下面的示例显示了一个复制循环和名称中包含的索引值。
{
"apiVersion": "2018-04-01",
"type": "Microsoft.Compute/virtualMachines",
"name": "[concat(parameters('vmNamePrefix'), copyindex())]",
"copy": {
"name": "virtualMachineLoop",
"count": "[variables('numberOfInstances')]"
},例如,您可以将variables('numberOfInstances')更改为40,并注意像Azure名称、osProfile、networkInterfaces这样的资源应该在以下引用模板中具有唯一的名称(包括copyIndex())。
https://github.com/Azure/azure-quickstart-templates/tree/master/201-2-vms-loadbalancer-lbrules
https://github.com/Azure/azure-quickstart-templates/tree/master/201-2-vms-internal-load-balancer
https://stackoverflow.com/questions/60637858
复制相似问题