TL;DR
| |
Why
Ceph’s default rule (replicated_rule) spreads objects across all OSDs without looking at the disk underneath. In a mixed cluster that means the “fast” pool also lands on the slow disks and performs like the worst of them.
Since Luminous every OSD carries a device class. Ceph detects it on its own at startup (hdd, ssd, or nvme) and a CRUSH rule can be restricted to one class: internally it builds a shadow hierarchy (default~sas) with only those OSDs and places the whole pool there. The class is a free label: besides the automatic ones you can use sas, sata, archive, or whatever helps you separate.
Checking the state
| |
Changing an OSD’s class
If the OSD already has a class, set-device-class does not overwrite it:
| |
Hence the rm-device-class first. Several OSDs at once:
| |
There is no “create the class” step: the ceph osd crush class create from the early Luminous builds was removed, and the class appears with the first OSD that gets it. To rename it cluster-wide, ceph osd crush class rename sas sas-10k.
A manually assigned class survives OSD restarts: on startup the OSD tries to set its automatic class and gets the same EBUSY. If you would rather have new OSDs come up with no class so you assign it yourself, ceph config set osd osd_class_update_on_start false; the price is that no new OSD gets an automatic class.
The rule
| |
rootisdefaultunless you built your own CRUSH tree.hostas the failure domain puts each replica on a different node. Withsize 3you need at least three nodes with OSDs of that class, or the PGs stayundersized.- For erasure-coded pools the class goes into the profile:
pveceph pool create ec-sas --erasure-coding k=4,m=2,device-class=sas.
The pool
New, with the Proxmox storage included:
| |
Existing: pveceph pool set vm-fast --crush_rule replicated_sas, or in the GUI Ceph → Pools → Edit → Crush Rule. It is the same as ceph osd pool set vm-fast crush_rule replicated_sas. The change triggers a backfill of the whole pool onto the class’s OSDs; do it in a maintenance window and follow it with ceph -s.
Traps
- Count the OSDs before the rule. Three nodes,
size 3, and only two withsasdisks: the pool never reachesactive+clean. - Automatic classes get it wrong with RAID/HBA controllers that present SSDs as rotational. Check
ceph osd treeafter adding disks and correct withrm-device-class+set-device-class. - Moving a big pool to another rule moves all of its data. Raise
osd_max_backfillsonly if you know what you are doing; it is slow by default on purpose. - Deleting a pool that refuses to go:
pveceph pool destroy <pool> --force --remove_storages(the data goes with it).
See also
- Ceph on Proxmox: crashes and orphaned disks
- No-subscription repositories — includes the Ceph repo
- Ceph documentation: CRUSH Maps — Device classes