Pcornel
Browse topics
Options
Recent
Favorites
Virtualization · Technical reference

Affinity

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

When to use this

Use this topic when workloads should co-locate, HA placement appears to ignore a preferred relationship, or an affinity rule reduces the number of viable recovery hosts.

First 30 seconds

1. Affinity keeps related VMs together (e.g. app and cache).

2. Use soft rules where possible.

3. Hard rules can block HA.

4. Document reasons.

5. Review regularly.

Operational verification

rule → placement decisions

Evidence · next step

Test the rule with reduced host capacity and review whether the resulting shared failure domain matches the application design.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common traps

It does not show the rule can always be satisfied during larger failures or that co-location improves application availability.

Next check: Test the rule with reduced host capacity and review whether the resulting shared failure domain matches the application design.

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 workloads should co-locate, HA placement appears to ignore a preferred relationship, or an affinity…
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 definition → VM/resource membership → candidate hosts → scheduler evaluation → co-location outcome → workload 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
  • 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.
Key checks
  • ha-manager rules list — Proxmox affinity rules (newer versions)
  • (Get-ClusterGroup <vm>).AntiAffinityClassNames — Hyper-V anti-affinity
  • Get-DrsRule (PowerCLI) — vSphere DRS rules
ReferenceImportant terms & boundaries2 sections · depth on demand

What this shows and what it does not

Affinity configured ≠ enforced; enforced ≠ always satisfiable; co-located ≠ more available.

Affinity describes placement relationship, not application dependency. Application architecture still determines whether co-location is desirable.

In depth

Affinity rules keep VMs together on the same host — e.g. an application server with its cache for low-latency traffic, or VMs bound to licensed hosts (VM–host affinity).

# vSphere: Cluster > Configure > VM/Host Rules (Keep VMs together; VMs to Hosts must/should)
# Proxmox 8.x HA groups: restrict VMs to a set of nodes with priorities
ha-manager groupadd licensed --nodes 'pve1:2,pve2:1' --restricted 1

Use "should" rules where possible; "must" rules can block HA restarts when the required hosts are down.

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 → 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 affinityaffinity ruleha affinity
Embedded reference data

Quick lookup tables

High Availability → Affinity reference map

Fast HA boundaries for High Availability → Affinity.

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
Confirmation

Confirm action

Continue?