These examples help you understand how to configure quotas and read quota reports.
cluster1::>volume quota policy create -vserver vs1 -policy-name quota_policy_vs1_1
cluster1::>vserver modify -vserver vs1 -quota-policy quota_policy_vs1_1
You decide to impose a hard limit of 50 MB for each user in vol1 by entering the following command:
cluster1::>volume quota policy rule create -vserver vs1 -policy-name quota_policy_vs1_1 -volume vol1 -type user -target "" -disk-limit 50MB -qtree ""
cluster1::>volume quota on -vserver vs1 -volume vol1 -foreground
cluster1::>volume quota reportThe resulting quota report is similar to the following report:
Vserver: vs1 ----Disk---- ----Files----- Quota Volume Tree Type ID Used Limit Used Limit Specifier ------- -------- ------ ------- ----- ----- ------ ------ --------- vol1 user * 0B 50MB 0 - * vol1 user jsmith 49MB 50MB 37 - * vol1 user root 0B - 1 -The first line shows the default user quota that you created, including the disk limit. Like all default quotas, this default user quota does not display information about disk or file usage. In addition to the quota that was created, two other quotas appear—one quota for each user that currently owns files on vol1. These additional quotas are user quotas that were derived automatically from the default user quota. The derived user quota for the user jsmith has the same 50-MB disk limit as the default user quota. The derived user quota for the root user is a tracking quota (without limits).
If any user on the system (other than the root user) tries to perform an action that would use more than 50 MB in vol1 (for example, writing to a file from an editor), the action fails.
cluster1::>volume quota policy rule create -vserver vs1 -policy-name quota_policy_vs1_1 -volume vol1 -type user -target jsmith -disk-limit 80MB -qtree ""This is an explicit user quota, because the user is explicitly listed as the target of the quota rule.
cluster1::>volume quota resize -vserver vs1 -volume vol1 -foregroundQuotas remain in effect while you resize, and the resizing process is short.
cluster1::> volume quota report Vserver: vs1 ----Disk---- ----Files----- Quota Volume Tree Type ID Used Limit Used Limit Specifier ------- -------- ------ ------- ----- ----- ------ ------ --------- vol1 user * 0B 50MB 0 - * vol1 user jsmith 50MB 80MB 37 - jsmith vol1 user root 0B - 1 - 3 entries were displayed.The second line now shows a Disk Limit of 80 MB and a Quota Specifier of jsmith.
Therefore, jsmith can use up to 80 MB of space on vol1, even though all other users are still limited to 50 MB.
Suppose you want to receive a notification when users reach within 5 MB of their disk limits. To create a threshold of 45 MB for all users, and a threshold of 75 MB for jsmith, you change the existing quota rules by entering the following commands:
cluster1::>volume quota policy rule modify -vserver vs1 -policy quota_policy_vs1_1 -volume vol1 -type user -target "" -qtree "" -threshold 45MB cluster1::>volume quota policy rule modify -vserver vs1 -policy quota_policy_vs1_1 -volume vol1 -type user -target jsmith -qtree "" -threshold 75MB
Since the sizes of the existing rules are changed, you resize quotas on the volume in order to activate the changes. You wait until the resize process is finished.
cluster1::>volume quota report -thresholds Vserver: vs1 ----Disk---- ----Files----- Volume Tree Type ID Used Limit Used Limit Quota (Thold) Specifier ------- -------- ------ ------- ----- ----- ------ ------ --------- vol1 user * 0B 50MB 0 - * (45MB) vol1 user jsmith 59MB 80MB 55 - jsmith (75MB) vol1 user root 0B - 1 - ( -) 3 entries were displayed.The thresholds appear in parentheses in the Disk Limit column.
Suppose you need to partition some space for two projects. You can create two qtrees, named proj1 and proj2, to accommodate those projects within vol1.
cluster1:>>volume quota policy rule create -vserver vs1 -policy-name quota_policy_vs1_1 -volume vol1 -type tree -target "" -disk-limit 20GBNote that the correct type is tree, not qtree.
cluster1:>>volume quota off -vserver vs1 -volume vol1 cluster1:>>volume quota on -vserver vs1 -volume vol1 -foreground
Alternatively, you can run the commands to re-initialize the quotas for a volume from the node that contains the particular volume.
When you display a quota report, it has several new lines: some lines are for tree quotas and some lines are for derived user quotas.
----Disk---- ----Files----- Quota Volume Tree Type ID Used Limit Used Limit Specifier ------- -------- ------ ------- ----- ----- ------ ------ --------- ... vol1 tree * 0B 20GB 0 - * vol1 proj1 tree 1 0B 20GB 1 - proj1 vol1 proj2 tree 2 0B 20GB 1 - proj2 ...The default tree quota that you created appears in the first new line, which has an asterisk (*) in the ID column. In response to the default tree quota on a volume, ONTAP automatically creates derived tree quotas for each qtree in the volume. These are shown in the lines where proj1 and proj2 appear in the Tree column.
----Disk---- ----Files----- Quota Volume Tree Type ID Used Limit Used Limit Specifier ------- -------- ------ ------- ----- ----- ------ ------ --------- ... vol1 proj1 user * 0B 50MB 0 - vol1 proj1 user root 0B - 1 - vol1 proj2 user * 0B 50MB 0 - vol1 proj2 user root 0B - 1 - ...Default user quotas on a volume are automatically inherited for all qtrees contained by that volume, if quotas are enabled for qtrees. When you added the first qtree quota, you enabled quotas on qtrees. Therefore, derived default user quotas were created for each qtree. These are shown in the lines where ID is asterisk (*).
Because the root user is the owner of a file, when default user quotas were created for each of the qtrees, special tracking quotas were also created for the root user on each of the qtrees. These are shown in the lines where ID is root.
cluster1::>volume quota policy rule create -vserver vs1 -policy-name quota_policy_vs1_1 -volume vol1 -type user -target "" -disk-limit 10MB -qtree proj1
This is a change to an existing quota, because it changes the default user quota for the proj1 qtree that was derived from the default user quota on the volume. Therefore, you activate the change by resizing quotas. When the resize process is complete, you can view the quota report.
----Disk---- ----Files----- Quota Volume Tree Type ID Used Limit Used Limit Specifier ------- -------- ------ ------- ----- ----- ------ ------ --------- vol1 proj1 user * 0B 10MB 0 - *
cluster1::>volume quota policy rule create -vserver vs1 -policy-name quota_policy_vs1_1 -volume vol1 -type user -target jsmith -disk-limit 80MB -qtree proj1
Since this is an explicit quota for which a default quota already existed, you activate the change by resizing quotas. When the resize process is complete, you display a quota report.
----Disk---- ----Files----- Quota Volume Tree Type ID Used Limit Used Limit Specifier ------- -------- ------ ------- ----- ----- ------ ------ --------- vol1 proj1 user jsmith 61MB 80MB 57 - jsmith
cluster1::>volume quota report Vserver: vs1 ----Disk---- ----Files----- Quota Volume Tree Type ID Used Limit Used Limit Specifier ------- -------- ------ ------- ----- ----- ------ ------ --------- vol1 tree * 0B 20GB 0 - * vol1 user * 0B 50MB 0 - * vol1 user jsmith 70MB 80MB 65 - jsmith vol1 proj1 tree 1 0B 20GB 1 - proj1 vol1 proj1 user * 0B 10MB 0 - * vol1 proj1 user root 0B - 1 - vol1 proj2 tree 2 0B 20GB 1 - proj2 vol1 proj2 user * 0B 50MB 0 - vol1 proj2 user root 0B - 1 - vol1 user root 0B - 3 - vol1 proj1 user jsmith 61MB 80MB 57 - jsmith 11 entries were displayed.
The user jsmith is required to meet the following quota limits to write to a file in proj1: