From 8e75075ec9b1820c8040648ef0b308eac42edf63 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 26 Dec 2013 15:35:37 -0700 Subject: [PATCH] builder/vmware/vmx: compact disk --- builder/vmware/vmx/builder.go | 3 +++ builder/vmware/vmx/config.go | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/builder/vmware/vmx/builder.go b/builder/vmware/vmx/builder.go index 6d76c4537..e799efd0b 100644 --- a/builder/vmware/vmx/builder.go +++ b/builder/vmware/vmx/builder.go @@ -82,6 +82,9 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe }, &vmwcommon.StepCleanFiles{}, &vmwcommon.StepCleanVMX{}, + &vmwcommon.StepCompactDisk{ + Skip: b.config.SkipCompaction, + }, } // Run the steps. diff --git a/builder/vmware/vmx/config.go b/builder/vmware/vmx/config.go index 3f38dfd8c..5f68d1f42 100644 --- a/builder/vmware/vmx/config.go +++ b/builder/vmware/vmx/config.go @@ -18,8 +18,9 @@ type Config struct { vmwcommon.SSHConfig `mapstructure:",squash"` vmwcommon.VMXConfig `mapstructure:",squash"` - SourcePath string `mapstructure:"source_path"` - VMName string `mapstructure:"vm_name"` + SkipCompaction bool `mapstructure:"skip_compaction"` + SourcePath string `mapstructure:"source_path"` + VMName string `mapstructure:"vm_name"` tpl *packer.ConfigTemplate }