Generate comprehensive read-only health snapshots of your running Massed Compute VMs with structured inventory reports covering SSH connectivity, GPU status, disk usage, and active workloads.
This guide exists as a tested, machine-readable recipe in the Massed Compute MCP. Connect an AI agent to automatically provision VMs, run health checks, and generate inventory reports without manual SSH commands.
When you’re debugging a GPU cloud deployment or troubleshooting workload issues, you need visibility into what’s actually running on your VMs. This guide shows you how to generate structured health and workload inventory reports for existing Massed Compute instances without disrupting running services or reinstalling software stacks.
The inventory process captures SSH connectivity, GPU visibility, disk usage hotspots, active services, listening ports, Python environments, and system resources in a single structured report that both humans and AI agents can analyze for debugging.
| Component | Version | Purpose |
|---|---|---|
| Ubuntu | 24.04 LTS | Base OS with systemd services |
| SSH Access | OpenSSH 9.0+ | Remote connectivity and command execution |
| NVIDIA Drivers | Latest (GPU instances) | GPU visibility via nvidia-smi |
| Python | 3.8+ | Virtual environment detection |
| Resource | Minimum | Recommended |
|---|---|---|
| CPU Cores | 2 vCPU | 4+ vCPU for heavy workloads |
| Memory | 4 GB RAM | 8+ GB RAM with active services |
| Storage | 20 GB available | 50+ GB for comprehensive logs |
| Network | SSH port 22 open | Outbound HTTPS for dependency checks |
Step-by-Step VM Health Inventory
Identify Target VM Instance
Locate the running VM you want to inventory. You’ll need the instance UUID, SSH credentials, and connection details.
# List your running instances
curl -H "Authorization: Bearer MC_TOKEN" \
https://vm.massedcompute.com/api/instances
# Note the UUID of your target instance
export INSTANCE_UUID="your-instance-uuid-here"
Verify SSH Connectivity
Test SSH access to ensure the inventory script can connect and execute commands remotely.
# Test SSH connection
ssh -i ~/.ssh/your-key.pem ubuntu@YOUR_VM_IP \
-o BatchMode=yes \
-o ConnectTimeout=10 \
'echo "SSH connectivity: OK"'
# Clear any stale host keys if needed
ssh-keygen -R YOUR_VM_IP
Run Basic System Inventory
Execute remote commands to gather system information, disk usage, and resource utilization.
# System overview
ssh -i ~/.ssh/your-key.pem ubuntu@YOUR_VM_IP 'bash -s' << 'EOF'
echo "=== System Info ==="
hostname && uptime && whoami
echo
echo "=== Disk Usage ==="
df -h
echo
echo "=== Memory Usage ==="
free -h
echo
echo "=== CPU Info ==="
nproc && lscpu | grep "Model name"
EOF
Check GPU Status (If Applicable)
For GPU instances, verify NVIDIA driver installation and GPU visibility.
# GPU inventory
ssh -i ~/.ssh/your-key.pem ubuntu@YOUR_VM_IP 'bash -s' << 'EOF'
echo "=== GPU Status ==="
if command -v nvidia-smi &> /dev/null; then
nvidia-smi --query-gpu=name,memory.total,memory.used,temperature.gpu --format=csv,noheader,nounits
echo
nvidia-smi -L
else
echo "No NVIDIA GPUs detected or drivers not installed"
fi
EOF
Inventory Active Services
Check systemd services, listening ports, and running processes to understand the workload state.
# Services and ports inventory
ssh -i ~/.ssh/your-key.pem ubuntu@YOUR_VM_IP 'bash -s' << 'EOF'
echo "=== Active Services ==="
systemctl list-units --type=service --state=active --no-pager | head -20
echo
echo "=== Failed Services ==="
systemctl --failed --no-pager
echo
echo "=== Listening Ports ==="
ss -tlnp | grep LISTEN
echo
echo "=== Top Processes ==="
ps aux --sort=-%mem | head -10
EOF
Check Python Environments
Detect active Python virtual environments and installed packages that might affect ML workloads.
# Python environment inventory
ssh -i ~/.ssh/your-key.pem ubuntu@YOUR_VM_IP 'bash -s' << 'EOF'
echo "=== Python Environments ==="
if [ -n "$VIRTUAL_ENV" ]; then
echo "Active venv: $VIRTUAL_ENV"
else
echo "No active virtual environment"
fi
echo
echo "=== Python Versions ==="
python3 --version 2>/dev/null || echo "Python3 not found"
pip --version 2>/dev/null || echo "Pip not found"
echo
echo "=== Conda Environments ==="
if command -v conda &> /dev/null; then
conda env list
else
echo "Conda not installed"
fi
EOF
Test Network Connectivity
Verify outbound connectivity for package downloads and API access.
# Network connectivity test
ssh -i ~/.ssh/your-key.pem ubuntu@YOUR_VM_IP 'bash -s' << 'EOF'
echo "=== Network Connectivity ==="
curl -s -o /dev/null -w "Hugging Face: %{http_code} (%{time_total}s)\n" https://huggingface.co || echo "Hugging Face: Failed"
curl -s -o /dev/null -w "PyPI: %{http_code} (%{time_total}s)\n" https://pypi.org || echo "PyPI: Failed"
echo
echo "VM_HEALTH_INVENTORY_OK"
EOF
Troubleshooting Common Issues
SSH Connection Problems
If SSH fails, check that your instance is running and the security group allows SSH access on port 22.
# Check instance status via API
curl -H "Authorization: Bearer MC_TOKEN" \
"https://vm.massedcompute.com/api/instances/$INSTANCE_UUID"
# Remove stale host keys
ssh-keygen -R YOUR_VM_IP
GPU Not Detected
If nvidia-smi fails on a GPU instance, you may have launched a CPU SKU by mistake or need to install drivers.
# Check if this is actually a GPU instance
lspci | grep -i nvidia
# If GPUs are present but nvidia-smi fails, reinstall drivers
sudo apt update && sudo apt install -y nvidia-driver-535
High Disk Usage
Use the disk usage output to identify space-consuming directories and clean up as needed.
# Find largest directories
du -h --max-depth=2 ~ | sort -hr | head -10
# Clean common temporary locations
rm -rf ~/.cache/pip/*
rm -rf /tmp/*
Skip All of This: Deploy with an AI Agent
This entire health inventory process exists as a tested, machine-readable recipe in the Massed Compute MCP. Instead of running SSH commands manually, you can connect an AI agent that handles the VM identification, connectivity testing, and inventory generation automatically.
{
"mcpServers": {
"massed-compute": {
"type": "http",
"url": "https://vm.massedcompute.com/api/mcp",
"headers": { "Authorization": "Bearer MC_TOKEN" }
}
}
}
Then say:
The agent matches this request against the recipe catalog (tested June 2026), identifies your running VM, establishes SSH connectivity, and executes the complete inventory workflow above. It provisions the right connection parameters, runs all health checks in the correct sequence, and reports back with structured results. If any connectivity or inventory step fails, the agent stops and reports the exact error for debugging.
Quick Setup Guide
For immediate VM health monitoring:
- Launch instance: Use any Massed Compute GPU or CPU VM with Ubuntu 24.04
- Test SSH: Verify connectivity with your private key
- Run inventory: Execute the remote SSH commands from steps 1-7
- Analyze output: Review system resources, GPU status, and service health
- Debug issues: Use troubleshooting section for common problems
Frequently Asked Questions
01What information does the health inventory collect?
The inventory captures SSH connectivity, system resources (CPU, memory, disk), GPU status via nvidia-smi, active systemd services, listening network ports, Python virtual environments, and outbound network connectivity tests. All data collection is read-only and doesn't modify your VM state.
02Can I run this on both GPU and CPU instances?
Yes, the inventory script works on any Massed Compute VM. For CPU instances, it simply skips the GPU checks and reports "No NVIDIA GPUs detected." All other system monitoring (disk, memory, services, network) works identically across instance types.
03How often should I generate health inventories?
Run inventories before starting new workloads, when debugging performance issues, or after major software installations. For production deployments, consider daily inventories during development phases and weekly checks for stable workloads.
04What if the inventory reveals failed services or high resource usage?
Use the structured output to identify specific issues. Failed systemd services may indicate configuration problems, high memory usage suggests workload optimization opportunities, and disk hotspots help prioritize cleanup efforts. The inventory provides debugging starting points, not automatic fixes.
05Does the health check affect running workloads?
No, the inventory process is entirely read-only. It doesn't restart services, modify files, install packages, or change system configuration. The commands only query system state through tools like df, nvidia-smi, systemctl, and ps without disrupting active processes.











