Troubleshooting ESXi Host Maintenance Mode Stalls due to Orphaned Virtual Machines
search cancel

Troubleshooting ESXi Host Maintenance Mode Stalls due to Orphaned Virtual Machines

book

Article ID: 451571

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

  • ESXi host remains stuck in "Entering Maintenance Mode" task (often at 75% or 32%).
  • vCenter Server reports specific virtual machines as "orphaned."
  • Active VMX processes for these orphaned VMs are visible via command line on the host.
  • DRS/HA functionality is impacted as the host cannot be vacated or patched.

Environment

  • VMware ESXi 7.x/8.x
  • vCenter Server

Cause

A registration inconsistency exists between the vCenter Server inventory and the ESXi host internal inventory. The host retains stale VMX processes for VMs that vCenter identifies as orphaned, creating a locking condition that prevents the host from completing the pre-maintenance mode inventory validation checks.

Resolution

  1. Log in to the affected ESXi host as root via SSH.
  2. Identify all registered virtual machines, identified by their VMID and display name: vim-cmd vmsvc/getallvms
  3. Check the current state of the impacted virtual machine using the VMID found in step 2: vim-cmd vmsvc/power.getstate <VMID>
  4. Check for hung tasks on the virtual machine that prevent power operations: vim-cmd vmsvc/get.tasklist <VMID>
  5. Shutdown the virtual machine using the VMID: vim-cmd vmsvc/power.shutdown <VMID>
  6. If the virtual machine fails to shut down, perform a hard power-off: vim-cmd vmsvc/power.off <VMID>
  7. Restart host management agents to synchronize with vCenter: /etc/init.d/hostd restart /etc/init.d/vpxa restart
  8. Attempt to place the host into maintenance mode again.

Additional Information

Powering off an unresponsive virtual machine on an ESXi host