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

OpenEBS Mayastor Pool Degraded and Rebuild Stall Sentinel

Audits OpenEBS Mayastor storage telemetry to detect NVMe-oF pool degradation, replica rebuild stalls, and disk space exhaustion.

Categories
CloudInfrastructure

Automates continuous health and replication stability surveillance for OpenEBS Mayastor NVMe-oF cloud-native storage pools.

How it works

  1. A schedule trigger executes the Mayastor storage audit workflow every 15 minutes.
  2. The Python task queries the OpenEBS Mayastor metrics service endpoint on port 9090.
  3. The script extracts pool online status, degraded replica counts, rebuild stall durations, and byte utilization.
  4. An evaluation gate determines whether degraded replicas, rebuild stalls, or pool offline events breach bounds.
  5. When storage degradation is detected, a high-priority Slack alert is dispatched to the Storage SRE team.
  6. When NVMe-oF pools maintain synchronized volume replicas, nominal telemetry is logged.
  7. A structured JSON audit manifest is emitted for storage infrastructure governance and persistent volume SLA records.

Architecture diagram

graph TD
    Trigger[Schedule Trigger: 15m] --> ScanMetrics[Python Script: Scrape Mayastor Metrics]
    ScanMetrics --> EvalBreach{Degraded Replicas > 2 OR Rebuild Stalled?}
    EvalBreach -- Yes --> SlackAlert[Slack: High-Urgency Storage Alert]
    EvalBreach -- No --> LogNominal[Log: Nominal Mayastor State]
    SlackAlert --> EmitManifest[Debug Return: Storage Audit Manifest]
    LogNominal --> EmitManifest

Architecture components

  • Trigger: Automated schedule polling at 15-minute recurring intervals.
  • Script Task: Scrapes OpenEBS Mayastor Prometheus metrics endpoints using Docker container runners.
  • Decision Gate: Evaluates whether degraded volume replica counts or rebuild stall durations exceed limits.
  • Notification Task: Dispatches structured Slack alerts with disk pool identifier and rebuild metrics.
  • Audit Manifest: Emits JSON execution payloads containing NVMe-oF pool health and timestamps.

Key capabilities

  • Continuous surveillance of Mayastor NVMe-oF disk pools, nexus controllers, and target volume replicas.
  • Early warning detection for stalled replica rebuild operations caused by network partitions or disk I/O bottlenecks.
  • Automated tracking of pool byte utilization to prevent sudden storage exhaustion across nodes.
  • Zero host dependency execution via isolated containerized Python runners.

What you get

  • Real-time visibility into high-performance NVMe-oF block storage replication and rebuild health.
  • Proactive alerts preventing data loss or read-only volume mounts caused by multiple concurrent replica failures.
  • Standardized audit manifests containing exact capacity metrics and rebuild stall timestamps.
  • Zero-overhead deployment compatible with Kubernetes storage classes and CSI volume snapshots.

Who it's for

  • Storage and platform SREs maintaining NVMe-oF high-performance block storage in Kubernetes.
  • Cloud infrastructure engineers running distributed databases on top of OpenEBS Mayastor persistent volumes.
  • Systems administrators monitoring bare-metal disk pool health and storage node interconnects.
  • Enterprise platform architects validating storage high-availability and disaster recovery SLAs.

Why orchestrate this with Kestra

  • Serverless Docker Isolation: Executes telemetry scraping in ephemeral Docker environments without persistent workers.
  • Centralized Secrets Governance: Protects sensitive Slack webhooks using encrypted namespace secrets.
  • Declarative YAML Workflows: Manages storage control plane surveillance as versioned code in Git repositories.
  • Comprehensive Audit History: Preserves historical storage metrics in searchable Kestra execution logs.

Use cases

  • Replica Fault Isolation: Detects failed disk sectors before volume degradation escalates to quorum loss.
  • Rebuild Stall Mitigation: Alerts engineers when network packet loss throttles background replica resynchronization.
  • Storage Headroom Gating: Monitors available NVMe capacity before scheduled database scale-out operations.

Inputs

Name Type Default Description
mayastor_metrics_url STRING http://mayastor-metrics.openebs.svc.cluster.local:9090 Internal HTTP URL exposing Prometheus metrics for Mayastor.
pool_name STRING mayastor-nvme-pool-01 Identifier of the target Mayastor NVMe-oF disk pool.
max_degraded_replicas_threshold INT 2 Maximum allowable degraded volume replicas before alerting.
max_rebuild_stall_duration_seconds INT 300 Maximum allowable replica rebuild stall duration in seconds.
alert_on_pool_offline BOOL true Toggle whether pool offline status triggers an alert.

Expected outputs

  • {{ outputs.scan_mayastor_telemetry.vars.pool_online_flag }}: Health status indicator of the Mayastor storage pool.
  • {{ outputs.scan_mayastor_telemetry.vars.degraded_replicas_count }}: Count of degraded or desynchronized volume replicas.
  • {{ outputs.scan_mayastor_telemetry.vars.rebuild_stall_duration_seconds }}: Duration in seconds of stalled rebuild operations.
  • {{ outputs.scan_mayastor_telemetry.vars.is_alerting }}: Boolean flag indicating if storage SLA is breached.
  • {{ outputs.scan_mayastor_telemetry.vars.audit_timestamp }}: ISO-8601 UTC timestamp of the storage audit run.

Prerequisites

  • OpenEBS Mayastor 2.0+ deployed with Prometheus metrics enabled on port 9090.
  • Network connectivity from the Kestra worker to the Mayastor metrics service.
  • Configured Slack incoming webhook URL with permissions to post in storage alert channels.

Secrets

  • SLACK_WEBHOOK_URL: Secure webhook URL for routing storage alerts to the Storage SRE Slack channel.

Quick start

  1. Verify that OpenEBS Mayastor exposes Prometheus metrics on HTTP port 9090.
  2. Add the SLACK_WEBHOOK_URL secret within your Kestra namespace settings.
  3. Specify your NVMe disk pool identifier in pool_name.
  4. Run a manual flow execution via the Kestra UI to validate metric ingestion.
  5. Enable the periodic_mayastor_audit schedule trigger to establish automated monitoring.

Common pitfalls and troubleshooting

  • NVMe-oF Connect Errors: Rebuild stalls often trace to intermittent RDMA or TCP transport connection drops.
  • Disk IOPS Saturation: Concurrent snapshot operations may slow down background replica synchronization.
  • HugePage Allocations: Mayastor dataplane pods require dedicated 2MiB HugePages to prevent memory starvation.
  • Pool Capacity Margins: Ensure at least 15% headroom is reserved on each disk pool for volume rebuild buffers.

How to extend

  • Automated Replica Purge: Trigger an eviction workflow to relocate degraded replicas away from failing NVMe drives.
  • PagerDuty Escalation: Escalate to on-call storage engineers if pool online status drops to zero.
  • Capacity Auto-Expansion: Dynamically provision additional NVMe block devices when pool utilization exceeds 85%.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.