Australian cloud for business software — built and run in Sydney since 2003

NetLeverage
NetLeverage

Are your redundant servers on the same physical host? Anti-affinity rules explained

Technical article
Hosting

About this article: AI-assisted writing, reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

A business pays for two domain controllers, two web servers or a pair of database servers so that one can fail without stopping work. In a virtualised environment, both of those servers might be running on the same physical host. If that host fails, both stop at once, and the redundancy that was paid for does nothing.

Hypervisor platforms have rules to prevent this. This article explains how they work in VMware vSphere and in Windows Server failover clusters (the basis of Hyper-V clustering), where they stop protecting you, and what to ask.

Why it matters

Virtual machines move between hosts for load balancing and maintenance. Two servers placed on different hosts on day one can end up together a month later unless something keeps them apart. The failure is silent: nothing looks wrong until the shared host goes down.

How it works

VMware vSphere: VM-VM anti-affinity

vSphere's Distributed Resource Scheduler (DRS) places and moves VMs across the hosts of a cluster. Its VM-VM rules come in two types: Keep Virtual Machines Together, and Separate Virtual Machines. Broadcom explains the purpose of the second: with an anti-affinity rule, DRS tries to keep the specified VMs apart, so that when a problem occurs with one host, you do not lose both virtual machines.

Points from Broadcom's documentation that affect how far the rule protects you:

  • It is a "tries" rule. If the cluster is already in violation when the rule is added, the system keeps running and tries to correct it. In manual or partially automated DRS, the corrective moves are recommendations that someone has to approve.
  • Violations are reported. A rule DRS cannot satisfy appears as a fault on the cluster's DRS tab and produces a log event.
  • Conflicting rules. If two VM-VM rules conflict, the older takes precedence and the newer is deactivated. Broadcom adds that DRS gives higher precedence to preventing anti-affinity violations than affinity violations.
  • An unsupported combination. VM-VM affinity rules are not supported when vSphere HA uses the Specify Failover Hosts admission control policy with multiple failover hosts.

vSphere HA: what happens when a host fails

vSphere High Availability (HA) restarts VMs from a failed host on the remaining hosts. Broadcom states that during failover, HA's first priority is the immediate availability of all virtual machines. DRS can rebalance afterwards.

HA's treatment of VM-VM anti-affinity depends on the effective das.respectVmVmAntiAffinityRules setting. For the vSphere 8 scope here, Broadcom identifies TRUE as the default in its vCenter Server 8.0 Update 3 release notes. When effective TRUE, HA respects the rule; if restarting a VM would violate it, HA can leave that VM down and report insufficient resources. Setting the option explicitly FALSE allows HA to disregard the VM-VM anti-affinity rule during restart, so partners may temporarily share a host. An absent explicit override does not mean FALSE.

Build matters as well as configuration. Those release notes document PR 3354058, fixed in 8.0 Update 3: the options could previously fail to follow either configured expectation. Ask the provider to verify the exact build, effective setting, applicable fixes and available capacity. Keep HA restart enforcement separate from DRS placement recommendations; neither a generic label nor an old-version default establishes current behaviour.

Windows Server failover clusters

Microsoft's failover clustering, used to cluster Hyper-V hosts, keeps roles such as VMs apart with a property called AntiAffinityClassNames. Roles given the same value are kept on different nodes where possible. Microsoft describes it as a "soft" block: the cluster tries to keep them apart, but still lets them run on the same node if it cannot. Microsoft's example is a two-node cluster with one node down for maintenance; both roles then run on the remaining node.

For a hard block, Microsoft describes the cluster property ClusterEnforcedAntiAffinity. When it is enabled, roles with the same class name are prevented from coming online together on the same node.

What to choose and why

The choice between soft and hard rules is a choice about which failure is worse.

Setting Effect when the hosts left cannot keep the pair apart
VMware HA with effective das.respectVmVmAntiAffinityRules=FALSE; Windows AntiAffinityClassNames alone A restart may place both partners on the same host when capacity and other rules allow
VMware HA with effective TRUE (the documented vSphere 8 default); Windows ClusterEnforcedAntiAffinity enabled A partner may remain offline if restarting it would violate separation

For pairs such as two domain controllers or two web servers, where either server can carry the load alone, running together temporarily keeps the service up, which is the better outcome. A hard rule suits cases where sharing a host is itself the harm, such as members of a cluster whose design assumes separate hardware. Either way, the cluster needs enough hosts: a pair cannot be kept apart on fewer than two working hosts.

Questions to ask a provider:

  1. Are anti-affinity rules set for each of my redundant pairs? Name the pairs.
  2. Soft or hard, and what happens during host maintenance and after a host failure?
  3. Who is told when a rule is violated, and how quickly is it corrected?
  4. Are the two servers' disks on separate storage? Separate hosts do not help if both servers' disks share one datastore that fails.
  5. How many hosts are in the cluster, and is there spare capacity to keep pairs apart while one host is down?
  6. Can you show which host each of my servers is on now, and give me that report again after maintenance?

Risks and limits

  • Rules cover hosts, not everything. Shared storage, network switches and power can still be common points of failure.
  • Rules are per cluster. They do not separate servers across sites or clusters.
  • New servers need new rules. A server added later is not covered until someone adds it.
  • Manual DRS needs people. Recommendations to fix violations wait for approval.
  • No commands are given here. Microsoft's cluster affinity page shows how the properties are set.

Sources

Opened 14 November 2026.

Related service: Cloud hosting.

Related future topics

  • What "private cloud" means: shared hardware and dedicated hosts.
  • Host maintenance and live migration: what your VM notices.
  • Noisy neighbours in a shared cloud.

Learning notes

  • Redundant VMs on the same host fail together.
  • vSphere's Separate Virtual Machines rule keeps a pair apart; DRS tries, and reports violations.
  • vSphere 8 HA respects VM-VM anti-affinity by default; verify the effective option, exact build and applicable fixes before relying on restart behaviour.
  • Windows failover clustering's AntiAffinityClassNames is soft; ClusterEnforcedAntiAffinity makes it hard.
  • Separate hosts do not help if both servers share the same storage.