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
Co-authored-by: Cursor <cursoragent@cursor.com>
134 lines
3.6 KiB
Bash
Executable File
134 lines
3.6 KiB
Bash
Executable File
#!/bin/bash
|
|
# Script to wipe all 6x 250GB drives AND create Ceph OSDs on them
|
|
# Run on R630-01 as root
|
|
# WARNING: This will destroy all data on these drives!
|
|
|
|
set -e
|
|
|
|
# Colors
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
BLUE='\033[0;34m'
|
|
NC='\033[0m'
|
|
|
|
# Drives to process
|
|
DRIVES=("sdc" "sdd" "sde" "sdf" "sdg" "sdh")
|
|
|
|
echo "=========================================="
|
|
echo "Wipe All 250GB Drives and Create Ceph OSDs"
|
|
echo "=========================================="
|
|
echo ""
|
|
echo -e "${RED}WARNING: This will destroy ALL data on these drives!${NC}"
|
|
echo "Drives to process: ${DRIVES[@]}"
|
|
echo ""
|
|
echo "This script will:"
|
|
echo " 1. Remove drives from ubuntu-vg"
|
|
echo " 2. Wipe all 6 drives"
|
|
echo " 3. Create Ceph OSDs on all 6 drives"
|
|
echo ""
|
|
read -p "Are you sure you want to continue? (type 'yes' to confirm): " confirm
|
|
|
|
if [ "$confirm" != "yes" ]; then
|
|
echo "Aborted"
|
|
exit 0
|
|
fi
|
|
|
|
echo ""
|
|
echo -e "${BLUE}=== Step 1: Removing from ubuntu-vg ===${NC}"
|
|
echo "-----------------------------------"
|
|
|
|
# Check if ubuntu-vg exists
|
|
if vgs ubuntu-vg &>/dev/null; then
|
|
echo "Unmounting logical volumes..."
|
|
umount /dev/ubuntu-vg/* 2>/dev/null || true
|
|
|
|
echo "Deactivating ubuntu-vg..."
|
|
vgchange -a n ubuntu-vg 2>/dev/null || true
|
|
|
|
echo "Removing physical volumes from ubuntu-vg..."
|
|
for drive in "${DRIVES[@]}"; do
|
|
if pvs 2>/dev/null | grep -q "/dev/${drive}3.*ubuntu-vg"; then
|
|
echo " Removing /dev/${drive}3..."
|
|
pvremove "/dev/${drive}3" -y -ff 2>/dev/null || true
|
|
fi
|
|
done
|
|
echo -e "${GREEN} ✓ Removed from ubuntu-vg${NC}"
|
|
else
|
|
echo -e "${YELLOW} ubuntu-vg not found${NC}"
|
|
fi
|
|
echo ""
|
|
|
|
echo -e "${BLUE}=== Step 2: Wiping All 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} Wiping /dev/$drive...${NC}"
|
|
|
|
# Unmount any partitions
|
|
umount /dev/${drive}* 2>/dev/null || true
|
|
|
|
# Wipe filesystem signatures
|
|
wipefs -a "/dev/$drive" 2>/dev/null || true
|
|
|
|
# Zero out first 100MB
|
|
dd if=/dev/zero of="/dev/$drive" bs=1M count=100 status=progress 2>/dev/null || true
|
|
|
|
echo -e "${GREEN} ✓ /dev/$drive wiped${NC}"
|
|
done
|
|
echo ""
|
|
|
|
echo -e "${BLUE}=== Step 3: Creating Ceph OSDs ===${NC}"
|
|
echo "-----------------------------------"
|
|
|
|
osd_count=0
|
|
for drive in "${DRIVES[@]}"; do
|
|
if [ ! -b "/dev/$drive" ]; then
|
|
continue
|
|
fi
|
|
|
|
echo -e "${BLUE} Creating OSD on /dev/$drive...${NC}"
|
|
|
|
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 "${RED} ✗ Failed to create OSD on /dev/$drive${NC}"
|
|
echo " Check /tmp/ceph-osd-${drive}.log for details"
|
|
fi
|
|
echo ""
|
|
done
|
|
|
|
echo "=========================================="
|
|
echo -e "${GREEN}Process Complete!${NC}"
|
|
echo "=========================================="
|
|
echo ""
|
|
echo "Created $osd_count OSD(s) out of ${#DRIVES[@]} drives"
|
|
echo ""
|
|
|
|
echo "Verifying Ceph status..."
|
|
echo "OSD Tree:"
|
|
ceph osd tree
|
|
echo ""
|
|
echo "Ceph Health:"
|
|
ceph health
|
|
echo ""
|
|
echo "OSD Details:"
|
|
ceph osd df
|
|
echo ""
|
|
|
|
if [ "$osd_count" -gt 0 ]; then
|
|
echo -e "${GREEN}✓ Successfully created $osd_count OSD(s)!${NC}"
|
|
echo ""
|
|
echo "You should now have at least 3 OSDs, which fixes the TOO_FEW_OSDS error."
|
|
else
|
|
echo -e "${RED}✗ No OSDs were created. Check logs above for errors.${NC}"
|
|
fi
|
|
echo ""
|
|
|