Enabling vCenter Server High Availability (VCHA) fails 'This operation would violate a virtual machine affinity/anti-affinity rule'
vCenter Server 7.X
During VCHA deployment vpxd automatically creates anti-affinity rule for active, passive and witness nodes that prevents any pair of VCHA VMs residing on the same host.
Error is caused due to lack of Esxi hosts for deployment, in production deployment a minimum of 3 ESXi hosts are required
To avoid DRS anti-affinity rule errors when deploying VCHA nodes on the same host:
Go to vCenter Advanced Settings
Set the following parameter:
config.vpxd.vcha.drsAntiAffinity = False
Note: After the VCHA configuration, nodes can be moved to different ESXI hosts and the Advance settings parameter reverted back to True