Schedule icon
Script icon
If icon
SlackIncomingWebhook icon
Log icon
Return icon

Ceph OSD Down Peering Blocked Sentinel

Audits Ceph cluster health for down OSD daemons and degraded placement groups, alerting storage engineers on Slack before I/O requests block.

Categories
DataInfrastructure

In distributed software-defined storage architectures powered by Ceph (Ceph RBD, CephFS, and RGW), Object Storage Daemons (OSDs) handle physical disk read, write, and replication operations. Data objects are distributed across placement groups (PGs) according to CRUSH algorithm rules.

When underlying NVMe, SSD, or spinning drives experience hardware controller dropouts, SATA timeouts, or kernel panics, the associated OSD daemons transition into down state. Surviving OSDs initiate peering and recovery sequences to recreate missing replica copies across surviving drives. However, if multiple OSDs go down simultaneously or network saturation blocks peering, placement groups enter peering or undersized_degraded states. During this period, client read and write operations targeting affected PGs block indefinitely, freezing hypervisor VMs and Kubernetes persistent volumes.

This blueprint provides an automated Ceph storage reliability sentinel. Running on a recurrent fifteen-minute schedule, it queries the Ceph Manager REST API, audits the cluster OSD map and placement group status, evaluates metrics against safe thresholds, and delivers real-time Slack alerts with exact troubleshooting commands to storage engineers before I/O blocks occur.

How it works

  1. Recurrent Pulse Trigger: The poll_ceph_health trigger (io.kestra.plugin.core.trigger.Schedule) initiates the metric scan every fifteen minutes.
  2. Ceph Health API Query: The scan_ceph_osd_health task (io.kestra.plugin.scripts.python.Script) invokes /api/health/minimal, extracting total OSDs, down OSD counts, and degraded placement group numbers.
  3. Threshold Gate: The evaluate_osd_failures flowable task (io.kestra.plugin.core.flow.If) evaluates whether any down OSDs or degraded placement groups breach cluster reliability SLAs.
  4. Slack Incident Alert: When unmanaged storage failures are detected, alert_slack_ceph_osd_failure (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) dispatches an actionable incident card detailing exact mitigation commands (ceph osd tree, ceph health detail).
  5. Healthy Confirmation: When all storage daemons report UP and active, log_healthy_ceph_cluster records nominal cluster health.
  6. Manifest Export: The export_ceph_health_manifest task emits structured telemetry JSON for SRE observability dashboards.

Architecture diagram

flowchart TD
    A[Schedule: Every 15 Minutes] --> B[scan_ceph_osd_health: Ceph Manager API]
    B --> C{Down OSDs or Degraded PGs?}
    C -- Yes --> D[alert_slack_ceph_osd_failure: Slack Webhook]
    C -- No --> E[log_healthy_ceph_cluster: Log]
    D --> F[export_ceph_health_manifest: Return JSON]
    E --> F

Use cases

  • Private Cloud Hypervisor Storage Protection: Prevent OpenStack or Proxmox virtual machines from experiencing read-only root filesystem flips during OSD failures.
  • Kubernetes Persistent Volume Health: Ensure Ceph CSI drivers do not experience VolumeMount timeouts caused by degraded placement group peering.
  • Proactive Drive Replacement Workflow: Identify failing disk controllers before multiple drive dropouts exhaust erasure coding or triple-replication fault tolerance.

Inputs

Name Type Default Description
ceph_mgr_endpoint STRING "http://localhost:8003" Base HTTP endpoint exposing the Ceph Manager API.
max_down_osd_threshold INT 1 Maximum allowable down OSD daemons before alerting.
cluster_fsid STRING "ceph-production-cluster" Logical cluster identifier for alerting context.
slack_channel STRING "#ceph-storage-reliability" Slack channel destination for distributed storage alerts.

Expected outputs

  • {{ outputs.scan_ceph_osd_health.vars.has_failure }}: Boolean flag indicating if cluster health breached thresholds.
  • {{ outputs.scan_ceph_osd_health.vars.down_osds }}: Count of OSD daemons currently in DOWN status.
  • {{ outputs.scan_ceph_osd_health.vars.total_osds }}: Total number of OSD daemons in the cluster.
  • {{ outputs.scan_ceph_osd_health.vars.degraded_pgs }}: Count of placement groups in degraded or undersized state.
  • {{ outputs.scan_ceph_osd_health.outputFiles['ceph_health_report.json'] }}: Structured JSON diagnostic report.

Prerequisites

  • Ceph cluster with ceph-mgr restful or dashboard module enabled on port 8003 or 8443.
  • Incoming Webhook URL configured for your storage reliability Slack channel.

Secrets

  • SLACK_WEBHOOK_URL: Slack Incoming Webhook endpoint URL with permissions to post messages.

Quick start

  1. Configure SLACK_WEBHOOK_URL in your Kestra namespace secrets.
  2. Import this flow YAML into your Kestra workspace.
  3. Update ceph_mgr_endpoint with your Ceph Manager endpoint address.
  4. Click Execute in the UI to run an initial cluster health and OSD status probe.

Common pitfalls and troubleshooting

  • HTTPS and Self-Signed Certificates: Production Ceph Manager dashboards often operate with SSL enabled; ensure Python requests accommodates your internal CA or configure reverse proxy termination.
  • OSD Flapping vs Hard Failure: OSDs that flap repeatedly due to heartbeat timeouts should be marked with ceph osd set noout while investigating network interfaces.

How to extend

  • Add automated drive unmount and restart tasks using SSH or Ansible when an OSD terminates unexpectedly.
  • Automatically execute ceph osd set noout during rolling cluster kernel upgrades.
  • Integrate with PagerDuty for critical alerting when more than 3 OSDs fail simultaneously.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.