Applies to:
OpenVZ 6, OpenVZ 7, and Virtuozzo 7
Requirements:
Root access to host node and optionally to the container (VPS)
🧰 Step 1: Enable Quotas on the Host Node
For OpenVZ 6:
- Check or set quota limit globally:
grep QUOTAUGIDLIMIT /etc/vz/vz.conf || echo "QUOTAUGIDLIMIT=100" >> /etc/vz/vz.conf
- Reload quota settings:
No reboot is required, but containers must be restarted individually.
For OpenVZ 7 / Virtuozzo 7:
- Check current mount:
mount | grep /vz
- Edit
/etc/fstab
and addusrquota,grpquota
to your/vz
or relevant partition:/dev/mapper/centos-home /vz ext4 defaults,usrquota,grpquota 0 2
- Remount with quota support:
mount -o remount /vz
⚙️ Step 2: Enable Quotas for a Specific VPS
OpenVZ 6:
Replace CTID
with your container ID:
vzctl stop CTID
vzctl set CTID --quotaugidlimit 100 --save
vzctl start CTID
OpenVZ 7 / Virtuozzo 7:
Replace CTID
with your container ID or name:
prlctl stop CTID
prlctl set CTID --quotaugidlimit 100 --save
prlctl start CTID
🔍 Step 3: Verify or Check Quotas Inside the VPS
- Access the VPS:
- OpenVZ 6:
vzctl enter CTID
- OpenVZ 7:
prlctl exec CTID /bin/bash
- OpenVZ 6:
- Install quota tools (if not already installed):
yum install quota -y # CentOS/RHEL apt install quota -y # Debian/Ubuntu
- Check usage:
repquota -a quota -u username
🛠 Troubleshooting
- Run quota reinitialization if necessary: OpenVZ 6:
vzquota drop CTID vzquota setup CTID vzquota on CTID vzctl restart CTID
- Verify
quotaugidlimit
is greater than 0:vzctl set CTID --quotaugidlimit 100 --save # OpenVZ 6 prlctl set CTID --quotaugidlimit 100 --save # OpenVZ 7
- Ensure your file system supports quotas (ext4/xfs with quota enabled).