Previous page

Next page

Locate page in Contents

Print this page

Setting Up Per-Container Disk Quota Parameters

Three parameters determine how much disk space and inodes a Container can use. These parameters are specified in the Container configuration file:

DISKSPACE

The total size of disk space that can be consumed by the Container, in 1-Kb blocks. When the space used by the Container hits the soft limit, the Container can allocate additional disk space up to the hard limit during the grace period specified by the QUOTATIME parameter.

DISKINODES

The total number of disk inodes (files, directories, and symbolic links) the Container can allocate. When the number of inodes used by the Container hits the soft limit, the Container can create additional file entries up to the hard limit during the grace period specified by the QUOTATIME parameter.

QUOTATIME

The grace period of the disk quota, in seconds. The Container is allowed to temporarily exceed the soft limit values for the disk space and disk inodes quotas for no more than the period specified by this parameter.

The first two parameters have both soft and hard limits (or, simply, barriers and limits). The hard limit is the limit that cannot be exceeded under any circumstances. The soft limit can be exceeded up to the hard limit, but as soon as the grace period expires, the additional disk space or inodes allocations will fail. Barriers and limits are separated by colons (“:”) in Container configuration files and in the command line.

The following session sets the disk space available to Container 101 to approximately 1 GB and allows the Container to allocate up to 90,000 inodes. The grace period for the quotas is set to 10 minutes:

# pctl set 101 --diskspace 1000000:1100000 --save

Saved parameters for Container 101

# pctl set 101 --diskinodes 90000:91000 --save

Saved parameters for Container 101

# pctl set 101 --quotatime 600 --save

Saved parameters for Container 101

# pctl exec 101 df

Filesystem 1k-blocks Used Available Use% Mounted on

vzfs 1000000 747066 252934 75% /

# pctl exec 101 stat -f /

File: "/"

ID: 0 0 Namelen: 255 Type: UNKNOWN (0x565a4653)

Blocks: Total: 1000000 Free: 252934 Available: 252934 Size: 1024

Inodes: Total: 90000 Free: 9594

It is possible to change the first-level disk quota parameters for a running Container. The changes will take effect immediately. If you do not want your changes to persist till the next Container startup, do not use the –-save switch.