diff --git a/builder/vmware/iso/builder.go b/builder/vmware/iso/builder.go index 10fce5911..7d3b93a3b 100755 --- a/builder/vmware/iso/builder.go +++ b/builder/vmware/iso/builder.go @@ -38,19 +38,20 @@ type Config struct { vmwcommon.VMXConfig `mapstructure:",squash"` AdditionalDiskSize []uint `mapstructure:"disk_additional_size"` + BootCommand []string `mapstructure:"boot_command"` DiskName string `mapstructure:"vmdk_name"` DiskSize uint `mapstructure:"disk_size"` DiskTypeId string `mapstructure:"disk_type_id"` Format string `mapstructure:"format"` GuestOSType string `mapstructure:"guest_os_type"` - Version string `mapstructure:"version"` - VMName string `mapstructure:"vm_name"` - BootCommand []string `mapstructure:"boot_command"` KeepRegistered bool `mapstructure:"keep_registered"` + OVFToolOptions []string `mapstructure:"ovftool_options"` SkipCompaction bool `mapstructure:"skip_compaction"` SkipExport bool `mapstructure:"skip_export"` - VMXTemplatePath string `mapstructure:"vmx_template_path"` + VMName string `mapstructure:"vm_name"` VMXDiskTemplatePath string `mapstructure:"vmx_disk_template_path"` + VMXTemplatePath string `mapstructure:"vmx_template_path"` + Version string `mapstructure:"version"` RemoteType string `mapstructure:"remote_type"` RemoteDatastore string `mapstructure:"remote_datastore"` diff --git a/builder/vmware/iso/step_export.go b/builder/vmware/iso/step_export.go index 974c89852..734158b52 100644 --- a/builder/vmware/iso/step_export.go +++ b/builder/vmware/iso/step_export.go @@ -3,14 +3,15 @@ package iso import ( "bytes" "fmt" - "github.com/mitchellh/multistep" - "github.com/mitchellh/packer/packer" "net/url" "os" "os/exec" "path/filepath" "runtime" "strings" + + "github.com/mitchellh/multistep" + "github.com/mitchellh/packer/packer" ) type StepExport struct { @@ -23,13 +24,14 @@ func (s *StepExport) generateArgs(c *Config, outputPath string, hidePassword boo if hidePassword { password = "****" } - return []string{ + args := []string{ "--noSSLVerify=true", "--skipManifestCheck", "-tt=" + s.Format, "vi://" + c.RemoteUser + ":" + password + "@" + c.RemoteHost + "/" + c.VMName, outputPath, } + return append(c.OVFToolOptions, args...) } func (s *StepExport) Run(state multistep.StateBag) multistep.StepAction { diff --git a/website/source/docs/builders/vmware-iso.html.md b/website/source/docs/builders/vmware-iso.html.md index b1c448da5..8e9d4de39 100644 --- a/website/source/docs/builders/vmware-iso.html.md +++ b/website/source/docs/builders/vmware-iso.html.md @@ -240,6 +240,11 @@ builder. deploy the resulting artifact (VMX or OVA or whatever you used as `format`). Defaults to `false`. +- `ovftool_options` (array of strings) - Extra options to pass to ovftool + during export. Each item in the array is a new argument. The options + `--noSSLVerify`, `--skipManifestCheck`, and `--targetType` are reserved, + and should not be passed to this argument. + - `tools_upload_flavor` (string) - The flavor of the VMware Tools ISO to upload into the VM. Valid values are "darwin", "linux", and "windows". By default, this is empty, which means VMware tools won't be uploaded.