User`s guide
Managing Resources 49
Turning On and Off Per-VPS Disk Quotas
The parameter that defines whether to use first-level disk quotas is DISK_QUOTA in the
OpenVZ global configuration file (
/etc/sysconfig/vz). By setting it to “no”, you will
disable OpenVZ quotas completely.
This parameter can be specified in the Virtual Private Server configuration file
(
/etc/sysconfig/vz-scripts/vpsid.conf) as well. In this case its value will take
precedence of the one specified in the global configuration file. If you intend to have a mixture
of Virtual Private Servers with quotas turned on and off, it is recommended to set the
DISK_QUOTA value to “yes” in the global configuration file and to “no” in the configuration
file of that VPS which does not need quotas.
The session below illustrates a scenario when first-level quotas are on by default and are turned
off for Virtual Private Server 101:
[checking that quota is on]
# grep DISK_QUOTA /etc/sysconfig/vz
DISK_QUOTA=yes
[checking available space on /vz partition]
# df /vz
Filesystem 1k-blocks Used Available Use% Mounted on
/dev/sda2 8957295 1421982 7023242 17% /vz
[editing VPS configuration file to add DISK_QUOTA=no]
# vi /etc/sysconfig/vz-scripts/101.conf
[checking that quota is off for VPS 101]
# grep DISK_QUOTA /etc/sysconfig/vz-scripts/101.conf
DISK_QUOTA=no
# vzctl start 101
Starting VPS ...
VPS is mounted
Adding IP address(es): 192.168.1.101
Hostname for VPS set: vps101.my.org
VPS start in progress...
# vzctl exec 101 df
Filesystem 1k-blocks Used Available Use% Mounted on
simfs 8282373 747060 7023242 10% /
As the above example shows, the only disk space limit a Virtual Private Server with the quotas
turned off has is the available space and inodes on the partition where the VPS private area
resides.
Note: You must change the DISK_QUOTA parameter in the global OpenVZ configuration file
only when all Virtual Private Servers are stopped, and in the VPS configuration file – only when
the corresponding VPS is stopped. Otherwise, the configuration may prove inconsistent with the
real quota usage, and this can interfere with the normal Hardware Node operation.