Pcornel
Virtualization · Resource Management

Memory Shares

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

Back to the Topic

Answer

Memory shares decide which VMs keep their memory when the host runs short: under pressure, VMs with fewer shares are ballooned or swapped first. They do nothing while the host has free memory.

Remember

  • Shares only act under pressure.
  • Low shares = reclaimed first.
  • Pool shares split among VMs.

First checks

  • Set-VMMemory <vm> -Priority 80 — Hyper-V memory weight
  • virsh memtune <vm> --soft-limit — libvirt soft limit
  • Get-VMResourceConfiguration (PowerCLI) — vSphere shares

Verify in this order

pressure → shares → reclaim targets

Where it usually breaks

First mismatch in management intent → host/cluster capability → hypervisor runtime/task → virtual resource/device → guest state → workload-visible read-back; preserve identity/native error/pre-state before mutation.

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

Confirmation

Confirm action

Continue?