Complete markdown files cleanup and organization
- Organized 252 files across project - Root directory: 187 → 2 files (98.9% reduction) - Moved configuration guides to docs/04-configuration/ - Moved troubleshooting guides to docs/09-troubleshooting/ - Moved quick start guides to docs/01-getting-started/ - Moved reports to reports/ directory - Archived temporary files - Generated comprehensive reports and documentation - Created maintenance scripts and guides All files organized according to established standards.
This commit is contained in:
34
scripts/get-container-distribution.sh
Executable file
34
scripts/get-container-distribution.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
# Get container distribution across cluster nodes using direct commands
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
PROXMOX_HOST="${PROXMOX_HOST:-192.168.11.10}"
|
||||
PROXMOX_PASS="${PROXMOX_PASS:-L@kers2010}"
|
||||
|
||||
ssh_proxmox() {
|
||||
sshpass -p "$PROXMOX_PASS" ssh -o StrictHostKeyChecking=no -o ConnectTimeout=5 root@"$PROXMOX_HOST" "$@"
|
||||
}
|
||||
|
||||
echo "Container Distribution Across Cluster Nodes"
|
||||
echo "============================================"
|
||||
echo ""
|
||||
|
||||
# Get all containers from ml110 (since they're all there currently)
|
||||
echo "All containers (currently on ml110):"
|
||||
ssh_proxmox "pct list" 2>&1 | grep -v "^VMID" | while IFS= read -r line; do
|
||||
if [[ -n "$line" ]]; then
|
||||
vmid=$(echo "$line" | awk '{print $1}')
|
||||
status=$(echo "$line" | awk '{print $2}')
|
||||
name=$(echo "$line" | awk '{for(i=5;i<=NF;i++) printf "%s ", $i; print ""}' | xargs)
|
||||
printf " %-6s %-12s %s\n" "$vmid" "$status" "$name"
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "To check which node each container is on:"
|
||||
echo " ssh root@192.168.11.10 'pvesh get /nodes/ml110/lxc'"
|
||||
echo " ssh root@192.168.11.10 'pvesh get /nodes/pve/lxc'"
|
||||
echo " ssh root@192.168.11.10 'pvesh get /nodes/pve2/lxc'"
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user