How to fix Quotas unlimited under OpenVZ?

Abadon

Member
May 7, 2014
6
0
1
cPanel Access Level
Website Owner
Dear all,

I have a problem with one of VPS servers which i created under my OpenVZ server. In cPanel (WHM 11.42.1 (build 12)), all accounts quota appears as unlimited.

I've been looking for a solution but i can't find working one. I found this old topic http://forums.cpanel.net/f5/quotas-unlimited-275061.html but I can not replay inside it.

The solution explained there doesn't working for me.

I'm running a CentOS release 6.5 (Final), and my fstab says:

root@test [/]# cat /etc/fstab
none /dev/pts devpts rw,gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
root@test [/]#
My mtab:
root@test [/]# mount
/dev/ploop15362p1 on / type ext4 (rw,relatime,barrier=1,data=ordered,balloon_ino=12,jqfmt=vfsv0,usrjquota=aquota.user,grpjquota=aquota.group)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
none on /dev type devtmpfs (rw,relatime,mode=755)
none on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
none on /dev/shm type tmpfs (rw,relatime)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,relatime)
root@test [/]#
when i try to run /scripts/fixquotas i get the following

root@test [/]# /scripts/fixquotas
Installing Default Quota Databases......Done
Quota Mode: Linux
journaled quota support: not available with vzaquota (disabled)
checking out /backup
checking out /backup
Quotas have been enabled, however they may not be up to date as quotacheck has been skipped.
Reading package test
Resetting quota for kireto to 1024 M
edquota: Cannot open quotafile //aquota.user: No such file or directory
No filesystems with quota detected.
root@test [/]#
I tried these commands, but results are the same - unlimited quota inside WHM/cPanel:

I Found this:
Cpanel quotas - OpenVZ Linux Containers Wiki

rm -rf /aquota.user 2>/dev/null
rm -rf /aquota.group 2>/dev/null
unlink /aquota.user 2>/dev/null
unlink /aquota.group 2>/dev/null
for x in `find /proc/vz/vzaquota/ | tail -2 `; do ln -s $x / ; done
after these commands, I run this:
/sbin/quotacheck -am
and returned to cPanel> Server Configuration> Initial Quota Setup

And, it's all right
 

JaredR.

Well-Known Member
Feb 25, 2010
1,834
27
143
Houston, TX
cPanel Access Level
Root Administrator
Quotas on OpenVZ and Virtuozzo require that second-level quota support be enabled for the VPS container in the hardware node. This is not a setting that you can change inside the VPS container. If you are not the administrator of the hardware node, ask your hosting provider to make certain that second-level quotas are enabled for your VPS container.

The following documentation offers more information about this, including how the administrator of the hardware node can enable second-level quotas for a container:

https://documentation.cpanel.net/pages/viewpage.action?pageId=8553271

Once you are certain that second-level quotas are enabled for your specific container, run this command in the container to initialize and fix the quotas:

Code:
# /usr/local/cpanel/scripts/fixquotas
 

Abadon

Member
May 7, 2014
6
0
1
cPanel Access Level
Website Owner
Hello,

I'm full administrator of VPS and hardware node. The hardware node OS is CentOS release 6.5 (Final), kernel 2.6.32-042stab088.4, virtualization technology is OpenVZ.

I think that First-level quotas are enabled on hardware node:
[root@Ovz-02 ~]# grep DISK_QUOTA /etc/vz/vz.conf
DISK_QUOTA=yes
[root@Ovz-02 ~]#
Second-level quotas are enabled too:

[root@Ovz-02 ~]# grep -i QUOTAUGIDLIMIT /etc/sysconfig/vz-scripts/101.conf
QUOTAUGIDLIMIT="1000"
[root@Ovz-02 ~]#
checking that quota is off for Container 101:

[root@Ovz-02 ~]# grep DISK_QUOTA /etc/vz/conf/101.conf
[root@Ovz-02 ~]#
Everything look like good.

The output from starting the container:

[root@Ovz-02 ~]# vzctl start 101
Starting container...
Opening delta /vz/private/101/root.hdd/root.hdd
Adding delta dev=/dev/ploop15362 img=/vz/private/101/root.hdd/root.hdd (rw)
/dev/ploop15362p1: clean, 172612/1638400 files, 1350569/6553088 blocks
Mounting /dev/ploop15362p1 at /vz/root/101 fstype=ext4 data='balloon_ino=12,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,'
Container is mounted
Adding IP address(es): 94.31.53.29 94.31.53.14
Setting CPU limit: 44
Setting CPU units: 8
Setting CPUs: 1
Container start in progress...
[root@Ovz-02 ~]#
What's wrong?

[root@Ovz-02 ~]# vzquota show 101
vzquota : (error) Can't open quota file for id 101, maybe you need to reinitialize quota: No such file or directory
vzquota : (error) Quota file must exist for show command
[root@Ovz-02 ~]#
Thank you in advance!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
From the hardware node, try running:

Code:
vzctl stop VEID
vzquota drop VEID
vzctl start VEID
Note this will restart the VPS.

Thank you.
 

Abadon

Member
May 7, 2014
6
0
1
cPanel Access Level
Website Owner
Unfortunately this doesn't help also:

[root@Ovz-02 ~]# vzctl stop 101
Stopping container ...
Container was stopped
Unmounting file system at /vz/root/101
Unmounting device /dev/ploop15362
Container is unmounted
[root@Ovz-02 ~]# vzquota drop 101
vzquota : (error) Can't open quota file for id 101, maybe you need to reinitialize quota: No such file or directory
[root@Ovz-02 ~]#
[root@Ovz-02 ~]# vzctl start 101
Starting container...
Opening delta /vz/private/101/root.hdd/root.hdd
Adding delta dev=/dev/ploop15362 img=/vz/private/101/root.hdd/root.hdd (rw)
/dev/ploop15362p1: clean, 172638/1638400 files, 1350534/6553088 blocks
Mounting /dev/ploop15362p1 at /vz/root/101 fstype=ext4 data='balloon_ino=12,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,'
Container is mounted
Adding IP address(es): 94.31.53.29 94.31.53.14
Setting CPU limit: 44
Setting CPU units: 8
Setting CPUs: 1
Container start in progress...
[root@Ovz-02 ~]#
Any other suggestions?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
Instead of using the "drop" command, use the same steps but try:

Code:
vzquota init 101
Note that this is an issue with your VPS software, and not with cPanel.

Thank you.
 

Abadon

Member
May 7, 2014
6
0
1
cPanel Access Level
Website Owner
I run the command:
[root@Ovz-02 ~]# vzquota init 101
Usage: vzquota init <quotaid> -p <mount_path> [-c <quota_file>]
[-R,--relative]
[-s,--sub-quotas 1|0]
[-u,--ugid-limit <ugid_limit>]
-b,--block-softlimit <block_soft_limit>
-B,--block-hardlimit <block_hard_limit>
-i,--inode-softlimit <inode_soft_limit>
-I,--inode-hardlimit <inode_hard_limit>
-e,--block-exptime <block_expiration_time>
-n,--inode-exptime <inode_expiration_time>
[root@Ovz-02 ~]#
Here I found another example, but thus doesn't help me.

Is it possible that the problem comes from the fact that for this container I used ploop file-system instead of default one simfs?

Does cPanel is compatible with ploop?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,267
463
You may find posting on a forum that deals with discussions of the OpenVZ software for more user-feedback. The error messages you have provided are with vzquota, and not related to the cPanel software itself.

Thank you.