Setting vlan on VMWare provisioned VM

When we provision a VM and set the vlan to be different than the one in the chosen template, the provision request fails to complete due to the fact that the original vlan in the template is not available in the target cluster whereas the vlan chosen by the user is.

We’re not using customization specifications and wondering if this is my problem. Are customization specs required to be able to set the vlan appropriately? If not, any ideas why the vlan is not being changed prior to an attempt to power on the VM?

Just to respond to my own request, the issue is related to the need to also set vds settings. We removed this from the template and everything worked without having to modify customization specs.

argh, should’ve said dvs.

Hi, there are method available you can call in StateMachine to set the dvs like set_network_adatper documented here:

here is an example (prov is the provision tack)

prov.set_network_adapter(0, {:network => dvs_net1, :is_dvs => true} )


Hi I am trying to add an additional NIC to VM after provisioning is completed (already deployed VM) running on VMware 6.5. Using a service catalog or button to add NIC. Do you have any suggestion on how I could do that? I do not want to tweak customization spec as majority of my VM would not have more than one NIC.

FYI - the link mentioned above is not working

It may be possible using the vmware_guest Ansible module:


Thanks @pemcg. I will take a look at this