Use this topic when redundant VMs unexpectedly run together, an HA restart cannot satisfy separation, or a rule blocks recovery because too few eligible hosts remain.
Anti-Affinity
Anti-affinity expresses separation intent. It is commonly used for redundant application instances, controllers or service peers so one host failure does not remove all copies. The guarantee depends on rule strength, available hosts and failure-domain awareness; a soft rule may be violated when the cluster lacks alternatives.
1. Anti-affinity keeps redundant VMs (DC1/DC2, nodes of a cluster) on different hosts.
2. Essential for real redundancy.
3. Needs enough hosts.
4. Check after migrations.
5. Alert on violations.
rule → separate hosts
Map shared dependencies and test the next failure while verifying application-level redundancy/quorum.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
It does not show storage, network, power or application state are independently redundant, nor that separation remains possible after additional failures.
Next check: Map shared dependencies and test the next failure while verifying application-level redundancy/quorum.
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
rule/group → failure-domain mapping → candidate count → scheduler decision → spread result → service redundancy test
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Anti-affinity configured ≠ separation guaranteed if the rule is soft.
- Hard anti-affinity can reduce availability if it blocks restart when capacity is scarce.
- Different hosts ≠ different racks/power/storage/network failure domains.
- Separation policy must match the actual redundancy architecture.
(Get-ClusterGroup <vm>).AntiAffinityClassNames— anti-affinity classGet-DrsRule -Cluster <c>— DRS rulesha-manager rules list— Proxmox rules
ReferenceImportant terms & boundaries2 sections · depth on demand
What this shows and what it does not
Different hosts ≠ independent failure domains; anti-affinity configured ≠ satisfiable; satisfied ≠ application quorum healthy.
Use host/failure-domain separation together with storage/network/application architecture. HA cannot create independence where shared dependencies remain.
In depth
Anti-affinity rules keep VMs apart so one host failure does not take down all instances of a service: domain controllers, cluster nodes, load-balanced web servers, redundant firewalls.
# Hyper-V
(Get-ClusterGroup dc01).AntiAffinityClassNames = 'DomainControllers'
(Get-ClusterGroup dc02).AntiAffinityClassNames = 'DomainControllers'
# vSphere: VM/Host Rule 'Separate Virtual Machines'
A cluster needs at least as many hosts as VMs in a strict anti-affinity group, plus one if you want them to stay separated during a host failure.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in High Availability → Anti-Affinity. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://libvirt.org/docs.html · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
High Availability → Anti-Affinity reference map
Fast HA boundaries for High Availability → Anti-Affinity.
| Boundary | Meaning | Evidence limit |
|---|---|---|
| Scope | Host/rack/site-like separation target | Exact domains platform-specific |
| Strength | Hard or soft rule | Changes failover behavior |
| Capacity | Enough eligible destinations | Required to maintain separation |
| Service | Application replicas remain useful | Independent verification |