Back to Projects

Proxmox VM Auto Disk Expansion

ProxmoxAutomationStorage

Project Overview

Developed a lightweight automation for Proxmox VE that automatically extends VM disk space when thresholds are reached, reducing manual intervention and downtime risk.

How it works

  • A systemd timer inside the VM checks disk space every 5 minutes.
  • When free space drops below the threshold, the VM securely triggers the Proxmox host using SSH + a restricted user (allowed only to run qm resize).
  • Proxmox extends the VM disk.
  • The VM automatically updates the partition table (growpart) and expands the filesystem (resize2fs).
  • Everything is logged for visibility.

Security

  • Dedicated user on the Proxmox host
  • Key-based SSH only
  • Strict sudo rule: NOPASSWD: /usr/sbin/qm resize *

Why it’s useful

This setup prevents storage outages, avoids manual work, and keeps VMs scalable and self-managing — perfect for dynamic workloads.