I have been having to place my lab host into maintenance mode a few times now via the command-line, for whatever reason I just keep forgetting the command that I should use to place my host into maintenance mode using esxcli, so I figured I would dump it here so I can find it easily. Hopefully, now it sticks…
enter maintenance mode:
esxcli system maintenanceMode set --enable true
exit maintenance mode:
esxcli system maintenanceMode set --enable false
Harri Waltari says
As lots of organisations do use VSAN it might be beneficial also to add the required mode here:
-m|–vsanmode= Action the VSAN service must take before the host can enter maintenance mode (default ensureObjectAccessibility). Allowed values are:
ensureObjectAccessibility: Evacuate data from the disk to ensure object accessibility in the vSAN cluster, before entering maintenance mode.
evacuateAllData: Evacuate all data from the disk before entering maintenance mode.
noAction: Do not move vSAN data out of the disk before entering maintenance mode.
Duncan Epping says
Yes, for sure!
MaartenBren says
Just neede this too!
Thanks 🙂
Mohammed mubeen says
God bless you for below commands
esxcli system maintenanceMode set –enable true
exit maintenance mode:
esxcli system maintenanceMode set –enable false