Backtrack:  
 
by lunarg on January 17th 2018, at 11:29

You can use either esxcli or vicfg-hostops to enter/exit maintenance mode.

esxcli

  • Enter: esxcli system maintenanceMode set --enable true
  • Exit: esxcli system maintenanceMode set --enable false

vicfg-hostops

  • Enter: vicfg-hostops --operation enter
  • Exit: vicfg-hostops --operation exit

Note that you can use vicfg-hostops --operation info to check whether the host is finished with entering maintenance mode or is still busy.

PowerCLI

After connecting to the host or vCenter server:

  • Enter: Get-VMHost <name-of-host> | Set-VMHost -State Maintenance
  • Exit: Get-VMHost <name-of-host> | Set-VMHost -State Connected