Anti-Affinity
Cheat sheet · https://pcornel.dk/topic.php?topic=3606
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 classGet-DrsRule -Cluster <c>— DRS rulesha-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
| 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 |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3606