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 }