Affinity
Cheat sheet · https://pcornel.dk/topic.php?topic=3605
Answer
Affinity expresses co-location intent. It can reduce latency or keep tightly coupled components together, but it can also concentrate a failure domain. Platforms may implement affinity as a hard requirement, soft preference, group rule or scheduler hint; exact enforcement must be verified before relying on it for availability behavior.
Remember
- Affinity preference ≠ guaranteed co-location unless enforcement is hard.
- Co-location can increase correlated failure impact.
- An affinity rule can conflict with capacity or other placement rules.
- Rule configured ≠ rule currently satisfiable.
First checks
ha-manager rules list— Proxmox affinity rules (newer versions)(Get-ClusterGroup <vm>).AntiAffinityClassNames— Hyper-V anti-affinityGet-DrsRule (PowerCLI)— vSphere DRS rules
Verify in this order
rule → placement decisions
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 → Affinity reference map
| Boundary | Meaning | Evidence limit |
|---|---|---|
| Intent | Keep resources together | Policy objective |
| Strength | Hard vs soft/best-effort | Platform-specific |
| Candidate impact | May reduce eligible hosts | Can hurt failover flexibility |
| Outcome | Observed co-location | Verify under failure |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3605