Stop gap fix for VMWare ISO builder DVS switch
File : builder.go (src/github.com/mitchellh/packer/builder/vmware/iso/builder.go)
- Add the following properties under Config struct
FlagFixNetwork bool `mapstructure:"fix_vm_network"`
VCenterSDKURL string `mapstructure:"vcenter_sdk_url"`
Network string `mapstructure:"network"`
DataCenter string `mapstructure:"datacenter"`
NetworkType string `mapstructure:"network_type"`
QualifiedVMName string `mapstructure:"ql_vm_name"`
- Call the StepFixNetwork after stepRegister and before stepRun.
...
&StepRegister{
Format: b.config.Format,
},
&StepFixNetwork{
FlagFixNetwork: b.config.FlagFixNetwork,
VMName: b.config.VMName,
QualifiedVMName: b.config.QualifiedVMName,
VCenterSDKURL: b.config.VCenterSDKURL,
Network: b.config.Network,
DataCenter: b.config.DataCenter,
NetworkType: b.config.NetworkType,
},
&vmwcommon.StepRun{
...
"fix_vm_network" : "true",
"datacenter": "<datacenter-name>",
"network_type": "vmxnet3|e1000",
"network": "VLAN XXX",
"vcenter_sdk_url": "https://user:[email protected]/sdk",