[英]Deploy Azure VPN gateway to existing vnet without affecting existing subnets
[英]Azure creating VM on existing VNET with multiple subnets
我在同一VNET中已经有多个VM。 创建新的VM尝试使用相同的VNET时,出现错误。 我不想删除vnet中已经存在的现有子网(4)。 我要做的就是将一个新的vm添加到已存在的vnet中,并附加一个新的子网。 我看到过类似的帖子,但都没有显示如何处理多个现有子网。
这是错误
Subnet Foo2Subnet is in use by /subscriptions/<subid>/resourceGroups/foo-westus2/providers/Microsoft.Network/networkInterfaces/Foo2VMNic/ipConfigurations/Foo2
cannot be deleted. In order to delete the subnet, delete all the resources within the subnet. See aka.ms/deletesubnet.
这是我创建新虚拟机的方法。
'az vm create ' \
'--resource-group {resourceGroupName} ' \
'--name "{serverName}" ' \
'--image "UbuntuLTS" ' \
'--use-unmanaged-disk ' \
'--vnet-name foo2VNET ' \
'--subnet test1' \
'--public-ip-address "" ' \
'--storage-sku Standard_LRS ' \
'--admin-username {user_name} ' \
'--admin-password "{password}" ' \
'--size "{vm_size}" ' \
'--custom-data "" --no-wait'
发生了什么az vm create
尝试仅使用此子网执行创建vnet(因此覆盖现有的vnet配置)。 您对此无能为力,可以做的是在vnet中预先创建子网 ,然后命令将起作用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.