Files
Sankofa/scripts/create-ceph-osds-all-drives.sh
defiQUG 33d50fb91e
Some checks failed
API CI / API Lint (push) Successful in 47s
API CI / API Type Check (push) Failing after 47s
API CI / API Test (push) Successful in 1m0s
API CI / API Build (push) Failing after 50s
API CI / Build Docker Image (push) Has been skipped
Build Crossplane Provider / build (push) Failing after 5m51s
CD Pipeline / Deploy to Staging (push) Failing after 29s
CI Pipeline / Lint and Type Check (push) Failing after 36s
CI Pipeline / Build (push) Has been skipped
CI Pipeline / Test Backend (push) Failing after 1m33s
CI Pipeline / Test Frontend (push) Failing after 30s
CI Pipeline / Security Scan (push) Failing after 1m16s
Crossplane Provider CI / Go Test (push) Failing after 3m23s
Crossplane Provider CI / Go Lint (push) Failing after 7m27s
Crossplane Provider CI / Go Build (push) Failing after 3m27s
Deploy to Staging / Deploy to Staging (push) Failing after 30s
Portal CI / Portal Lint (push) Failing after 21s
Portal CI / Portal Type Check (push) Failing after 21s
Portal CI / Portal Test (push) Failing after 21s
Portal CI / Portal Build (push) Failing after 22s
Test Suite / frontend-tests (push) Failing after 30s
Test Suite / api-tests (push) Failing after 49s
Test Suite / blockchain-tests (push) Failing after 30s
Type Check / type-check (map[directory:. name:root]) (push) Failing after 23s
Type Check / type-check (map[directory:api name:api]) (push) Failing after 21s
Type Check / type-check (map[directory:portal name:portal]) (push) Failing after 19s
Validate Configuration Files / validate (push) Failing after 1m52s
CD Pipeline / Deploy to Production (push) Has been skipped
chore: consolidate local WIP (repo cleanup 20260707)
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 09:41:34 -07:00

110 lines
2.9 KiB
Bash

#!/bin/bash
# Create Ceph OSDs on all 6x 250GB drives
# Run on R630-01 as root
set -e
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m'
DRIVES=("sdc" "sdd" "sde" "sdf" "sdg" "sdh")
echo "=========================================="
echo "Create Ceph OSDs on All 6x 250GB Drives"
echo "=========================================="
echo ""
# Check if running as root
if [ "$EUID" -ne 0 ]; then
echo -e "${RED}ERROR: Please run as root${NC}"
exit 1
fi
echo -e "${BLUE}=== Step 1: Remove Partitions from Drives ===${NC}"
echo "-----------------------------------"
for drive in "${DRIVES[@]}"; do
if [ ! -b "/dev/$drive" ]; then
echo -e "${YELLOW} /dev/$drive not found, skipping...${NC}"
continue
fi
echo -e "${BLUE} Preparing /dev/$drive...${NC}"
# Unmount any partitions
umount /dev/${drive}* 2>/dev/null || true
# Remove partitions/filesystem signatures
echo " Removing partitions and filesystem signatures..."
wipefs -a "/dev/$drive" 2>/dev/null || true
echo -e "${GREEN} ✓ /dev/$drive prepared${NC}"
done
echo ""
echo -e "${BLUE}=== Step 2: Create Ceph OSDs ===${NC}"
echo "-----------------------------------"
osd_count=0
failed_drives=()
for drive in "${DRIVES[@]}"; do
if [ ! -b "/dev/$drive" ]; then
continue
fi
echo -e "${BLUE} Creating OSD on /dev/$drive...${NC}"
# Try to create OSD
if ceph-volume lvm create --data "/dev/$drive" 2>&1 | tee /tmp/ceph-osd-${drive}.log; then
echo -e "${GREEN} ✓ OSD created on /dev/$drive${NC}"
osd_count=$((osd_count + 1))
else
echo -e "${YELLOW} ⚠ OSD creation had issues${NC}"
failed_drives+=("$drive")
echo " Check /tmp/ceph-osd-${drive}.log for details"
fi
echo ""
done
echo "=========================================="
echo -e "${GREEN}OSD Creation Summary${NC}"
echo "=========================================="
echo ""
echo "Successfully created: $osd_count OSD(s) out of ${#DRIVES[@]} drives"
if [ ${#failed_drives[@]} -gt 0 ]; then
echo -e "${YELLOW}Failed drives: ${failed_drives[@]}${NC}"
fi
echo ""
echo -e "${BLUE}=== Step 3: Verify Ceph Status ===${NC}"
echo "-----------------------------------"
echo "OSD Tree:"
ceph osd tree 2>/dev/null || echo -e "${YELLOW}Cannot get OSD tree${NC}"
echo ""
echo "Ceph Health:"
ceph health 2>/dev/null || echo -e "${YELLOW}Cannot get health${NC}"
echo ""
echo "OSD Details:"
ceph osd df 2>/dev/null || echo -e "${YELLOW}Cannot get OSD details${NC}"
echo ""
OSD_COUNT=$(ceph osd tree 2>/dev/null | grep -c "osd\." || echo "0")
echo "Current OSD count: $OSD_COUNT"
if [ "$OSD_COUNT" -ge 3 ]; then
echo -e "${GREEN} ✓ SUCCESS: Have 3+ OSDs (fixes TOO_FEW_OSDS error)${NC}"
else
echo -e "${YELLOW} ⚠ Still need more OSDs (currently have $OSD_COUNT, need 3+)${NC}"
fi
echo ""