vsphere/internal/helper/hostsystem/host_system_helper.go
func ExitMaintenanceMode(host *object.HostSystem, timeout int) error {
	log.Printf("[DEBUG] Host %q is exiting maintenance mode", host.Name())

	// Add 5 minutes to timeout for the context timeout to allow for any issues
	// with the request after.
	// TODO: Fix this so that it ultimately uses the provider context.
	ctxTimeout := timeout + 300
	ctx, cancel := context.WithTimeout(context.Background(), time.Second*time.Duration(ctxTimeout))
	defer cancel()
	task, err := host.ExitMaintenanceMode(ctx, int32(timeout))
	if err != nil {
		return err
	}

	return task.Wait(ctx)
}
func ExitMaintenanceMode(host *object.HostSystem, timeout int) error {
	log.Printf("[DEBUG] Host %q is exiting maintenance mode", host.Name())

	// Add 5 minutes to timeout for the context timeout to allow for any issues
	// with the request after.
	// TODO: Fix this so that it ultimately uses the provider context.
	ctxTimeout := timeout + 300
	ctx, cancel := context.WithTimeout(context.Background(), time.Second*time.Duration(ctxTimeout))
	defer cancel()
	task, err := host.ExitMaintenanceMode(ctx, int32(timeout))
	if err != nil {
		return err
	}

	return task.Wait(ctx)
}
func ExitMaintenanceMode ( host * object . HostSystem , timeout int ) error { log . Printf ( " " , host . Name ( ) ) // Add 5 minutes to timeout for the context timeout to allow for any issues // with the request after. // TODO: Fix this so that it ultimately uses the provider context. ctxTimeout := timeout + 300 ctx , cancel := context . WithTimeout ( context . Background ( ) , time . Second * time . Duration ( ctxTimeout ) ) defer cancel ( ) task , err := host . ExitMaintenanceMode ( ctx , int32 ( timeout ) ) if err != nil { return err } return task . Wait ( ctx ) }
// ExitMaintenanceMode takes a host out of maintenance mode.
ExitMaintenanceMode takes a host out of maintenance mode .