Adding an OSD to CRUSH
Adding a Ceph OSD to a CRUSH hierarchy is the final step before you might start an OSD
(rendering it up and in) and Ceph assigns placement groups to the
OSD. You must prepare a Ceph OSD before you add it to the CRUSH hierarchy.
Deployment utilities, such as the Ceph Orchestrator, can prepare a CephOSD before adding it to the CRUSH hierarchy. For example creating a Ceph OSD on a single node:
Syntax
ceph orch daemon add osd HOST:DEVICE,[DEVICE]
The CRUSH hierarchy is notional, so the ceph osd crush add command allows you to
add OSDs to the CRUSH hierarchy wherever you wish. The location you specify should reflect
its actual location. If you specify at least one bucket, the command places the OSD into the most
specific bucket you specify, and it moves that bucket underneath any other buckets you
specify.
To add an OSD to a CRUSH hierarchy:
Syntax
ceph osd crush add ID_OR_NAME WEIGHT [BUCKET_TYPE=BUCKET_NAME ...]
The following example adds osd.0 to the hierarchy:
ceph osd crush add osd.0 1.0 root=default datacenter=dc1 room=room1 row=foo rack=bar host=foo-bar-1
ceph osd crush set or ceph osd crush
create-or-move to add an OSD to the CRUSH hierarchy.