vsphere/event_helper.go
func newVirtualMachineCustomizationWaiter(client *govmomi.Client, vm *object.VirtualMachine, timeout int) *virtualMachineCustomizationWaiter {
	w := &virtualMachineCustomizationWaiter{
		done: make(chan struct{}),
	}
	go func() {
		w.err = w.wait(client, vm, timeout)
		close(w.done)
	}()
	return w
}
func newVirtualMachineCustomizationWaiter(client *govmomi.Client, vm *object.VirtualMachine, timeout int) *virtualMachineCustomizationWaiter {
	w := &virtualMachineCustomizationWaiter{
		done: make(chan struct{}),
	}
	go func() {
		w.err = w.wait(client, vm, timeout)
		close(w.done)
	}()
	return w
}
// newVirtualMachineCustomizationWaiter returns a new
// virtualMachineCustomizationWaiter to use to wait for customization on.
//
// This should be called **before** the start of the customization task to be
// 100% certain that completion events are not missed.
//
// The timeout value is in minutes - a value of less than 1 disables the waiter
// and returns immediately without error.