7.1 KiB
VM Disk Usage Monitoring
Pulse can show actual disk usage for VMs (just like containers) when the QEMU Guest Agent is installed and configured properly.
Quick Summary
Without QEMU Guest Agent:
- VMs show "-" for disk usage (no data available)
- Cannot monitor actual disk usage inside the VM
With QEMU Guest Agent:
- VMs show real disk usage like containers do (e.g., "5.2GB used of 32GB / 16%")
- Accurate threshold alerts based on actual usage
- Better capacity planning with real data
How It Works
Proxmox doesn't track VM disk usage natively (unlike containers which share the host kernel). To get real disk usage from VMs:
- Proxmox API returns
disk=0andmaxdisk=<allocated_size>(this is normal) - Pulse automatically queries the QEMU Guest Agent API to get filesystem info
- Guest agent reports all mounted filesystems from inside the VM
- Pulse aggregates the data (filtering out special filesystems) and displays it
Important: This works with both API tokens and password authentication. API tokens work fine for guest agent queries when permissions are set correctly.
Requirements
1. Install QEMU Guest Agent in Your VMs
Linux VMs:
# Debian/Ubuntu
apt-get install qemu-guest-agent
systemctl enable --now qemu-guest-agent
# RHEL/Rocky/AlmaLinux
yum install qemu-guest-agent
systemctl enable --now qemu-guest-agent
# Alpine
apk add qemu-guest-agent
rc-update add qemu-guest-agent
rc-service qemu-guest-agent start
Windows VMs:
- Download virtio-win guest tools from: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/
- Install the guest tools package which includes the QEMU Guest Agent
- The service starts automatically after installation
2. Enable Guest Agent in VM Options
In Proxmox web UI:
- Select your VM
- Go to Options → QEMU Guest Agent
- Check Enabled
- Start/restart the VM
Or via CLI:
qm set <vmid> --agent enabled=1
3. Verify Guest Agent is Working
Check if the agent is responding:
qm agent <vmid> ping
Get filesystem info (what Pulse uses):
qm agent <vmid> get-fsinfo
4. Pulse Permissions
Pulse needs the right permissions to query the guest agent:
Proxmox VE 8 and below:
- Requires
VM.Monitorpermission - Setup script automatically adds this
Proxmox VE 9+:
- Requires
VM.GuestAgent.Auditpermission (included inPVEAuditorrole) - Setup script automatically configures this
Both API tokens and passwords work - tokens do NOT have any limitation accessing guest agent data.
When you run the Pulse setup script, it automatically detects your Proxmox version and sets the correct permissions. If setting up manually:
# Proxmox 9+
pveum aclmod / -user pulse-monitor@pam -role PVEAuditor
# PVEAuditor includes VM.GuestAgent.Audit in PVE 9+
# Proxmox 8 and below
pveum role add PulseMonitor -privs VM.Monitor
pveum aclmod / -user pulse-monitor@pam -role PulseMonitor
Troubleshooting
Quick Diagnostic Tool
Pulse includes a diagnostic script that can identify why a VM isn't showing disk usage:
# Run on your Proxmox host (latest version from GitHub)
curl -sSL https://raw.githubusercontent.com/rcourtman/Pulse/main/scripts/test-vm-disk.sh | bash
# Or use the bundled copy installed with Pulse
/opt/pulse/scripts/test-vm-disk.sh
Enter the VM ID when prompted. The script will check:
- VM running status
- Guest agent configuration
- Guest agent runtime status
- Filesystem information
- API permissions
Understanding Disk Display States
Shows percentage (e.g., "45%")
- Everything working correctly
- Guest agent installed and accessible
Shows "-" with hover tooltip
- Hover to see the specific reason
- Common reasons:
- "Guest agent not running" - Agent not installed or service not started
- "Guest agent disabled" - Not enabled in VM config
- "Permission denied" - Token/user lacks required permissions
- "Agent timeout" - Agent installed but not responding
- "No filesystems" - Agent returned no usable filesystem data
Guest Agent Not Responding
Check if agent is running inside VM:
# Linux
systemctl status qemu-guest-agent
# Windows
Get-Service QEMU-GA
Check VM configuration:
# Should show "agent: 1"
qm config <vmid> | grep agent
Check agent communication:
# Should return without error
qm agent <vmid> ping
Permission Denied Errors
If you see "permission denied" in Pulse logs when querying guest agent:
-
Verify token/user permissions:
pveum user permissions pulse-monitor@pam -
For Proxmox 9+: Ensure user has
PVEAuditorrole orVM.GuestAgent.Auditpermission -
For Proxmox 8: Ensure user has
VM.Monitorpermission -
Re-run setup script if you added the node before Pulse v4.7 (old scripts didn't add VM.Monitor)
Disk Usage Still Not Showing
If the agent is working but Pulse still shows "-":
-
Check Pulse logs for specific error messages:
# Docker docker logs pulse | grep -i "guest agent\|fsinfo" # Systemd journalctl -u pulse -f | grep -i "guest agent\|fsinfo" -
Test guest agent manually from Proxmox host:
qm agent <vmid> get-fsinfoIf this works but Pulse doesn't show data, check Pulse permissions and logs
-
Check agent version - Older agents might not support filesystem info
-
Windows VMs - Ensure virtio-win drivers are up to date
Network Filesystems
The agent reports all mounted filesystems. Pulse automatically filters out:
- Network mounts (NFS, CIFS, SMB)
- Special filesystems (proc, sys, tmpfs, devtmpfs, etc.)
- Special Windows partitions ("System Reserved")
- Bind mounts and overlays
- CD/DVD filesystems (iso9660, CDFS)
Only local disk usage is counted toward the VM's total.
Best Practices
- Install guest agent in VM templates - New VMs will have it ready
- Monitor agent status - Set up alerts if critical VMs lose agent connectivity
- Keep agents updated - Update guest agents when updating VM operating systems
- Test after VM migrations - Verify agent still works after moving VMs between nodes
- Check logs regularly - Monitor Pulse logs for guest agent errors
Platform-Specific Notes
Cloud-Init Images
Most cloud images include qemu-guest-agent pre-installed but may need to be enabled:
systemctl enable --now qemu-guest-agent
Docker/Kubernetes VMs
Container workloads can show high disk usage due to container layers. Consider:
- Using separate disks for container storage
- Monitoring container disk usage separately
- Setting appropriate thresholds for container hosts
Database VMs
Databases often pre-allocate space. The guest agent shows actual usage, which might be less than what the database reports internally.
Benefits
With QEMU Guest Agent disk monitoring:
- Accurate alerts - Alert on real usage, not allocated space
- Better planning - See actual growth trends
- Prevent surprises - Know when VMs are actually running out of space
- Optimize storage - Identify over-provisioned VMs
- Consistent monitoring - VMs and containers use the same metrics