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>
131 lines
3.4 KiB
Bash
Executable File
131 lines
3.4 KiB
Bash
Executable File
#!/bin/bash
|
|
# Interactive script to create third Ceph OSD from ubuntu-vg drive
|
|
# 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'
|
|
|
|
echo "=========================================="
|
|
echo "Create Third Ceph OSD from ubuntu-vg Drive"
|
|
echo "=========================================="
|
|
echo ""
|
|
|
|
# Check if running as root
|
|
if [ "$EUID" -ne 0 ]; then
|
|
echo -e "${RED}ERROR: Please run as root${NC}"
|
|
exit 1
|
|
fi
|
|
|
|
# Available 250GB drives
|
|
AVAILABLE_DRIVES=("sdc" "sdd" "sde" "sdf" "sdg" "sdh")
|
|
|
|
echo -e "${BLUE}Available 250GB drives:${NC}"
|
|
for i in "${!AVAILABLE_DRIVES[@]}"; do
|
|
drive="${AVAILABLE_DRIVES[$i]}"
|
|
if [ -b "/dev/$drive" ]; then
|
|
size=$(fdisk -l "/dev/$drive" 2>/dev/null | grep "^Disk /dev/$drive" | awk '{print $3, $4}')
|
|
in_vg=$(pvs 2>/dev/null | grep "/dev/${drive}3" | grep ubuntu-vg | wc -l)
|
|
if [ "$in_vg" -gt 0 ]; then
|
|
echo -e " $((i+1)). ${YELLOW}/dev/$drive: ${size} - In ubuntu-vg${NC}"
|
|
else
|
|
echo -e " $((i+1)). ${GREEN}/dev/$drive: ${size} - Available${NC}"
|
|
fi
|
|
fi
|
|
done
|
|
echo ""
|
|
|
|
# Get drive selection
|
|
read -p "Enter drive number (1-6) or device name (e.g., sdc): " selection
|
|
|
|
# Parse selection
|
|
if [[ "$selection" =~ ^[1-6]$ ]]; then
|
|
DRIVE="${AVAILABLE_DRIVES[$((selection-1))]}"
|
|
elif [[ "$selection" =~ ^sd[a-z]$ ]]; then
|
|
DRIVE="$selection"
|
|
else
|
|
echo -e "${RED}Invalid selection${NC}"
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -b "/dev/$DRIVE" ]; then
|
|
echo -e "${RED}Drive /dev/$DRIVE not found${NC}"
|
|
exit 1
|
|
fi
|
|
|
|
echo ""
|
|
echo -e "${YELLOW}Selected drive: /dev/$DRIVE${NC}"
|
|
echo ""
|
|
|
|
# Check if in ubuntu-vg
|
|
in_vg=$(pvs 2>/dev/null | grep "/dev/${DRIVE}3" | grep ubuntu-vg | wc -l)
|
|
|
|
if [ "$in_vg" -gt 0 ]; then
|
|
echo -e "${YELLOW}WARNING: /dev/${DRIVE}3 is in ubuntu-vg volume group${NC}"
|
|
echo -e "${RED}Removing it will destroy data on that logical volume!${NC}"
|
|
echo ""
|
|
read -p "Continue? (yes/no): " confirm
|
|
if [ "$confirm" != "yes" ]; then
|
|
echo "Aborted"
|
|
exit 0
|
|
fi
|
|
|
|
echo ""
|
|
echo -e "${BLUE}Step 1: Removing from ubuntu-vg...${NC}"
|
|
|
|
# Unmount any mounted logical volumes
|
|
echo " Unmounting logical volumes..."
|
|
umount /dev/ubuntu-vg/* 2>/dev/null || true
|
|
|
|
# Deactivate volume group
|
|
echo " Deactivating ubuntu-vg..."
|
|
vgchange -a n ubuntu-vg
|
|
|
|
# Remove physical volume
|
|
echo " Removing /dev/${DRIVE}3 from ubuntu-vg..."
|
|
pvremove "/dev/${DRIVE}3" -y
|
|
|
|
echo -e "${GREEN} ✓ Removed from ubuntu-vg${NC}"
|
|
echo ""
|
|
fi
|
|
|
|
# Wipe the drive
|
|
echo -e "${BLUE}Step 2: Wiping /dev/$DRIVE...${NC}"
|
|
echo " Wiping filesystem signatures..."
|
|
wipefs -a "/dev/$DRIVE"
|
|
echo " Zeroing first 100MB..."
|
|
dd if=/dev/zero of="/dev/$DRIVE" bs=1M count=100 status=progress
|
|
echo -e "${GREEN} ✓ Drive wiped${NC}"
|
|
echo ""
|
|
|
|
# Create Ceph OSD
|
|
echo -e "${BLUE}Step 3: Creating Ceph OSD on /dev/$DRIVE...${NC}"
|
|
ceph-volume lvm create --data "/dev/$DRIVE"
|
|
echo ""
|
|
|
|
# Verify
|
|
echo -e "${BLUE}Step 4: Verifying OSD creation...${NC}"
|
|
echo "OSD Tree:"
|
|
ceph osd tree
|
|
echo ""
|
|
echo "Ceph Health:"
|
|
ceph health
|
|
echo ""
|
|
echo "OSD Details:"
|
|
ceph osd df
|
|
echo ""
|
|
|
|
echo "=========================================="
|
|
echo -e "${GREEN}Third OSD Created Successfully!${NC}"
|
|
echo "=========================================="
|
|
echo ""
|
|
echo "You should now have 3 OSDs, which should fix the TOO_FEW_OSDS error."
|
|
echo "Check 'ceph health detail' for remaining issues."
|
|
echo ""
|
|
|