
Reference 105
OpenVZ quota works on a file system sub-tree or area. If this area has additional file systems
mounted to its subdirectories quota will not follow this mount points. When you initialize quota,
you specify the file system sub-tree starting point for the quota. Quota keeps its current usage
and settings for a Virtual Private Server in the
/var/vzquota/quota.
vpsid
file.
Quota file has a special flag, which indicates whether the file is “dirty”. File is dirty when its
content can be inconsistent with that of real quota usage. On VPS startup, quota will be re-
initialized if the Hardware Node was incorrectly brought down (for example power switch was
hit). This operation may noticeably increase node startup time.
For both disk usage and inodes usage OpenVZ allows setting soft and hard limits as well as an
expiration time. Upon reaching a soft limit OpenVZ starts expiration time counter. When the
time is expired, the quota will block the subsequent disk space or inode allocation requests.
Hard limit cannot be exceeded.
vzquota
understands the following commands:
init
Before you can use quota the current disk space and inode usage should be counted.
For the
init
command, you must specify all the limits as well as the file tree where
you want to initialize the quota.
drop
Forget about given quota ID, dropping existent quota file.
on
Turns on quota accounting on the specified quota ID.
off
Turns off quota accounting on the specified quota ID.
setlimit
Allows changing the quota limits for the running quota.
stat
Shows quota statistics for the running quota.
show
Shows quota usage from quota file.
vzquota init
This command is used for counting current usage of disk space and inodes. It has the following
syntax:
vzquota [options] init
vpsid
[
command-options
]
The following options are understood by the
vzquota init
command:
-s, --sub-quotas 1|0
Optional. If the value used is 1 than per user/group quota is
enabled in the Virtual Private Server. By default user/group
quotas are disabled.
-b, --block-softlimit
num
Required. Disk quota block soft limit – amount of 1 Kb
blocks allowed for the Virtual Private Server to use. This
limit can be exceeded by the VPS for the time specified by
block expiration time (see below). When expiration time is
off, the Virtual Private Server cannot allocate more disk
space even if the hard limit is not yet reached.
-B, --block-hardlimit
num
Required. Specifies disk quota block hard limit in 1 Kb
blocks. This limit cannot be exceeded by the Virtual Private
Server.