Skip to main content
RunBook Academy

CephCXII · OSD Host LossOSD Host Loss

Marking out and the two data movements

Advanced⏱ ~18 minceph

What you'll learn

  • Distinguish the osdmap weight from the CRUSH weight
  • Predict how much data each action moves
  • Reverse an out safely
  • Choose between draining and waiting

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

Marking an OSD out and removing it from CRUSH both trigger backfill, and doing them at different times makes the cluster move data twice for one failure.

Two different weights

ceph osd tree | head -8
ceph osd dump | grep -E '^osd[.]18 '
ID  CLASS  WEIGHT   TYPE NAME     STATUS  REWEIGHT
18   ssd   7.27664      osd.18     down          0
WeightWhere it livesChanging it moves
CRUSH weight (WEIGHT)the CRUSH map, in the bucket hierarchyPGs across the whole tree
osdmap weight (REWEIGHT)the osdmap, applied after selectiononly PGs that landed on that OSD
ceph osd out 18 19 20            # sets REWEIGHT to 0
ceph osd in 18 19 20             # sets it back to 1
ceph osd crush reweight osd.18 0 # changes the CRUSH weight — much larger

Watching the movement

ceph -s | grep -E 'degraded|misplaced|recovering|backfill'
CounterMeaningDurability risk
degradedfewer than size copies existreal
misplacedsize copies exist, on the wrong OSDsnone
remappedthe PG has a new target setnone by itself
backfill_waitqueued, not yet startednone
Degraded falling and misplaced rising is recovery working. Misplaced
rising with degraded flat means something changed placement, not
redundancy.

Reversing it

ceph osd in 18 19 20
ceph -s | grep misplaced
Marking back in after backfill has partly completed does not undo the
work already done. The copies made elsewhere stay until the returning
OSDs are current, then the surplus is removed.
# check the returning OSDs are actually healthy before marking in
ceph osd metadata 18 | python3 -c '
import sys,json
d = json.load(sys.stdin)
for k in ("hostname","osd_objectstore","bluestore_bdev_type","default_device_class"):
    print("%-24s %s" % (k, d.get(k)))'
ceph osd perf | head

Drain or wait

ceph orch host drain ceph-osd-07
ceph orch osd rm status
SignalAction
Host returning, hardware soundwait; let the OSDs rejoin
Host returning, disks suspectlet recovery run, return the host empty
Host not returningdrain, so the removal happens once
Uncertain, capacity tightrecover first, decide about removal later

Quiz

Knowledge check · 4 questions

  1. Q1. Why does removing an OSD from the CRUSH map move more data than marking it out?

  2. Q2. Misplaced objects carry the same durability risk as degraded objects.

  3. Q3. Plan the map changes after a host failure.

    A host with 12 OSDs failed three days ago and recovery completed. The hardware is being written off. An engineer proposes removing the OSDs from CRUSH now that the cluster is HEALTH_OK.

  4. Q4. What happens to backfilled copies when an out OSD is marked back in?

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

Production discipline

Treat CRUSH removal as a scheduled change with its own backfill, not as cleanup after recovery. When a host is confirmed dead, drain it in one pass so the cluster pays for the failure once rather than twice.

Cross-course references

  • Kubernetes: cordon and drain are two decisions, and conflating them moves workloads twice
  • Linux: reversible and irreversible operations belong in different change windows