Files
Sankofa/scripts/cleanup-vm-100-proxmox.sh
defiQUG 9daf1fd378 Apply Composer changes: comprehensive API updates, migrations, middleware, and infrastructure improvements
- Add comprehensive database migrations (001-024) for schema evolution
- Enhance API schema with expanded type definitions and resolvers
- Add new middleware: audit logging, rate limiting, MFA enforcement, security, tenant auth
- Implement new services: AI optimization, billing, blockchain, compliance, marketplace
- Add adapter layer for cloud integrations (Cloudflare, Kubernetes, Proxmox, storage)
- Update Crossplane provider with enhanced VM management capabilities
- Add comprehensive test suite for API endpoints and services
- Update frontend components with improved GraphQL subscriptions and real-time updates
- Enhance security configurations and headers (CSP, CORS, etc.)
- Update documentation and configuration files
- Add new CI/CD workflows and validation scripts
- Implement design system improvements and UI enhancements
2025-12-12 18:01:35 -08:00

79 lines
2.3 KiB
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# Automated cleanup script for VM 100 on Proxmox node
# Run this script on the Proxmox node: root@ml110-01
VMID=100
echo "=== Automated Cleanup for VM $VMID ==="
echo ""
# 1. Kill all stuck processes
echo "1. Killing stuck processes..."
pkill -9 -f "task.*$VMID" 2>/dev/null && echo " ✅ Killed task processes" || echo " No task processes found"
pkill -9 -f "qm.*$VMID" 2>/dev/null && echo " ✅ Killed qm processes" || echo " No qm processes found"
pkill -9 -f "qemu.*$VMID" 2>/dev/null && echo " ✅ Killed qemu processes" || echo " No qemu processes found"
# Wait for processes to die
sleep 3
# 2. Remove lock file
echo ""
echo "2. Removing lock file..."
if [ -f "/var/lock/qemu-server/lock-$VMID.conf" ]; then
rm -f "/var/lock/qemu-server/lock-$VMID.conf"
if [ ! -f "/var/lock/qemu-server/lock-$VMID.conf" ]; then
echo " ✅ Lock file removed"
else
echo " ⚠️ Failed to remove lock file"
exit 1
fi
else
echo " Lock file already removed"
fi
# 3. Verify cleanup
echo ""
echo "3. Verifying cleanup..."
REMAINING_PROCS=$(ps aux | grep -E "task.*$VMID|qm.*$VMID|qemu.*$VMID" | grep -v grep)
if [ -z "$REMAINING_PROCS" ]; then
echo " ✅ No processes remaining"
else
echo " ⚠️ Some processes still running:"
echo "$REMAINING_PROCS" | while read line; do
echo " $line"
done
fi
LOCK_EXISTS=$(ls -la /var/lock/qemu-server/lock-$VMID.conf 2>&1)
if echo "$LOCK_EXISTS" | grep -q "No such file"; then
echo " ✅ Lock file confirmed removed"
else
echo " ⚠️ Lock file still exists:"
echo " $LOCK_EXISTS"
fi
# 4. Attempt unlock
echo ""
echo "4. Attempting unlock..."
if qm unlock $VMID 2>&1; then
echo " ✅ VM unlocked successfully"
else
UNLOCK_RESULT=$?
echo " ⚠️ Unlock returned exit code: $UNLOCK_RESULT"
echo " (This may be normal if lock was already cleared)"
fi
# 5. Final status
echo ""
echo "5. Final VM status..."
qm status $VMID 2>&1 | head -5
echo ""
echo "=== Cleanup Complete ==="
echo ""
echo "Next steps:"
echo "1. Monitor from Kubernetes: kubectl get proxmoxvm basic-vm-001 -w"
echo "2. Provider will automatically retry within 1 minute"
echo "3. VM should complete configuration and boot"