How to place VMWare vSphere ESXi Host into maintenance mode via esxcli

Posted by

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.

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

Confirm host is in maintenance mode by running the 1st command again

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

confirm host is out of maintenance mode by running the 1st command

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.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s