"Upgrade failed. Failed getting host recommendation from DRS to enter maintenance mode for cluster 'cluster name'." Reason, 'This operation would violate a virtual machine affinity/anti-affinity rule.VMware NSX
VMware VCenter 7.X
VMware VCenter 8.X
VM affinity or anti-affinity rules are configured on the cluster referenced in the error message, preventing the migration of virtual machines.
As a result, the host cannot enter maintenance mode, leading to the upgrade failure.
Please be aware some affinity rules are considered over-rideable such as VM groups to Host groups and others are not such as anti-affinity rules for VMs when limited hosts are available. KB Understanding the functionality of the DRS anti-affinity rule to separate virtual machines by host explains such a limitation that would block DRS.
Set the DRS to "fully automated" and disable all the VM affinity rules on the cluster referenced in the error message.
Steps: