ESXi: Entering and exiting maintenance mode via command line

  Following on from yesterday’s post, here is how to enter or leave maintenance mode on an ESXi host via SSH:  
vim-cmd hostsvc/maintenance_mode_enter
  to go into maintenance mode – and to leave it:  
vim-cmd hostsvc/maintenance_mode_exit
  If you’re interested in other useful commands, you can see more hostsvc options by running:  
vim-cmd hostsvc
  This is a useful command to know as it is one of the critical steps in applying some patches to ESXi remotely.