Pcornel
Virtualization · High Availability

Anti-Affinity

Cheat sheet · https://pcornel.dk/topic.php?topic=3606

Back to the Topic

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.

Remember

  • 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.

First checks

  • (Get-ClusterGroup <vm>).AntiAffinityClassNames — anti-affinity class
  • Get-DrsRule -Cluster <c> — DRS rules
  • ha-manager rules list — Proxmox rules

Verify in this order

rule → separate hosts

Where it usually breaks

First mismatch in cluster membership/quorum → node capability/health → placement policy → resource ownership → migration/failover task → guest/workload continuity; preserve identity/native error/pre-state before mutation.

High Availability → Anti-Affinity reference map

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

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3606

Confirmation

Confirm action

Continue?