Recently, I was attempting to place a ESXi host into maintenance mode via the GUI in vCenter. However, it kept failing even after i restarted services and rebooted the vCenter. This forced me to break out some old commands to perform this task via CLI on the ESXi host itself.
If you would like assistance in the below or have general questions about Cloud solutions, VMware, and more, feel free to visit the following URL and I will be able to work directly with you:
https://bit.ly/3qcNxsN
Confirm the host is not in maintenance mode already:
#localcli vsan cluster get

Place the host into maintenance mode:
#esxcli system maintenanceMode set –enable true -m ensureObjectAccessibility
**I put ensure object accessibility because I don’t want data moving around

When the time comes to take host out of maintenance mode:
#esxcli system maintenanceMode set –enable false

Summary:
Three simple commands to bypass the GUI & place a host into maintenance mode. For your experience VMWare engineer I know this isn’t anything new but you never know when you need to refresher. As always, I hope y’all found this useful.