Files
Sankofa/scripts/update-vms-to-ceph-rbd.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

73 lines
2.8 KiB
Bash
Executable File

#!/bin/bash
# Update all VMs configured for r630-01 to use ceph-rbd instead of ceph-fs
set -e
echo "═══════════════════════════════════════════════════════════════════════════════"
echo " UPDATE VMs TO USE ceph-rbd STORAGE"
echo "═══════════════════════════════════════════════════════════════════════════════"
echo ""
cd "$(dirname "$0")/.." || exit 1
echo "Step 1: Finding VMs configured for r630-01 with ceph-fs storage..."
VMS=$(kubectl get proxmoxvms -A -o json 2>/dev/null | \
jq -r '.items[] |
select(.spec.forProvider.node == "r630-01") |
select(.spec.forProvider.storage == "ceph-fs") |
select(.metadata.name != "basic-vm-001" and .metadata.name != "large-vm-001" and .metadata.name != "medium-vm-001" and .metadata.name != "vm-100") |
"\(.metadata.namespace)/\(.metadata.name)"' 2>/dev/null)
if [ -z "$VMS" ]; then
echo "✅ No VMs found with ceph-fs storage on r630-01"
exit 0
fi
VM_COUNT=$(echo "$VMS" | wc -l)
echo "Found $VM_COUNT VMs to update:"
echo "$VMS" | while read -r vm; do
echo "$vm"
done
echo ""
read -p "Update these VMs to use ceph-rbd? (y/N) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
echo "Cancelled."
exit 0
fi
echo ""
echo "Step 2: Updating VMs..."
UPDATED=0
FAILED=0
echo "$VMS" | while read -r vm; do
NAMESPACE=$(echo "$vm" | cut -d'/' -f1)
NAME=$(echo "$vm" | cut -d'/' -f2)
echo " Updating $vm..."
if kubectl patch proxmoxvm "$NAME" -n "$NAMESPACE" --type='json' \
-p='[{"op": "replace", "path": "/spec/forProvider/storage", "value": "ceph-rbd"}]' 2>/dev/null; then
echo " ✅ Updated $vm"
((UPDATED++)) || true
else
echo " ❌ Failed to update $vm"
((FAILED++)) || true
fi
done
echo ""
echo "═══════════════════════════════════════════════════════════════════════════════"
echo " SUMMARY"
echo "═══════════════════════════════════════════════════════════════════════════════"
echo ""
echo "VMs updated: $UPDATED"
echo "VMs failed: $FAILED"
echo ""
echo "✅ Update complete! VMs will now use ceph-rbd storage."
echo ""
echo "Note: Make sure ceph-rbd storage is configured in Proxmox first:"
echo " ssh root@192.168.11.11 'bash -s' < scripts/create-ceph-rbd-storage-r630.sh"