diff --git a/post-processor/vsphere-template/step_mark_as_template.go b/post-processor/vsphere-template/step_mark_as_template.go index 0a2bb8e3..12597376 100644 --- a/post-processor/vsphere-template/step_mark_as_template.go +++ b/post-processor/vsphere-template/step_mark_as_template.go @@ -264,7 +264,13 @@ func findTemplate(cli *govmomi.Client, folder *object.Folder, name string) (*obj if ref != nil { if vm, ok := ref.(*object.VirtualMachine); ok { - return vm, nil + t, err := vm.IsTemplate(context.Background()) + if err != nil { + return nil, err + } + if t { + return vm, nil + } } } return nil, nil