How to specify a virtual network in a different resource group when creating a new Azure VM?

106 views
Skip to first unread message

Vincent Ngan

unread,
Jan 12, 2017, 9:38:18 PM1/12/17
to Ansible Project
Hi,

I am trying to create a VM in Azure using Ansible. The setup of our Azure configuration is that the virtual network is created in a different resource manager from the virtual machines'. When I using azure_rm_virtualmachine module to create a virtual machine in Azure, the module complains that the virtual network does not exist in the resource manager of the virtual machine to be created. Is there any way I can do that? Can I specify a virtual network with a fully qualified name including its resource manager name so that the module would not confuse it with the resource manager of the virtual machine?

Vincent
 

Matt Davis

unread,
Jan 13, 2017, 3:21:44 PM1/13/17
to Ansible Project
I know I tested this back when we first wrote it, so unless it got broken along the way somewhere, if you pass the full resource URI for the vnet (regardless of whether or not it's in the same RG), it should do the right thing...

Bamar Diagne

unread,
Feb 14, 2017, 1:20:28 PM2/14/17
to Ansible Project
Hi,

I am facing the same issue, did you manage to get down to the bottom of this. I am having no luck so far.

Cheers
Bamar

shanmuga Mahalingam

unread,
Feb 16, 2017, 1:36:24 AM2/16/17
to Ansible Project
I tried with full URI and no luck. 

virtual_network_name: /subscriptions/<Subscriptions_ID>/resourceGroups/<Resource_Group>/providers/Microsoft.Network/virtualNetworks/ansible_test


Anyone help on this pls ?
Reply all
Reply to author
Forward
0 new messages