diff --git a/builder/vmware/iso/builder.go b/builder/vmware/iso/builder.go index de53e2305..10fce5911 100755 --- a/builder/vmware/iso/builder.go +++ b/builder/vmware/iso/builder.go @@ -48,6 +48,7 @@ type Config struct { BootCommand []string `mapstructure:"boot_command"` KeepRegistered bool `mapstructure:"keep_registered"` SkipCompaction bool `mapstructure:"skip_compaction"` + SkipExport bool `mapstructure:"skip_export"` VMXTemplatePath string `mapstructure:"vmx_template_path"` VMXDiskTemplatePath string `mapstructure:"vmx_disk_template_path"` @@ -301,7 +302,8 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe RemoteType: b.config.RemoteType, }, &StepExport{ - Format: b.config.Format, + Format: b.config.Format, + SkipExport: b.config.SkipExport, }, } diff --git a/builder/vmware/iso/step_export.go b/builder/vmware/iso/step_export.go index ed4db4896..974c89852 100644 --- a/builder/vmware/iso/step_export.go +++ b/builder/vmware/iso/step_export.go @@ -14,7 +14,8 @@ import ( ) type StepExport struct { - Format string + Format string + SkipExport bool } func (s *StepExport) generateArgs(c *Config, outputPath string, hidePassword bool) []string { @@ -35,6 +36,12 @@ func (s *StepExport) Run(state multistep.StateBag) multistep.StepAction { c := state.Get("config").(*Config) ui := state.Get("ui").(packer.Ui) + // Skip export if requested + if c.SkipExport { + ui.Say("Skipping export of virtual machine...") + return multistep.ActionContinue + } + if c.RemoteType != "esx5" || s.Format == "" { return multistep.ActionContinue } diff --git a/website/source/docs/builders/vmware-iso.html.md b/website/source/docs/builders/vmware-iso.html.md index 22734b383..119dd050e 100644 --- a/website/source/docs/builders/vmware-iso.html.md +++ b/website/source/docs/builders/vmware-iso.html.md @@ -230,6 +230,10 @@ builder. slightly larger. If you find this to be the case, you can disable compaction using this configuration value. Defaults to `false`. +- `skip_export` (boolean) - Defaults to false. When enabled Packer will skip + export of the installed virtual machine. Only useful for some edge use + cases. + - `keep_registered` (boolean) - Set this to `true` if you would like to keep the VM registered with the remote ESXi server. This is convenient if you use packer to provision VMs on ESXi and don't want to use ovftool to @@ -334,7 +338,7 @@ by the proper key: - `` `` - Simulates pressing and holding the alt key. -- `` `` - Simulates pressing and holding the ctrl key. +- `` `` - Simulates pressing and holding the ctrl key. - `` `` - Simulates pressing and holding the shift key. @@ -348,9 +352,9 @@ by the proper key: sending any additional keys. This is useful if you have to generally wait for the UI to update before typing more. -When using modifier keys `ctrl`, `alt`, `shift` ensure that you release them, -otherwise they will be held down until the machine reboots. Use lowercase -characters as well inside modifiers. +When using modifier keys `ctrl`, `alt`, `shift` ensure that you release them, +otherwise they will be held down until the machine reboots. Use lowercase +characters as well inside modifiers. For example: to simulate ctrl+c use `c`.