Jim
Jim

Reputation: 155

Specify a VMWare fusion virtual network to connect to in packer

I'm now trying to use packer to build an VMware Fusion VM image, I can use packer to build the VM, however it relies on using the packer http kickstart server to present the kickstart file.

The issue I have it that there is only one virtual network that can reach my packer http server.

Is it possible to specify the virtual network to connect to in the packer JSON template ?

This is my current builder section of the template

  "builders": [{
    "headless": true,
    "type": "vmware-iso",
    "vm_name": "{{user `vm_name`}}",
    "guest_os_type": "rhel7-64",
    "vmdk_name": "rhel7",
    "disk_size": "8192",
    "vmx_data": {
      "numvcpus": 2,
      "cpuid.coresPerSocket": 1,
      "memsize": 2048,
      "ethernet0.virtualDev": "vmxnet3",
      "virtualHW.version": "11"
    },

I was hoping for something like the below in the builder template, to ensure my newly created vm is on the correct network to get the kickstart.

"virtualNetwork": "vmnet3"

I've looked through the documentation on the packer site, and a number of other places, but i'm struggling to find anything to help.

Any suggestions would be very welcome.

Thanks

Jim

Upvotes: 3

Views: 826

Answers (1)

mvermaes
mvermaes

Reputation: 374

We use "ethernet0.connectionType": "nat" in our vmx_data to assign the VM's network to the NAT network.

It looks like it is also possible to specify a custom VM network to use, via:

...
"ethernet0.connectionType": "custom",
"ethernet0.vnet": "vmnet3"
...

although I haven't tested this latter method.

Source: http://sanbarrow.com/vmx/vmx-network-advanced.html (note that as far as I know there isn't any official documentation on the vmx options, but this site is the best I've found on what's available)

Upvotes: 1

Related Questions