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>
112 lines
4.3 KiB
Bash
Executable File
112 lines
4.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# Create ceph-rbd storage pool on r630-01
|
|
# RBD (Ceph Block Device) supports VM disk images, unlike CephFS
|
|
|
|
set -e
|
|
|
|
echo "═══════════════════════════════════════════════════════════════════════════════"
|
|
echo " CREATE CEPH RBD STORAGE POOL ON r630-01"
|
|
echo "═══════════════════════════════════════════════════════════════════════════════"
|
|
echo ""
|
|
|
|
# Check if running on r630-01
|
|
HOSTNAME=$(hostname)
|
|
if [ "$HOSTNAME" != "r630-01" ]; then
|
|
echo "⚠️ WARNING: This script should be run on r630-01"
|
|
echo " Current hostname: $HOSTNAME"
|
|
echo ""
|
|
echo "To run remotely via SSH:"
|
|
echo " ssh root@192.168.11.11 'bash -s' < $0"
|
|
echo ""
|
|
read -p "Continue anyway? (y/N) " -n 1 -r
|
|
echo
|
|
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
echo "Step 1: Checking Ceph cluster status..."
|
|
if ! command -v ceph &> /dev/null; then
|
|
echo "❌ ERROR: ceph command not found. Ceph packages may not be installed."
|
|
exit 1
|
|
fi
|
|
|
|
CEPH_STATUS=$(ceph -s 2>&1 | head -5)
|
|
echo "$CEPH_STATUS"
|
|
echo ""
|
|
|
|
echo "Step 2: Checking if RBD pool exists..."
|
|
RBD_POOL_EXISTS=$(ceph osd pool ls 2>/dev/null | grep -c "^rbd$" || echo "0")
|
|
if [ "$RBD_POOL_EXISTS" = "0" ]; then
|
|
echo "⚠️ RBD pool 'rbd' does not exist"
|
|
echo ""
|
|
echo "Step 3: Creating RBD pool..."
|
|
# Create RBD pool with appropriate PG count
|
|
# For small clusters, use 32 PGs
|
|
ceph osd pool create rbd 32 32 2>&1 || {
|
|
echo "❌ Failed to create RBD pool"
|
|
exit 1
|
|
}
|
|
echo "✅ RBD pool created"
|
|
|
|
# Initialize the pool for RBD
|
|
echo "Step 4: Initializing RBD pool..."
|
|
rbd pool init rbd 2>&1 || {
|
|
echo "⚠️ Pool initialization failed or already initialized"
|
|
}
|
|
else
|
|
echo "✅ RBD pool 'rbd' already exists"
|
|
fi
|
|
|
|
echo ""
|
|
echo "Step 5: Checking if RBD storage is already added to Proxmox..."
|
|
if pvesm status 2>/dev/null | grep -q "ceph-rbd"; then
|
|
echo "✅ Storage 'ceph-rbd' already exists in Proxmox"
|
|
pvesm status | grep "ceph-rbd"
|
|
else
|
|
echo "Adding ceph-rbd storage to Proxmox..."
|
|
# Add RBD storage - RBD supports 'images' content type for VM disks
|
|
pvesm add rbd ceph-rbd \
|
|
--pool rbd \
|
|
--nodes r630-01 \
|
|
--content images \
|
|
--monhost 192.168.11.10:6789,192.168.11.11:6789 \
|
|
--username admin 2>&1 || {
|
|
echo "⚠️ Failed to add via pvesm. Trying alternative method..."
|
|
echo ""
|
|
echo "Alternative: Add via Web UI:"
|
|
echo " Datacenter → Storage → Add → RBD"
|
|
echo " ID: ceph-rbd"
|
|
echo " Pool: rbd"
|
|
echo " Nodes: r630-01"
|
|
echo " Content: images"
|
|
echo ""
|
|
echo "Or via API (from your workstation):"
|
|
echo " curl -k -X POST -H \"Authorization: PVEAPIToken=...\" \\"
|
|
echo " \"https://192.168.11.11:8006/api2/json/storage\" \\"
|
|
echo " -d \"storage=ceph-rbd&type=rbd&pool=rbd&nodes=r630-01&content=images&monhost=192.168.11.10:6789,192.168.11.11:6789&username=admin\""
|
|
exit 1
|
|
}
|
|
echo "✅ RBD storage added successfully"
|
|
fi
|
|
|
|
echo ""
|
|
echo "═══════════════════════════════════════════════════════════════════════════════"
|
|
echo " VERIFICATION"
|
|
echo "═══════════════════════════════════════════════════════════════════════════════"
|
|
echo ""
|
|
echo "Checking storage status..."
|
|
pvesm status | grep -E "ceph-rbd|NAME" || echo "Storage not found in pvesm status"
|
|
|
|
echo ""
|
|
echo "Checking RBD pool status..."
|
|
ceph osd pool ls | grep "^rbd$" && echo "✅ RBD pool exists" || echo "❌ RBD pool not found"
|
|
|
|
echo ""
|
|
echo "✅ Setup complete! Storage 'ceph-rbd' should now be available for VM deployment."
|
|
echo ""
|
|
echo "📝 Next Steps:"
|
|
echo " Update your VM configurations to use 'ceph-rbd' instead of 'ceph-fs'"
|
|
echo " Example: storage: \"ceph-rbd\""
|
|
|