diff --git a/CHANGELOG.md b/CHANGELOG.md index 89615b49e..1c1a1ea78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,8 @@ BUG FIXES: with a zero exit code. [GH-1119] * builder/virtualbox/iso: Append timestamp to default name for parallel builds. [GH-1365] + * builder/vmware/all: No more error when Packer stops an already-stopped + VM. [GH-1300] * builder/vmware/all: `ssh_host` accepts templates. [GH-1396] * builder/vmware/all: Don't remount floppy in VMX post step. [GH-1239] * builder/vmware/vmx: Do not re-add floppy disk files to VMX [GH-1361] diff --git a/builder/vmware/common/driver_fusion5.go b/builder/vmware/common/driver_fusion5.go index 8bcbb8d30..3a295e731 100644 --- a/builder/vmware/common/driver_fusion5.go +++ b/builder/vmware/common/driver_fusion5.go @@ -90,6 +90,12 @@ func (d *Fusion5Driver) Start(vmxPath string, headless bool) error { func (d *Fusion5Driver) Stop(vmxPath string) error { cmd := exec.Command(d.vmrunPath(), "-T", "fusion", "stop", vmxPath, "hard") if _, _, err := runAndLog(cmd); err != nil { + // Check if the VM is running. If its not, it was already stopped + running, rerr := d.IsRunning(vmxPath) + if rerr == nil && !running { + return nil + } + return err }