Pcornel
Browse topics
Options
Recent
Favorites
Virtualization · Technical reference

Anti-Affinity

Direct answer

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.

When to use this

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.

First 30 seconds

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.

Operational verification

rule → separate hosts

Evidence · next step

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
Common mistakes
Common traps

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.

Platform / version applicability
virtualization-cluster
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformvirtualization-cluster
Scope / prerequisiteUse this topic when redundant VMs unexpectedly run together, an HA restart cannot satisfy separation, or a rule blocks …
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

1 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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 references

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.

observation · 1
Key points
  • 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.
Key checks
  • (Get-ClusterGroup <vm>).AntiAffinityClassNames — anti-affinity class
  • Get-DrsRule -Cluster <c> — DRS rules
  • ha-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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docvirtualization-cluster current

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%
Terminology layer

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.

Aliases that resolve here
vm anti-affinityanti affinity ruleha separation rule
Embedded reference data

Quick lookup tables

High Availability → Anti-Affinity reference map

Fast HA boundaries for High Availability → Anti-Affinity.

BoundaryMeaningEvidence limit
ScopeHost/rack/site-like separation targetExact domains platform-specific
StrengthHard or soft ruleChanges failover behavior
CapacityEnough eligible destinationsRequired to maintain separation
ServiceApplication replicas remain usefulIndependent verification
Confirmation

Confirm action

Continue?