Manage quotas using the CLI
Manage directory, user, and group quotas for your filesystems using the WEKA CLI.
Using the CLI, you can:
Set default quota
Command: weka fs quota set-default
Sets the default quota for the specified path. The default quota is automatically applied when new instances of the selected quota type are created under that path. For example, when a new subdirectory is created (directory type), or when a new user or group starts consuming space in the filesystem (user or group type).
Before using this command, ensure that a mount point to the relevant filesystem is set.
weka fs quota set-default <path> [--type type] [--soft soft] [--hard hard] [--grace grace] [--owner owner]
Parameters
path*
Path to the directory to set the quota. Required for directory quota only. The relevant filesystem must be mounted when setting the quota.
type
Quota type.
Possible values: directory, user, or group
Default: directory
soft
Soft quota limit.
Exceeding this number is displayed as an exceeded quota, but it is not enforced until the grace period is over.
The capacity can be in decimal or binary units.
Format: 1GB, 1TB, 1GiB, 1TiB, unlimited
Default: unlimited
hard
Hard quota limit.
Exceeding this number does not allow more writes before clearing some space in the directory.
The capacity can be in decimal or binary units.
Format: 1GB, 1TB, 1GiB, 1TiB, unlimited
Default: unlimited
grace
Specify the grace period before the soft limit is treated as a hard limit.
Format: 1d, 1w, unlimited
Default: unlimited
owner
A unique string identifying the directory owner (can be a name, email, slack ID, and so on.) This owner is shown in the quota report and can be notified upon exceeding the quota. Supports up to 48 characters.
Set quota
Command: weka fs quota set
Before setting a quota, check which scenario applies:
Directory quota: A Data Services container is required to run the
QUOTA_COLORINGbackground task.User or group quota on filesystems created in WEKA 5.1.20 or later: User quota accounting is enabled automatically. No Data Services container is required.
User or group quota on filesystems created before WEKA 5.1.20: Run
weka fs quota enable-usersbefore setting the quota. A Data Services container is required for this one-time operation.
Related topic
Set up a Data Services container for background tasks.
Use the following command to set a quota:
weka fs quota set <path> [--type type] [--id id] [--soft soft] [--hard hard] [--grace grace] [--owner owner] [--filesystem filesystem] [--snap-name snap-name] [--color color]
Parameters
path*
Path to the directory to set the quota. Required for directory quota only. The relevant filesystem must be mounted when setting the quota.
type
Quota type.
Possible values: directory, user, or group
Default: directory
id
The UID or GID the quota applies to. Required when type is user or group.
soft
Soft quota limit.
Exceeding this number is displayed as an exceeded quota, but it is not enforced until the grace period is over.
The capacity can be in decimal or binary units.
Format: 1GB, 1TB, 1GiB, 1TiB, unlimited
Default: unlimited
hard
Hard quota limit.
Exceeding this number does not allow more writes before clearing some space in the directory.
The capacity can be in decimal or binary units.
Format: 1GB, 1TB, 1GiB, 1TiB, unlimited
Default: unlimited
grace
Specify the grace period before the soft limit is treated as a hard limit.
Format: 1d, 1w, unlimited
Default: unlimited
owner
A unique string identifying the directory owner (can be a name, email, slack ID, and so on.) This owner will be shown in the quota report and can be notified upon exceeding the quota. Supports up to 48 characters.
filesystem
Specifies the target filesystem for applying the quota. This parameter only applies for user or group quota. Use this parameter when the quota must be enforced outside of a mount point, or in cases where the POSIX user does not have direct access to the directory through a mounted path. For requirement details, see Guidelines for quota management.
snap-name
Name of the writable snapshot. Use this parameter to set a quota outside the mount point.
Enable or disable user quota accounting
Command: weka fs quota enable-users / weka fs quota disable-users
User quota accounting applies to both user quotas and group quotas.
Filesystems created in WEKA 5.1.20 or later: User quota accounting is enabled automatically. User and group quotas can be set immediately.
Filesystems created before WEKA 5.1.20: Enable user quota accounting before setting user or group quotas. Run the following command:
This triggers a one-time background QUOTA_COLORING task that stamps existing objects with UID quota identifiers. A Data Services container must be running on the cluster for this operation to complete.
There is no fallback mode for this operation. If no Data Services container is available, the command does not complete.
Per-user and per-group quota limits can be set after accounting is enabled.
To disable user quota accounting, run the following command:
Parameters
filesystem*
Filesystem name.
snap-name
Name of the writable snapshot.
List quotas or default quotas
Command: weka fs quota list / weka fs quota list-default
Use the following command to list the quotas (by default, only exceeding quotas are listed):
weka fs quota list [filesystem] [--snap-name snap-name] [--type type] [--path path] [--under under] [--over over] [--quick] [--all]
Parameters
filesystem
Filesystem name. Use this parameter to display a quota report only on the specified filesystem. Default: All filesystems
snap-name
Displays the quota report from the time of the snapshot. It must be a valid snapshot name and be given along with the corresponding filesystem.
type
Quota type.
Possible values: directory, user, or group
Default: directory
path
Path to a directory. Shows quota report only on the specified directory. The relevant filesystem must be mounted in the server running the query.
under
A path to a directory under a wekafs mount. The relevant filesystem must be mounted in the server running the query.
over
Shows only quotas over this percentage of usage.
Possible values: 0-100
quick
Do not resolve inode to a path. Provides quicker results if the report contains many entries. Default: False
all
Shows all the quotas, not just the exceeding ones. Default: False
Use the following command to list the directory default quotas:
weka fs quota list-default [filesystem] [--snap-name snap-name] [--type type] [--path path]
Parameters
filesystem
Filesystem name. Use this parameter to display the default quotas only on the specified filesystem. Default: All filesystems
snap-name
Displays the default quotas from the time of the snapshot.
It must be a valid snapshot name and specified along with the corresponding fs-name.
type
Quota type.
Possible values: directory, user, or group
Default: directory
path
Path to a directory. Shows the default quotas report only on the specified directory. The relevant filesystem must be mounted in the server running the query.
Unset default quota
Command: weka fs quota unset-default
Use the following command to unset a default quota of a directory:
weka fs quota unset-default <path> [--type type] [--filesystem filesystem] [--snap-name snap-name]
Parameters
path*
Path to the directory to set the quota. The relevant filesystem must be mounted when setting the quota.
type
Quota type.
Possible values: directory, user, or group
filesystem
Filesystem name.
Required for user or group types.
snap-name
Name of the writable snapshot.
Only applies to user or group types.
Reset quota
Command: weka fs quota reset
Use the following command to reset a quota:
weka fs quota reset [path] [--type type] [--id id] [--generation generation] [--filesystem filesystem] [--snap-name snap-name]
Parameters
path*
Path to the directory to unset the quota. The relevant filesystem must be mounted when setting the quota.
type
Quota type.
Possible values: directory, user, or group
id
The UID or GID the quota applies to. Required when type is user or group.
generation
The generation of the directory quota to remove. Applies to directory quotas only. If omitted, the current generation is used.
filesystem
Filesystem name.
Required for user or group types.
snap-name
Name of the writable snapshot to remove if exists.
Only applies to user or group types.
Last updated