Skip to content

Add, remove, or reconfigure Ceph OSDs with metadata devices#

Pelagia Lifecycle Management (LCM) Controller simplifies Ceph cluster management by automating LCM operations. This section describes how to add, remove, or reconfigure Ceph OSDs with a separate metadata device.

Add a Ceph OSD with a metadata device#

  1. Configure one disk for data and one logical volume for metadata of a Ceph OSD to be added to the Ceph cluster.

    Note

    If you add a new disk after node provisioning, manually prepare the required node devices using Logical Volume Manager (LVM) 2 on the existing node.

    Note

    You can add a Ceph OSD on top of a raw device that is already present on a node or that you add to the node later. To add a raw device to a node:

    • Add the device during node deployment.
    • If the node supports adding devices without a reboot, hot plug the device.
    • If the node does not support hot plugging, shut down the node, add the device, and start the node again.
  2. Open the CephDeployment custom resource (CR) for editing:

    kubectl -n pelagia edit cephdpl
    

  3. In the nodes.<nodeName>.devices section, specify the parameters for a Ceph OSD as required. For the parameters description, see Nodes parameters.

    The example configuration of the nodes section with the new node:

    nodes:
    - name: storage-worker-505
      roles:
      - mon
      - mgr
      devices:
      - config: # existing item
          deviceClass: hdd
        fullpath: /dev/disk/by-id/scsi-SATA_HGST_HUS724040AL_PN1334PEHN18ZS
      - config: # new item
          deviceClass: hdd
          metadataDevice: /dev/bluedb/meta_1
        fullpath: /dev/disk/by-id/scsi-0ATA_HGST_HUS724040AL_PN1334PEHN1VBC
    

  4. Verify that the Ceph OSD is successfully deployed on the specified node. The CephDeploymentHealth CR status.healthReport.cephDaemons.cephDaemons section should not contain any issues:

    kubectl -n pelagia get cephdeploymenthealth -o yaml
    

    For example:

    status:
      healthReport:
        cephDaemons:
          cephDaemons:
            osd:
              info:
              - 4 osds, 4 up, 4 in
              status: ok
    

  5. Verify the Ceph OSD status:

    kubectl -n rook-ceph get pod -l app=rook-ceph-osd -o wide | grep <nodeName>
    

    Substitute <nodeName> with the corresponding node name.

    Example of system response:

    rook-ceph-osd-0-7b8d4d58db-f6czn   1/1     Running   0          42h   10.100.91.6     kaas-node-6c5e76f9-c2d2-4b1a-b047-3c299913a4bf   <none>           <none>
    rook-ceph-osd-1-78fbc47dc5-px9n2   1/1     Running   0          21h   10.100.91.6     kaas-node-6c5e76f9-c2d2-4b1a-b047-3c299913a4bf   <none>           <none>
    rook-ceph-osd-3-647f8d6c69-87gxt   1/1     Running   0          21h   10.100.91.6     kaas-node-6c5e76f9-c2d2-4b1a-b047-3c299913a4bf   <none>           <none>
    

Remove a Ceph OSD with a metadata device#

Ceph OSD removal presupposes usage of a CephOsdRemoveTask CR. For workflow overview, see Creating a Ceph OSD remove task.

Warning

We do not recommend using replicated Ceph pools with replicated.size of less than 3 in production environments. For such pools, Ceph OSD removal may cause issues. If replicated.size is 1, Ceph LCM operations cannot function correctly. Set replicated.size to 3 for each replicated Ceph pool. For erasure-coded pools, the minimal recommended configuration is 2+1, that is, erasureCoded.dataChunks: 2 and erasureCoded.codingChunks: 1.

  1. Open the CephDeployment object for editing:

    kubectl -n pelagia edit cephdpl
    

  2. Remove the required Ceph OSD specification from the spec.nodes.<nodeName>.devices list.

    Example configuration of the nodes section with the new node:

    nodes:
    - name: storage-worker-505
      roles:
      - mon
      - mgr
      devices:
      - config:
          deviceClass: hdd
        fullpath: /dev/disk/by-id/scsi-SATA_HGST_HUS724040AL_PN1334PEHN18ZS
      - config: # remove the entire item entry from devices list
          deviceClass: hdd
          metadataDevice: /dev/bluedb/meta_1
        fullpath: /dev/disk/by-id/scsi-0ATA_HGST_HUS724040AL_PN1334PEHN1VBC
    

  3. Create a YAML template for the CephOsdRemoveTask CR. Select from the following options:

    • Remove Ceph OSD by device name, by-path symlink, or by-id symlink:

      apiVersion: lcm.mirantis.com/v1alpha1
      kind: CephOsdRemoveTask
      metadata:
        name: remove-osd-<nodeName>-task
        namespace: pelagia
      spec:
        nodes:
          <nodeName>:
            cleanupByDevice:
            - device: sdb
            - device: sdc
      

      Warning

      We do not recommend setting device name or device by-path symlink in the cleanupByDevice field as these identifiers are not persistent and can change at node boot. Remove Ceph OSDs with by-id symlinks or use cleanupByOsd instead. For details, see Addressing Ceph storage devices.

      Note

      If a device was physically removed from a node, cleanupByDevice is not supported. Therefore, use cleanupByOsd instead.

    • Remove Ceph OSD by OSD ID:

      apiVersion: lcm.mirantis.com/v1alpha1
      kind: CephOsdRemoveTask
      metadata:
        name: remove-osd-<nodeName>-task
        namespace: pelagia
      spec:
        nodes:
          <nodeName>:
            cleanupByOsd:
            - id: 5
            - id: 10
      

  4. Apply the template:

    kubectl apply -f remove-osd-<nodeName>-task.yaml
    

  5. Verify that the corresponding task has been created:

    kubectl -n pelagia get cephosdremovetask remove-osd-<nodeName>-task
    

  6. Verify that the removeInfo section appeared in the CephOsdRemoveTask CR status:

    kubectl -n pelagia get cephosdremovetask remove-osd-<nodeName>-task -o yaml
    

    Example of system response:

    status:
      removeInfo:
        cleanupMap:
          storage-worker-505:
            osdMapping:
              "10":
                deviceMapping:
                  sdb:
                    devicePath: "/dev/disk/by-path/pci-0000:00:1t.9"
                    osdPartition: "/dev/ceph-b-vg_sdb/osd-block-b-lv_sdb"
                    osdPartitionType: "block"
                    rotational: true
                    deviceCleanup: true
              "5":
                deviceMapping:
                  /dev/sdc:
                    devicePath: /dev/disk/by-path/pci-0000:00:0f.0
                    osdPartition: /dev/ceph-2d11bf90-e5be-4655-820c-fb4bdf7dda63/osd-block-e41ce9a8-4925-4d52-aae4-e45167cfcf5c
                    osdPartitionType: block
                    rotational: true
                    deviceCleanup: true
                  /dev/sdf:
                    devicePath: /dev/disk/by-path/pci-0000:00:12.0
                    osdPartition: /dev/bluedb/meta_1
                    osdPartitionType: db
                    rotational: true
    

  7. Verify that the cleanupMap section matches the required removal and wait for the ApproveWaiting phase to appear in status:

    kubectl -n pelagia get cephosdremovetask remove-osd-<nodeName>-task -o yaml
    

    Example of system response:

    status:
      phase: ApproveWaiting
    

  8. In the CephOsdRemoveTask CR, set the approve flag to true:

    kubectl -n pelagia edit cephosdremovetask remove-osd-<nodeName>-task
    

    Configuration snippet:

    spec:
      approve: true
    

  9. Review the following status fields of the Ceph LCM CR processing:

    • status.phase - current state of task processing;
    • status.messages - description of the current phase;
    • status.conditions - full history of task processing before the current phase;
    • status.removeInfo.issues and status.removeInfo.warnings - error and warning messages occurred during task processing, if any.
  10. Verify that the CephOsdRemoveTask has been completed.

    Example of the positive status.phase field:

    status:
      phase: Completed # or CompletedWithWarnings if there are non-critical issues
    

  11. Remove the device cleanup jobs:

    kubectl delete jobs -n pelagia -l app=pelagia-lcm-cleanup-disks
    

Reconfigure a partition of a Ceph OSD metadata device#

There is no hot reconfiguration procedure for existing Ceph OSDs. To reconfigure an existing Ceph node, remove and re-add a Ceph OSD with a metadata device. However, the automated LCM will clean up the logical volume without a removal, and it can be reused. For this reason, to reconfigure a partition of a Ceph OSD metadata device:

  1. Remove a Ceph OSD from the Ceph cluster.
  2. Add the same Ceph OSD but with a modified configuration.