Vmware : Add a Nic during provisioning

Hi !

I already passed through some topics who talk about this but without find what i want.

I understand if we had a template with multiple Nic and Vlan we just need add/provide additional information in the service dialog and set the right name on the field to provision the additional Nic.

But my template has only one Nic and i want add another during the prov, but i have not idea how to perform that. I follow some links in topics but i get 404.

So i try to do some automation with information i find on the forum but if someone had already documented something, i would like take a look to this :slight_smile:

Thanks in advance for your time


Hi Grégoire

Did you try the code suggested here ?


Hi @pemcg

I reach my goal, with that :

  • prov.set_network_adapter(index, {:network=>vlan, :devicetype=>‘VirtualVmxnet3’, :is_dvs=>false})

  • prov.set_nic_settings(1, {:ip_addr=>ip, :subnet_mask=>mask, :gateway=>gateway, :addr_mode=>[“static”, “Static”]})

My issues was only find variable and synthaxes, after a few more researches on topics of this forum, i found all of this, so with this two methods you provide and set a new nic.

I put this code in vmware_PreProvision for the moment, the same place of the vlan settings