jetbrains-infra / packer-builder-vsphere

Packer plugin for remote builds on VMware vSphere
Mozilla Public License 2.0
543 stars 175 forks source link

Create VMs with multiple network adapters #182

Open mkuzmin opened 6 years ago

mkuzmin commented 6 years ago

Some VMs need several ethernet adapters and be connected to different networks.

tigerhawk6 commented 5 years ago

I'm currently using CURL to add a second NIC to the base VM after Packer creates it. This would help a lot.

tigerhawk6 commented 5 years ago

I'm currently using CURL

Can you add a URL to a github gist or something showing how you're doing that? (If you mod your comment above, I'll gleefully remove this hijack-y comment)

I'm adding them post build. Updated above with link to how I'm doing it.

dchidell commented 5 years ago

Would be great to see this, however I used govc in a local shell provisioner to workaround.

{
    "type": "shell-local",
    "command": "govc vm.network.add -k -u {{ user `vcenter_user` }}:{{ user `vcenter_password` }}@{{ user `vcenter_host` }} -vm '{{ user `vm_name` }}' -net '{{ user `vm_portgroup` }}' -net.adapter vmxnet3"
}