ESXi Stuck in Maintenance Mode – Troubleshooting & Fix

Listen to this Post

If an ESXi host enters Maintenance Mode but gets stuck, it typically means the system is waiting for tasks to complete, VMs to migrate, or there’s an issue with DRS, vMotion, or agent communication.

You Should Know:

1. Check for Running or Powered-On VMs

Maintenance Mode requires all VMs to be powered off or migrated.
– In vSphere Client:

 Check running VMs 
vim-cmd vmsvc/getallvms 
 Power off a VM forcefully (if needed) 
vim-cmd vmsvc/power.off <vmid> 

2. Check for Pending Tasks

  • View recent tasks:
    tail -f /var/log/vpxa.log | grep "Task in progress" 
    

3. Check DRS Status

  • Manual vMotion command (if DRS fails):
    vmware-cmd --server <vcenter> --vihost <esxi_host> <vm_path> migrate --pool=<resource_pool> --priority=high 
    

4. Restart Management Agents

  • SSH into the host and run:
    services.sh restart 
    OR 
    /etc/init.d/hostd restart 
    /etc/init.d/vpxa restart 
    

5. Exit Maintenance Mode Manually

  • CLI command to exit Maintenance Mode:
    vim-cmd hostsvc/maintenance_mode_exit 
    

6. Force Maintenance Mode (if needed)

  • Force enter Maintenance Mode:
    vim-cmd /hostsvc/maintenance_mode_enter 
    
  • Force exit Maintenance Mode:
    vim-cmd /hostsvc/maintenance_mode_exit 
    

7. Check Logs

  • Investigate logs for errors:
    grep -i "MaintenanceMode" /var/log/hostd.log 
    grep -i "vMotion" /var/log/vpxa.log 
    

8. Last Resort – Reboot

  • Graceful reboot command:
    reboot 
    

What Undercode Say

When an ESXi host gets stuck in Maintenance Mode, the root cause is often related to pending VM migrations, DRS misconfigurations, or agent communication failures. Always start by checking running VMs and stuck tasks. Use CLI commands to restart services or force Maintenance Mode exit if necessary. Log analysis (hostd.log, vpxa.log) is critical for deeper troubleshooting. In extreme cases, a controlled reboot may be required—but only after ensuring minimal disruption.

Expected Output:

A resolved ESXi host exiting Maintenance Mode successfully, with all VMs either migrated or shut down cleanly. Logs should show no pending tasks or errors related to vMotion/DRS.

Relevant URLs:

References:

Reported By: Shamseer Siddiqui – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅

Join Our Cyber World:

💬 Whatsapp | 💬 TelegramFeatured Image