Add VM to existing vnet and subnet

半城伤御伤魂 提交于 2019-12-11 10:45:54

问题


I am using a json file to create a VM. Everything works good with exception of the vnet and subnet, every time I created a new VM, it creates a new vnet and subnet, how can I create VMs and assign them to an existing vnet and subnet using a json template?


回答1:


Have you tried below sample template

https://github.com/Azure/azure-quickstart-templates/tree/master/201-vm-different-rg-vnet

you should be able to update your ARM template to create your VM into an existing VNet.




回答2:


am assuming by json, you mean an ARM Template.

you should be able to do that by grabbing a subnet reference to the existing subnet on your existing VNET and then associating your new VM's NIC to the subnet reference you obtained. have a look at sample here



来源:https://stackoverflow.com/questions/35167210/add-vm-to-existing-vnet-and-subnet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!