Skip to content

Home Storage Quotas

This section describes how to enable and configure home storage quota for users of Virtual Cluster. Since the storage for home directories is shared, it may be necessary to limit the amount of storage that each user can use. This can be achieved by enabling home storage quota and setting a quota limit for each user. The command line tool vc-quota-manager (available on the service instance) can be used to manage the home storage quota.

Enable or Disable Home Storage Quota#

Home storage quota is disabled by default. To set quota limits you must enable home storage quota, which can be done by running the following command:

vc-quota-manager quota enable

This enables home storage quota for all users. Note that this command does not set any quota limit. To set a quota limit, see the section about quota limits.

To disable home storage quota, run the following command:

vc-quota-manager quota disable

This disables home storage quota for all users.

Warning

This command also removes any quota limit that was set for any user and enabling quota again will not restore the previously set quota limits.

You can check whether home storage quota is enabled or disabled by running the following command:

vc-quota-manager quota status

Set a Quota Limit#

Run the following command to set a quota limit for a user:

vc-quota-manager set-limit <USERNAME> <QUOTA_LIMIT>
where <USERNAME> is the username of the user and <QUOTA_LIMIT> is the limit in bytes or other human readable format such as 10K, 10M, 10G. For example, to set a quota limit of 10GB for user alice, run the following command:

vc-quota-manager set-limit alice 10G

Note that if a user does not currently have a home directory, one will be created for the user when the quota limit is set.

You may also change the quota limit for a user by using the same command.

Remove a Quota Limit#

To remove an already set quota limit for a user, run the following command:

vc-quota-manager remove-limit <USERNAME>

Displaying Quota Limits#

To show the quota limits for all users, run the following command:

vc-quota-manager show

To show the quota limit for a specific user, run the following command::

vc-quota-manager show <USERNAME>

You can infer the current usage by referring to the Referenced column and the quota limit by referring to the Max Referenced column in the output of the above commands. If a quota limit is not set for a user, the Max Referenced column will show none.

Additional Information#

The home storage quota is currently implemented using BTRFS subvolumes, qgroups and quotas. And so any commands that can be used to manage BTRFS subvolumes, qgroups and quotas can be used to debug or manage the home storage quotas. This is an internal implementation detail and only documented here for reference.

A few points to note when using home storage quota management in Virtual Cluster are:

  • Quota management is only supported for user home directories.

  • Depending on the way a user home directory was created this program might not be able to set up a quota limit. If this is the case, you may copy the contents of the old home directory to the new subvolume.

  • If a user exists but does not have a home directory, setting a quota limit for the user will automatically create a subvolume for the user under /home.

  • Quotas limits can be adjusted or removed at any time.

  • Disabling quota management will remove all previously set quota limits for users.