Enabling Quotas on a Virtuozzo® VPS
For WHM version 11.32 If you are running cPanel and WHM on a Virtuozzo Virtual Private Server (VPS), you may need to take extra steps to enable quotas.
Important: cPanel and WHM quotas will not work unless both first- and second-level Virtuozzo quotas are enabled.
About Virtuozzo and Quotas
There are 2 types of disk quotas on a Virtuozzo server:
- Per-container, or first-level, quotas allow system administrators to control the sizes of VPS file systems by limiting the amount of disk space and the number of inodes a Virtual Server (also called a Container) can use.
- Per-user and per-group, or second-level, quotas enable the Virtual Server administrator to limit the amount of disk space and the number of inodes that users and groups within the VPS can use.
First-level Quotas
First-level quotas are enabled during the Container (or VPS) start-up process.
To see whether first-level quotas have already been enabled, issue the following command:
- vzquota show Container_ID
Second-level Quotas
Second-level disk quotas are controlled by the QUOTAUGIDLIMIT
parameter in the Container configuration file.
By default, the value of this parameter is zero, which disables per-user/group quotas. To view the parameter, issue the command:
- grep -i QUOTAUGIDLIMIT /etc/sysconfig/vz-scripts/CT_ID.conf
If you get an empty result, or a result of zero, second-level quotas are not supported by this environment.
To turn on second-level quotas for the Container, seehttp://download.swsoft.com/virtuozzo/virtuozzo4.0/docs/en/lin/VzLinuxUG/293.htm. or
Turning On and Off Second-Level Quotas for Container
QUOTAUGIDLIMIT
in the Container configuration file. By default, the value of this parameter is zero and this corresponds to disabled per-user and per-group quotas.QUOTAUGIDLIMIT
parameter, this action brings about the two following results:- Second-level (per-user and per-group) disk quotas are enabled for the given Container;
- The value that you assign to this parameter will be the limit for the number of file owners and groups of this Container, including Linux system users. Note that you will theoretically be able to create extra users of this Container, but if the number of file owners inside the Container has already reached the limit, these users will not be able to own files.
Enabling per-user and per-group quotas for a Container requires restarting the Container. The value for it should be carefully chosen; the bigger value you set, the bigger kernel memory overhead this Container creates. This value must be greater than or equal to the number of entries in the Container/etc/passwd
and/etc/group
files. Taking into account that a newly created Red Hat Linux-based Container has about 80 entries in total, the typical value would be 100. However, for Containers with a large number of users this value may be increased.
- if you delete a registered user but some files with their ID continue residing inside your Container, the current number of ugids (user and group identities) inside the Container will not decrease.
- if you copy an archive containing files with user and group IDs not registered inside your Container, the number of ugids inside the Container will increase by the number of these new IDs.
Setting the QUOTAUGIDLIMIT
parameter to a non-zero value will:
- Enable second-level (per-user and per-group) disk quotas for the VPS (or Container).
- Limit the number of file owners and groups within this VPS, including Linux system users, to the value assigned to this parameter.