vim-cmd hostsvc/maintenance_mode_enterto go into maintenance mode – and to leave it:
vim-cmd hostsvc/maintenance_mode_exitIf you’re interested in other useful commands, you can see more hostsvc options by running:
vim-cmd hostsvcThis is a useful command to know as it is one of the critical steps in applying some patches to ESXi remotely.