Pcornel
Virtualization · High Availability

Affinity

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

Back to the Topic

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-affinity
  • Get-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

BoundaryMeaningEvidence limit
IntentKeep resources togetherPolicy objective
StrengthHard vs soft/best-effortPlatform-specific
Candidate impactMay reduce eligible hostsCan hurt failover flexibility
OutcomeObserved co-locationVerify 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

Confirmation

Confirm action

Continue?