diff --git a/post-processor/vsphere-template/post-processor.go b/post-processor/vsphere-template/post-processor.go index 2d979930e..d1961a491 100644 --- a/post-processor/vsphere-template/post-processor.go +++ b/post-processor/vsphere-template/post-processor.go @@ -107,6 +107,8 @@ func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (pac return nil, false, fmt.Errorf("Error connecting to vSphere: %s", err) } + defer c.Logout(context.Background()) + state := new(multistep.BasicStateBag) state.Put("ui", ui) state.Put("client", c)