Removing OSDs

You can remove the OSD from a cluster by using cephadm.

Before you begin

Before you begin, make sure that you have the following prerequisites in place:
  • A running IBM Storage Ceph.
  • Hosts are added to the cluster.
  • Ceph Monitor, Ceph Manager, and Ceph OSD daemons are deployed on the storage cluster.

About this task

Removing an OSD from a cluster involves two steps:
  1. Evacuates all placement groups (PGs) from the cluster.
  2. Removes the PG-free OSDs from the cluster.
The --zap option removed the volume groups, logical volumes, and the LVM metadata.

Procedure

  1. Log into the cephadm shell.
    For example,
    [root@host01 ~]# cephadm shell
  2. Check the device and the node from which the OSD has to be removed.
    ceph osd tree
    For example,
    [ceph: root@host01 /]# ceph osd tree
  3. Remove the OSD.
    You can either remove a specific OSD from the storage cluster or multiple OSDs from a specific node.
    • Remove the OSD from the storage cluster.
      Important: Removing the OSD from the storage cluster without an option, such as --replace, removes the device completely from the storage cluster completely. If you want to use the same device for deploying OSDs, first zap the device before adding it to the storage cluster.
      ceph orch osd rm OSD_ID [--replace] [--force] --zap
      For example,
      [ceph: root@host01 /]# ceph orch osd rm 0 --zap
    • Remove multiple OSDs from a specific node.
      ceph orch osd rm OSD_ID OSD_ID --zap
      For example,
      [ceph: root@host01 /]# ceph orch osd rm 2 5 --zap
  4. Use the osd rm status command to check the removal status.
    For example,
    [ceph: root@host01 /]# ceph orch osd rm status
    OSD  HOST   STATE                    PGS  REPLACE  FORCE  ZAP   DRAIN STARTED AT            
    9    host01 done, waiting for purge    0  False    False  True  2023-06-06 17:50:50.525690  
    10   host03 done, waiting for purge    0  False    False  True  2023-06-06 17:49:38.731533  
    11   host02 done, waiting for purge    0  False    False  True  2023-06-06 17:48:36.641105
    When no PGs are left on the OSD, it is decommissioned and removed from the cluster.

What to do next

Verify the details of the devices and the nodes from which the Ceph OSDs are removed.
ceph osd tree