Removing the OSD daemons

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

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.

Prerequisites

  • A running IBM Storage Cephr.

  • Hosts are added to the cluster.

  • Ceph Monitor, Ceph Manager and Ceph OSD daemons are deployed on the storage cluster.

Procedure

  1. Log into the Cephadm shell:

    Example

    [root@host01 ~]# cephadm shell
  2. Check the device and the node from which the OSD has to be removed:

    Example

    [ceph: root@host01 /]# ceph osd tree
  3. Remove the OSD:

    Syntax

    ceph orch osd rm OSD_ID [--replace] [--force] --zap

    Example

    [ceph: root@host01 /]# ceph orch osd rm 0 --zap
    Note: If you remove the OSD from the storage cluster without an option, such as --replace, the device is removed from the storage cluster completely. If you want to use the same device for deploying OSDs, you have to first zap the device before adding it to the storage cluster.
  4. Optional: To remove multiple OSDs from a specific node, run the following command:

    Syntax

    ceph orch osd rm OSD_ID OSD_ID --zap

    Example

    [ceph: root@host01 /]# ceph orch osd rm 2 5 --zap
  5. Check the status of the OSD removal:

    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.

Verification

  • Verify the details of the devices and the nodes from which the Ceph OSDs are removed:

    Example

    [ceph: root@host01 /]# ceph osd tree