Skip to main content
RunBook Academy

CephLXV · Why Full Clusters Are DangerousWhy Full Clusters Are Dangerous

Emergency space reclamation

Advanced⏱ ~18 mincephrbdradosgw-admin

What you'll learn

  • Identify reclaimable space quickly under pressure
  • Order reclamation by speed and reversibility
  • Execute each safely
  • Prepare the list before it is needed

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

At the full ratio the useful question is not “how did this happen” but “what can be deleted in the next ten minutes”. Having the answer written down in advance is worth more than any command in this lesson.

Ordered by speed and reversibility

ActionSpeedReversibleTypical yield
Delete RBD snapshotsfastnooften large
Abort incomplete multipart uploadsfastnooften large on RGW
Delete a scratch or test poolfastnowhole pool
Lower a non-critical pool’s sizefastyes, at backfill costone copy of that pool
Delete expired RGW objectsmoderatenodepends on lifecycle
Remove old CephFS snapshotsmoderatenodepends on churn
Trim RBD images with fstrim in guestsmoderaten/adepends on guest churn

RBD snapshots

for i in $(rbd ls rbd-vms); do rbd snap ls rbd-vms/$i --format json; done \
  | python3 -c 'import sys,json
for line in sys.stdin:
    for s in json.loads(line): print(s["name"], s["size"])'

rbd snap rm rbd-vms/vm-disk-1@old-backup

Snapshots hold every block that has changed since they were taken, so on a write-heavy image an old snapshot can approach the image’s own size.

RGW multipart uploads

for b in $(radosgw-admin bucket list --format json | python3 -c 'import sys,json;[print(x) for x in json.load(sys.stdin)]'); do
  echo -n "$b "
  radosgw-admin bucket stats --bucket="$b" --format json \
    | python3 -c 'import sys,json; d=json.load(sys.stdin); print(d.get("usage",{}))'
done
# abort uploads older than a threshold
# BUCKET from the `radosgw-admin bucket list` loop above:
BUCKET=media-archive

radosgw-admin bucket check --bucket="$BUCKET" --fix

Lowering a pool’s size

ceph osd pool get backups size
ceph osd pool set backups size 2
watch -n 15 'ceph df | grep backups'

The space returns within minutes as the OSDs delete the surplus shards. It is the only reversible item on the list, which makes it the right first move when the alternative is an irreversible deletion made under pressure.

Trimming from guests

# inside a guest whose RBD image has discard enabled
fstrim -av
# confirm the image supports it
rbd info rbd-vms/vm-disk-1 | grep features

Blocks freed inside a guest filesystem are not released to the cluster unless discard reaches the image. On a long-running VM the reclaimable amount can be substantial.

Preparing the list in advance

prod-ceph-01 emergency reclamation, in order:
  1. pool 'scratch' — 8 TB — safe to delete entirely, owner: platform
  2. backups size 3→2 — releases ~14 TB — reversible, owner: platform
  3. RBD snapshots older than 30 days in rbd-vms — ~6 TB — owner: virt
  4. RGW multipart uploads older than 7 days — ~4 TB — owner: storage
  5. fstrim across VM fleet — unknown, likely 5–10 TB — owner: virt

Written before it is needed, with owners named and sizes estimated, this turns a ten-minute decision under pressure into a checklist.

Quiz

Knowledge check · 4 questions

  1. Q1. Which emergency reclamation option is reversible?

  2. Q2. `cache-flush-evict-all` on a cache tier is a valid emergency space reclamation step on a current Ceph cluster.

  3. Q3. Reclaim space under pressure.

    A cluster has hit the full ratio and writes are blocked. No prepared reclamation list exists. The team is deciding what to delete while an incident call is running.

  4. Q4. Why can an old RBD snapshot approach the size of its image?

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

Production discipline

Write the emergency reclamation list before it is needed, with sizes, owners, and reversibility noted — under pressure it turns a decision into a checklist. Prefer the reversible action first: lowering a non-critical pool’s size buys time to make the irreversible deletions properly.

Cross-course references

  • Kubernetes: a documented eviction order beats deciding which workloads to shed during an incident
  • Linux: knowing in advance which directories are safe to clear saves the same minutes