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.
/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 = "",--> }--> ],--> }--> ]Review these steps before running them:
For more information, see Using Affinity Rules with vSphere DRS and vSphere Cluster Services (vCLS).
For more information about affinity rules, see Using Affinity Rules with vSphere DRS.