
Managing Resources
51
Turning On and Off Second-Level Quotas for Virtual Private Server
The parameter that controls the second-level disk quotas is
QUOTAUGIDLIMIT
in the VPS
configuration file. By default, the value of this parameter is zero and this corresponds to
disabled per-user/group quotas.
If you assign a non-zero value to the
QUOTAUGIDLIMIT
parameter, this action brings about
the two following results:
1
Second-level (per-user and per-group) disk quotas are enabled for the given Virtual Private
Server;
2
The value that you assign to this parameter will be the limit for the number of file owners
and groups of this VPS, including Linux system users. Note that you will theoretically be
able to create extra users of this VPS, but if the number of file owners inside the VPS has
already reached the limit, these users will not be able to own files.
Enabling per-user/group quotas for a Virtual Private Server requires restarting the VPS. The
value for it should be carefully chosen; the bigger value you set, the bigger kernel memory
overhead this Virtual Private Server creates. This value must be greater than or equal to the
number of entries in the VPS
/etc/passwd
and
/etc/group
files. Taking into account that
a newly created Red Hat Linux-based VPS has about 80 entries in total, the typical value would
be 100. However, for Virtual Private Servers with a large number of users this value may be
increased.
The session below turns on second-level quotas for Virtual Private Server 101:
# vzctl set 101 --quotaugidlimit 100 --save
Unable to apply new quota values: ugid quota not initialized
Saved parameters for VPS 101
# vzctl stop 101; vzctl start 101
Stopping VPS ...
VPS was stopped
VPS is unmounted
Starting VPS ...
VPS is mounted
Adding IP address(es): 192.168.1.101
Hostname for VPS set: vps101.my.org
VPS start in progress...