[英]Azure ARM with Multiple Extensions and multiple VMs
I am bit struggling to understand this Azure ARM template containing multiple "Microsoft.Compute/virtualMachines/extensions" and multiple VMs:我有点难以理解这个包含多个“Microsoft.Compute/virtualMachines/extensions”和多个 VM 的 Azure ARM 模板:
kafka-on-ubuntu/azuredeploy.json kafka-on-ubuntu/azuredeploy.json
Assuming there will be 4 VMs: 1 for zookeeper and 3 for Kafka cluster repsectively, how can be ensured that the extension (+script) for Zookeper will run on exactly that one Zookeper VM, and how to ensure that the extension (+script ) for Kafka cluster will run on exactly those 3 Kafka VMs?假设将有 4 个 VM:分别 1 个用于 zookeeper,3 个用于 Kafka 集群,如何确保 Zookeper 的扩展(+script)将恰好在一个 Zookeper VM 上运行,以及如何确保扩展(+script)对于 Kafka 集群将在这 3 个 Kafka 虚拟机上运行? I am more tempted to believe that each extension run on all VMs.
我更倾向于相信每个扩展都在所有VM 上运行。
This behavior seems to be poorly documented, but from the documentation page for the Windows custom script extension :这种行为似乎没有很好的记录,但来自Windows 自定义脚本扩展的文档页面:
The name of the resource has to be in the format virtualMachineName/extensionName, if this extension is used as a standalone resource in the Azure Resource Manager template.
如果此扩展在 Azure 资源管理器模板中用作独立资源,则资源名称必须采用 virtualMachineName/extensionName 格式。
Which seems to imply that the resolution for where the custom script extension should be executed is based on the name.这似乎暗示自定义脚本扩展应该在何处执行的分辨率是基于名称的。 I imagine this is the case for Linux VMs too.
我想 Linux VM 也是这种情况。
For the particular example that you are looking at, the name of one of the vms is:对于您正在查看的特定示例,其中一个虚拟机的名称是:
"name": "[concat('zookprvm', copyindex())]",
whereas that of the extension is:而扩展名是:
"name": "[concat('zookprvm', copyindex(), '/installzoo')]",
so the prefix of the name of the extension must be identical to the VM name.因此扩展名称的前缀必须与 VM 名称相同。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.