General-h Print usage information.
-V Print utility version.
-q Quiet mode. Causes all warning and diagnostic messages to be suppressed. Only fatal errors are
displayed.
-v Verbose mode. Causes vzquota to print debugging messages about its progress. Multiple -v options
increase verbosity. Maximum is 2.
-b Batch mode. in this mode outputs (usually on stat and show commands) will be in format better
suitable for parsing by a script.
QuotaCommands
The following commands are available:
init A necessary preliminary for any other quota command work: create a new quota file, calculating
current disk usage from given path. This command requires full set of quota soft- and hardlimits
given as command-line options. Limits are also stored in quota file, so subsequent vzquotaon
doesn't requires any quota limit as command-line parameter, although accepts them as well. New
specified limits and flags will also be stored in the quota file.
You can also create your own quota files for arbitrary quota accounting points. Quota file
location and path to quota accounting point can be specified via -c and -p options (see below).
You can use also -R option instead of -c option, to set relative quota file location. In this case
quota file resides one dirrectory upper than quota accounting point and has special name (see
below).
drop Remove quota file. Command checks if quota is running and refuses to remove file in this case,
option -f allows to override that rule.
on Turn quota on. If previous quota session wasn't switched off properly (quota is not running, but
quota file indicates it is), initialization procedure will be performed. -f option allow to force
initialization procedure regardless of the shutdown status. Command on doesn't work in case
specified quota id is running.
off Turn quota off, write usage statistic back to the quota file. Doesn't work if quota file cannot be
accessed, also accepts -f option (force switching off, even if usage statistic will be lost). This
is possible that quota will still be in a stopped state, even if -f flag is used.
setlimit
Set new quota parameters. Requires at least one quota parameter or flag specified. Applies new
parameters immediately if quota with given quota_id is running. Stores new limits and flags in the
quota file. Option -f specifies to mark quota as dirty, so at the next quota start, disk will be
rescanned and usage updated.
setlimit2
Set second-level quota parameters. Applies new parameters immediately if quota with given quota_id
is running and second-level quota is on. Stores new limits in the quota file.
reload2
Reload second-level quota limits from quota file for given quota_id.
stat Show usage statistics and update it in quota file. Option -f causes to do not read and update
quota file, just print statistics from kernel. Option -t specifies to show and update user/group
based quota statistics for a container. Works on running containers only. The command with -t
option flushes all quota statistics from kernel to file and thus may be used for backup purposes.
show Show usage and limits info from quota file. Option -t specifies to show user/group quota
information as well.
Settingquotalimits
All these options are required in init command, and optionally accepted in on and setlimit commands.
-s, --sub-quotas1|0
Enables or disables user/group based quota inside the container. Here 1 means to enable, and 0 -
to disable. By default user/group quota is disabled. This option is accepted by init, on and
setlimit commands.
-uuser_id
For setlimit2 command only. Limits will be applied to the specified user_id.
-ggroup_id
For setlimit2 command only. Limits will be applied to the specified group_id.
-u, --ugid-limitlimit
For on and setlimit commands only. Specifies maximum number of user and group IDs allowed in the
container. If the value is 0, user/group quota will not be accounted. Default value is 0. There
is one note concerning setlimit command. If first-level quota is running, second-level quota is
active and not all ugid objects were loaded into kernel by on command due to insufficient
ugid_limit value (this can be checked by issuing stat-t command and observing whether ugid limit
was exceeded), then setlimit with new limit value updates it in kernel and file but this change
does not take immediate effect. Modification will be applied after quota restart.
-b, --block-softlimitbsl
Disk quota block soft limit. Soft limit is amount of blocks which excess is allowed in time equal
exptime. On the expiration of this time soft limit becomes hard limit. Block limits are set in
1k sized blocks.
-B, --block-hardlimitbhl
Disk quota block hard limit. Hard limit is amount of blocks which excess is not allowed.
-e, --block-exptimebet
Disk quota expiration time for excess of a block soft limit. Time can be given in two different
formats:
1. dd:hh:mm:ss
For instance: 30 - 30 seconds; 12:00 - 12 minutes; 20:15:11:00 - 20 days, 15 hours, 11 minutes
2. xxA, where A - h/H(hour); d/D(day); w/W(week); m/M(month); y/Y(year).
For instance: 7D - 7 days; 01w - 1 week; 3m - 3 months
-i, --inode-softlimitisl
Disk quota inode soft limit. Similarly to block soft limit.
-I, --inode-hardlimitihl
Disk quota inode hard limit.
-n, --inode-exptimeiet
Disk quota expiration time for excess of a inode soft limit.
Otheroptions-ppath
Point of quota accounting for given quota_id. This option required for init command and can be
used also with any another command to override quota path obtained from quota file. For on and
setlimit commands, this option can be used to set and save new quota accounting path for given
quota_id-R Set special relative path to quota_file. If this option is specified, quota file location will
depends on path to quota accounting dir: if your quota accounting path is /path/to/somewhere/ than
quota file will be /path/to/quota.somewhere. If this option is not specified, quota file location
is /var/lib/vzquota/quota.quota_id. All commands accept this option.
-cquota_file
This option allows to specify a quota_file to work with. All commands accept this option. If this
option is not specified, default file location depends on whether -R option is specified or not
(see above).
-f Force option. Accepted by drop, on, off, stat, setlimit and setlimit2 commands. Action of this
option differs for different commands and is described above for each command separately.
-t For stat and show commands only. Processes user/group quota statistics. Specifies whether to show
(update in file) user/group quota information.
-t For setlimit2 command. Set second-level quota time grace parameters.