check-disk-threshold.sh¶
Checks if a VM's disk usage exceeds a threshold and automatically expands the disk by 50% if needed.
Usage¶
Parameters¶
| Parameter | Description | Example |
|---|---|---|
vmname | Name of the VM (must have a JSON config) | nextcloud |
threshold | Disk usage percentage threshold (1-99) | 80 |
Example¶
What it does¶
- Connects to the VM via SSH and checks current disk usage with
df - If usage is below threshold, exits with no action
- If usage exceeds threshold:
- Retrieves current disk size from Proxmox
- Calculates new size (50% increase, minimum 5GB)
- Calls
resize-disk.shto perform the resize - Logs the resize event to
/home/tappaas/logs/disk-resize.log
Cron usage¶
Requirements¶
- SSH access to the VM as tappaas user
- SSH access to the Proxmox node as root
- VM must be running and reachable
See Also¶
- resize-disk.sh - Manual disk resize