Some checks failed
Deploy to Phoenix / deploy (push) Has been cancelled
- ADD_CHAIN138_TO_LEDGER_LIVE: Ledger form done; public code review repo bis-innovations/LedgerLive; init/push commands - CONTRACT_DEPLOYMENT_RUNBOOK: Chain 138 gas price 1 gwei, 36-addr check, TransactionMirror workaround - CONTRACT_*: AddressMapper, MirrorManager deployed 2026-02-12; 36-address on-chain check - NEXT_STEPS_FOR_YOU: Ledger done; steps completable now (no LAN); run-completable-tasks-from-anywhere - MASTER_INDEX, OPERATOR_OPTIONAL, SMART_CONTRACTS_INVENTORY_SIMPLE: updates - LEDGER_BLOCKCHAIN_INTEGRATION_COMPLETE: bis-innovations/LedgerLive reference Co-authored-by: Cursor <cursoragent@cursor.com>
147 lines
5.4 KiB
Bash
147 lines
5.4 KiB
Bash
#!/bin/bash
|
|
# Test storage performance on r630-01 and r630-02
|
|
# Creates test containers, verifies storage works, then cleans up
|
|
|
|
set -euo pipefail
|
|
|
|
# Load IP configuration
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
source "${PROJECT_ROOT}/config/ip-addresses.conf" 2>/dev/null || true
|
|
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
source "$SCRIPT_DIR/load-physical-inventory.sh" 2>/dev/null || true
|
|
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
BLUE='\033[0;34m'
|
|
CYAN='\033[0;36m'
|
|
NC='\033[0m'
|
|
|
|
log_info() { echo -e "${BLUE}[INFO]${NC} $1"; }
|
|
log_success() { echo -e "${GREEN}[✓]${NC} $1"; }
|
|
log_warn() { echo -e "${YELLOW}[⚠]${NC} $1"; }
|
|
log_error() { echo -e "${RED}[✗]${NC} $1"; }
|
|
log_section() { echo -e "\n${CYAN}=== $1 ===${NC}\n"; }
|
|
|
|
R630_01_IP="${PROXMOX_HOST_R630_01:-192.168.11.11}"
|
|
R630_01_PASS="${PROXMOX_PASS_R630_01:-password}"
|
|
R630_02_IP="${PROXMOX_HOST_R630_02:-192.168.11.12}"
|
|
R630_02_PASS="${PROXMOX_PASS_R630_02:-password}"
|
|
|
|
TEST_VMID=9999
|
|
|
|
cleanup() {
|
|
log_info "Cleaning up test containers..."
|
|
|
|
# Cleanup r630-01
|
|
sshpass -p "$R630_01_PASS" ssh -o StrictHostKeyChecking=no root@"$R630_01_IP" \
|
|
"pct destroy $TEST_VMID 2>/dev/null || true" 2>/dev/null || true
|
|
|
|
# Cleanup r630-02
|
|
sshpass -p "$R630_02_PASS" ssh -o StrictHostKeyChecking=no root@"$R630_02_IP" \
|
|
"pct destroy $TEST_VMID 2>/dev/null || true" 2>/dev/null || true
|
|
|
|
log_success "Cleanup complete"
|
|
}
|
|
|
|
trap cleanup EXIT
|
|
|
|
log_section "Storage Performance Test"
|
|
|
|
# Test r630-01 local-lvm
|
|
log_section "Testing r630-01 local-lvm Storage"
|
|
|
|
log_info "Checking if template exists..."
|
|
TEMPLATE=$(sshpass -p "$R630_01_PASS" ssh -o StrictHostKeyChecking=no root@"$R630_01_IP" \
|
|
"pvesm list local 2>/dev/null | grep -i ubuntu | head -1 | awk '{print \$1}'" 2>/dev/null || echo "")
|
|
|
|
if [ -z "$TEMPLATE" ]; then
|
|
log_warn "No Ubuntu template found, checking available templates..."
|
|
TEMPLATE=$(sshpass -p "$R630_01_PASS" ssh -o StrictHostKeyChecking=no root@"$R630_01_IP" \
|
|
"pvesm list local 2>/dev/null | head -5 | tail -1 | awk '{print \$1}'" 2>/dev/null || echo "")
|
|
fi
|
|
|
|
if [ -n "$TEMPLATE" ]; then
|
|
log_info "Using template: $TEMPLATE"
|
|
log_info "Creating test container on r630-01 (local-lvm)..."
|
|
|
|
sshpass -p "$R630_01_PASS" ssh -o StrictHostKeyChecking=no root@"$R630_01_IP" bash <<ENDSSH
|
|
pct create $TEST_VMID $TEMPLATE \
|
|
--storage local-lvm \
|
|
--hostname test-storage-r630-01 \
|
|
--net0 name=eth0,bridge=vmbr0,ip=192.168.11.99/24 \
|
|
--memory 512 \
|
|
--cores 1 \
|
|
--unprivileged 1 2>&1 | head -10
|
|
ENDSSH
|
|
|
|
if sshpass -p "$R630_01_PASS" ssh -o StrictHostKeyChecking=no root@"$R630_01_IP" \
|
|
"pct list | grep -q $TEST_VMID" 2>/dev/null; then
|
|
log_success "Test container created on r630-01"
|
|
sshpass -p "$R630_01_PASS" ssh -o StrictHostKeyChecking=no root@"$R630_01_IP" \
|
|
"pct list | grep $TEST_VMID" 2>/dev/null
|
|
else
|
|
log_warn "Container creation may have failed (check manually)"
|
|
fi
|
|
else
|
|
log_warn "No template available, skipping container creation test"
|
|
log_info "Storage status check only..."
|
|
fi
|
|
|
|
# Check storage status
|
|
log_info "Storage status on r630-01:"
|
|
sshpass -p "$R630_01_PASS" ssh -o StrictHostKeyChecking=no root@"$R630_01_IP" \
|
|
"pvesm status local-lvm 2>/dev/null" 2>/dev/null || log_warn "Could not check storage"
|
|
|
|
# Test r630-02 thin1
|
|
log_section "Testing r630-02 thin1 Storage"
|
|
|
|
log_info "Checking if template exists..."
|
|
TEMPLATE=$(sshpass -p "$R630_02_PASS" ssh -o StrictHostKeyChecking=no root@"$R630_02_IP" \
|
|
"pvesm list local 2>/dev/null | grep -i ubuntu | head -1 | awk '{print \$1}'" 2>/dev/null || echo "")
|
|
|
|
if [ -z "$TEMPLATE" ]; then
|
|
log_warn "No Ubuntu template found, checking available templates..."
|
|
TEMPLATE=$(sshpass -p "$R630_02_PASS" ssh -o StrictHostKeyChecking=no root@"$R630_02_IP" \
|
|
"pvesm list local 2>/dev/null | head -5 | tail -1 | awk '{print \$1}'" 2>/dev/null || echo "")
|
|
fi
|
|
|
|
if [ -n "$TEMPLATE" ]; then
|
|
log_info "Using template: $TEMPLATE"
|
|
log_info "Creating test container on r630-02 (thin1)..."
|
|
|
|
sshpass -p "$R630_02_PASS" ssh -o StrictHostKeyChecking=no root@"$R630_02_IP" bash <<ENDSSH
|
|
pct create $TEST_VMID $TEMPLATE \
|
|
--storage thin1 \
|
|
--hostname test-storage-r630-02 \
|
|
--net0 name=eth0,bridge=vmbr0,ip=192.168.11.98/24 \
|
|
--memory 512 \
|
|
--cores 1 \
|
|
--unprivileged 1 2>&1 | head -10
|
|
ENDSSH
|
|
|
|
if sshpass -p "$R630_02_PASS" ssh -o StrictHostKeyChecking=no root@"$R630_02_IP" \
|
|
"pct list | grep -q $TEST_VMID" 2>/dev/null; then
|
|
log_success "Test container created on r630-02"
|
|
sshpass -p "$R630_02_PASS" ssh -o StrictHostKeyChecking=no root@"$R630_02_IP" \
|
|
"pct list | grep $TEST_VMID" 2>/dev/null
|
|
else
|
|
log_warn "Container creation may have failed (check manually)"
|
|
fi
|
|
else
|
|
log_warn "No template available, skipping container creation test"
|
|
log_info "Storage status check only..."
|
|
fi
|
|
|
|
# Check storage status
|
|
log_info "Storage status on r630-02:"
|
|
sshpass -p "$R630_02_PASS" ssh -o StrictHostKeyChecking=no root@"$R630_02_IP" \
|
|
"pvesm status thin1 2>/dev/null" 2>/dev/null || log_warn "Could not check storage"
|
|
|
|
log_section "Storage Test Complete"
|
|
log_success "Storage performance test completed"
|
|
log_info "Test containers will be cleaned up automatically"
|