ESXi host Enter Maintenance Mode task stuck - VMware vSphere ESXi
search cancel

ESXi host Enter Maintenance Mode task stuck - VMware vSphere ESXi

book

Article ID: 412107

calendar_today

Updated On:

Products

VMware vSphere ESXi VMware vCenter Server

Issue/Introduction

The Enter maintenance mode task for an ESXi host remains in an intermediate state when powered-on virtual machines (VMs) cannot be evacuated. This often occurs in DRS Fully Automated clusters when affinity rules or system-managed VMs prevent automatic migration.



    • From vCenter's /var/log/vmware/vpxd/vpxd.log, below error log snippets are found:

      YYYY-MM-DDTHH:MM:SS info vpxd[######] [Originator@#### sub=VmCheck opID=########-####-auto-####-h5:########-f] CompatCheck results: (vim.vm.check.Result) [
      -->    (vim.vm.check.Result) {
      -->       vm = 'vim.VirtualMachine:########-####-46c3-####-#########9b:vm-#####',
      -->       host = 'vim.HostSystem:########-####-46c3-####-########9b:host-#####',
      -->       error = (vmodl.MethodFault) [
      -->          (vim.fault.VmHostAffinityRuleViolation) {
      -->             vmName = "VM1",
      -->             hostName = "hostname",
      -->             msg = "",
      -->          }
      -->       ],
      -->    }
      --> ]

Cause

  • Affinity Rules: Virtual machine-host affinity rules prevent DRS from finding a compatible destination host.
  • vCLS Dependencies: vSphere Cluster Service (vCLS) VMs are active on the host and stalling the transition due to vSphere Namespace configurations or internal service dependencies.

Resolution

Review these steps before running them:

    1. Identify the affinity rule preventing migration in the vSphere Client and either disable or edit it to allow the VM to migrate.
    2. Alternatively, power off the virtual machines on the target ESXi host to allow the task to proceed.
    3. If vCLS VMs are blocking the task, enable Retreat Mode on the cluster to remove the VMs.
    4. Verify that the host advanced setting Migrate.Enabled is set to 1.

    For more information, see Using Affinity Rules with vSphere DRS and vSphere Cluster Services (vCLS).

Additional Information

For more information about affinity rules, see Using Affinity Rules with vSphere DRS.