Skip to main content
RunBook Academy

CephLXVI · Capacity ForecastingCapacity Forecasting

Headroom for a host failure

Advanced⏱ ~17 minceph

What you'll learn

  • Compute the host failure requirement
  • Verify the cluster can meet it
  • Account for the failure domain in the calculation
  • Track the figure as the cluster changes

Prerequisites

None — start here.

Verified against Ceph Tentacle 20.2.x · Ceph Squid 19.2.x (supported previous) · cephadm matches the verified Ceph release · podman 4.x · csi-rbd and csi-cephfs current · RBD / CephFS / RGW current (matches Ceph release) · Linux kernel 5.15+ (5.10 minimum) · Ubuntu 24.04 LTS (Ceph host baseline) · Debian 12 (Bookworm) (Ceph host baseline) · Rocky Linux / RHEL / AlmaLinux 9.x (Ceph host baseline) · Proxmox VE 9.x (cross-course integration) · Kubernetes 1.31+ (cross-course integration) · 2026-08-18

Not yet marked complete on this device.

Why this matters in production

A cluster that cannot absorb one host failure is a cluster that stays degraded after one. The calculation is short and is rarely performed.

The requirement

requirement = data on the largest host
available   = Σ over remaining OSDs of (capacity × backfillfull_ratio − used)
# per-host data
ceph osd df tree | awk '
  /host/ {h=$NF}
  /osd\./ {s[h] += $5}
  END {for (k in s) printf "%s %.1f TiB\n", k, s[k]/1024}' | sort -k2 -rn

# available below backfillfull, excluding the largest host
ceph osd df | awk 'NR>1 && $1 ~ /^[0-9]+$/ {
  cap=$5; used=$6; avail += cap*0.90 - used
} END {printf "%.1f TiB below backfillfull\n", avail/1024}'

If the requirement exceeds the available figure, a host failure stalls.

The failure domain matters

With failure_domain=host and size=3, the replacement copies must go to hosts that do not already hold a copy of the PG:

ceph osd crush rule dump | grep -A5 'type'
ceph osd pool get rbd-vms crush_rule

On a cluster with exactly three hosts and size=3, losing one host means there is no valid third host — the PGs stay undersized regardless of free space:

3 hosts, size=3, one host lost
  → 2 hosts remain, each already holds one copy
  → CRUSH cannot place a third
  → PGs are active+undersized indefinitely

This is a topology limit, not a capacity one, and adding disks does not fix it.

Hostssize=3 host failure
3undersized until the host returns
4recovers, needs 1/3 of remaining free
10recovers comfortably

Verifying

# what would happen — check the CRUSH rule can still place
ceph osd tree | grep -c '^-.*host'
ceph osd pool get rbd-vms size

# and the capacity
# (the two commands above)

Both checks matter, and they fail in different ways: the topology check failing means recovery is impossible; the capacity check failing means it stalls partway.

Tracking it as the cluster changes

# a check worth scheduling monthly
hosts=$(ceph osd tree | grep -c 'host ')
size=$(ceph osd pool get rbd-vms size -f json | python3 -c 'import sys,json;print(json.load(sys.stdin)["size"])')
[ "$hosts" -gt "$size" ] && echo 'topology OK' || echo 'TOPOLOGY: cannot recover a host failure'

The figure changes every time a host is added, an OSD is added, or usage grows — so a one-time check at deployment is not sufficient.

Quiz

Knowledge check · 4 questions

  1. Q1. On a 3-host cluster with size=3 and failure_domain=host, what happens when a host fails?

  2. Q2. The host failure requirement should be computed from the average host's data.

  3. Q3. Verify host failure absorption on a heterogeneous cluster.

    A cluster has six hosts with 12 OSDs each and two newer hosts with 24 OSDs each. Overall utilisation is 76%. No one has checked whether a host failure can be absorbed.

  4. Q4. What are the two distinct checks for host failure absorption, and how do they fail differently?

Passing score: 75%. Answers are checked in this browser.

Production discipline

Run both host-failure checks monthly: the topology check (host count exceeds pool size) and the capacity check (largest host’s data against space below backfillfull elsewhere). Compute the requirement from the largest host, not the average — expansions make hosts heterogeneous and the worst case is what matters.

Cross-course references

  • Kubernetes: verifying the largest node’s pods can be rescheduled, not the average node’s
  • Linux: sizing a spare against the largest array member rather than the typical one