If you’ve spent any time managing VMware environments in production, you already know that maintenance mode is one of those deceptively simple features that can cause real pain if misunderstood.

On paper, placing an ESXi host into maintenance mode is straightforward: evacuate workloads, perform work, exit maintenance mode. In reality, I’ve seen environments where hosts were stuck in maintenance mode for hours, patching jobs failed halfway through, or VMs refused to migrate because of hidden dependencies that nobody documented years earlier.

Maintenance mode is the gatekeeper for safe change in VMware. Whether you’re applying firmware updates, patching ESXi, replacing hardware, or troubleshooting performance issues, getting this step right prevents outages and avoids those dreaded “why did everything drop at once?” post-mortems.

This guide walks through three supported ways to place an ESXi host into maintenance mode, explains what actually happens under the hood, and shares real-world lessons I’ve learned managing clusters in production.


What Happens When an ESXi Host Enters Maintenance Mode?

Before we dive into the “how”, it’s important to understand the “what”.

When you place a host into maintenance mode:

  • No new virtual machines can be powered on
  • Running VMs must be migrated or shut down
  • vMotion is used automatically if vCenter and shared storage are available
  • The host becomes eligible for patching, upgrades, and hardware changes

If the host is part of a cluster with DRS enabled, VMware will attempt to automatically evacuate workloads. Without DRS, you’re responsible for moving or shutting down VMs manually.

👉 This distinction alone has caused more failed maintenance windows than I can count.


Method 1: Using the vSphere Client (GUI Method)

For most environments, the vSphere Client is the safest and most transparent option, especially if you’re working through vCenter.

Steps

  1. Open the vSphere Client
  2. Connect to vCenter Server (recommended) or directly to the ESXi host
  3. Navigate to Hosts and Clusters
  4. Right-click the ESXi host
  5. Select Enter Maintenance Mode
  6. Confirm the action

If the host has running VMs, VMware will:

  • Automatically migrate them using vMotion (if available), or
  • Prompt you to power them off if migration isn’t possible

To bring the host back online:

  • Right-click the host
  • Select Exit Maintenance Mode

Real-World Insight

In production clusters, I always watch the Recent Tasks pane during this step. If a migration stalls or fails, it’s often due to:

  • ISO files mounted from local datastores
  • VM affinity rules
  • Snapshots on legacy hardware
  • Hidden CPU compatibility issues

Catching these early avoids scrambling later.

🔗 Internal link: Want to improve host security once in maintenance? Check out our VMware Security Best Practices.


Method 2: ESXCLI (Command-Line for Automation and Remote Work)

If you manage hosts remotely, work with automation pipelines, or prefer CLI control, ESXCLI is the most flexible option.

Enter Maintenance Mode

esxcli system maintenanceMode set --enable true

Exit Maintenance Mode

esxcli system maintenanceMode set --enable false

If you’re connecting remotely (for example, from a jump host), you’ll need connection flags such as:

--server
--username
--password

Common Errors You’ll See

  • “The host is not in maintenance mode” – appears if you try to exit when it isn’t enabled
  • VMs preventing entry – ESXCLI will fail if powered-on VMs still exist

When ESXCLI Shines

In large environments, ESXCLI pairs beautifully with:

  • PowerCLI scripts
  • Patch orchestration
  • Disaster recovery testing
  • Headless or remote sites with no GUI access

I’ve used ESXCLI extensively during after-hours maintenance when the GUI was painfully slow or temporarily unavailable.


Method 3: Service Console / vim-cmd (Advanced and Legacy Scenarios)

While less common today, vim-cmd and vimsh are still useful when troubleshooting broken hosts or management agent issues.

Using vmware-vim-cmd

vmware-vim-cmd /hostsvc/maintenance_mode_enter

Verify status:

vmware-vim-cmd hostsvc/hostsummary | grep -i maintenance

Exit maintenance mode:

vmware-vim-cmd /hostsvc/maintenance_mode_exit

Look for:

inMaintenanceMode = true/false

Using vimsh

vimsh -n -e /hostsvc/maintenance_mode_enter
vimsh -n -e /hostsvc/maintenance_mode_exit

When This Matters

I’ve relied on these commands when:

  • vSphere Client wouldn’t load
  • Hostd or vpxa agents were unstable
  • vCenter was offline but ESXi was reachable via SSH

They’re not pretty—but they work when you’re out of options.


Best Practice Tips from the Field

After years of managing VMware environments, these are the habits that save time and stress:

✅ Always Check VM Dependencies

Mounted ISOs, local datastores, or USB devices can silently block maintenance mode.

✅ Never Rush Cluster Maintenance

If multiple hosts need patching, do one at a time unless you fully understand your capacity headroom.

✅ Don’t Fight Stuck Hosts

If a host refuses to exit maintenance mode:

vim-cmd /hostsvc/maintenance_mode_exit

Then restart management agents as a last resort.

✅ Schedule During Low Load

Even with vMotion, evacuating large VMs during peak hours can spike latency and impact users.


Maintenance Mode and Lifecycle Management (vLCM)

If you’re still patching hosts manually, you’re making life harder than it needs to be.

vSphere Lifecycle Manager (vLCM) integrates directly with maintenance mode to:

  • Pre-stage ESXi patches
  • Sequence host remediation
  • Automatically evacuate workloads
  • Reduce total maintenance time

In real environments, vLCM is the difference between:

  • A clean, predictable patch window
  • And a late-night firefight when something fails mid-upgrade

Maintenance mode is the foundation that makes vLCM safe and reliable.


Related Supertechman Resources

To extend this knowledge, check out:

  • VMware Security Best Practices – harden ESXi while hosts are offline
  • Server & Network Maintenance Checklist – align virtual and physical maintenance
  • Server Room Maintenance Tasks – because airflow and cabling still matter

(Internal links strengthen SEO and topical authority.)


Conclusion: Treat Maintenance Mode with Respect

Putting an ESXi host into maintenance mode is a basic task—but basic doesn’t mean trivial.

Whether you use the GUI, ESXCLI, or low-level commands, the goal is always the same:
protect workloads while you make changes safely.

In well-run environments, maintenance mode becomes a non-event. In poorly planned ones, it’s where outages are born.

Master it, automate it where possible, and always understand what’s happening before you click “Enter”.

That’s the difference between reacting to incidents and running infrastructure with confidence.


Related Supertechman Resources


Leave a Reply

Your email address will not be published. Required fields are marked *