Examples of quota enforcement for FlexGroup volumes
You can use the examples to understand how to configure quotas with limits in ONTAP 9.5 and later.
Example 1: Enforcing a quota rule with disk limits
You should create a quota policy rule of type user with both an achievable soft disk limit and hard disk limit.
cluster1::> volume quota policy rule create -vserver vs0
-policy-name default -volume FG -type user -target "" -qtree "" -disk-limit 1T -soft-disk-limit 800GYou can view the quota policy rule by entering the following command:
cluster1::> volume quota policy rule show -vserver vs0 -policy-name default -volume FG
Vserver: vs0 Policy: default Volume: FG
Soft Soft
User Disk Disk Files Files
Type Target Qtree Mapping Limit Limit Limit Limit Threshold
----- -------- ------- ------- -------- ------- ------ ------- ---------
user "" "" off 1TB 800GB - - -To activate the new quota rule, you initialize quotas on the volume by entering the following command:
cluster1::> volume quota on -vserver vs0 -volume FG -foreground true
[Job 49] Job succeeded: SuccessfulYou can view the disk usage and file usage information of the FlexGroup volume by using the quota report.
cluster1::> volume quota report -vserver vs0 -volume FG
Vserver: vs0
----Disk---- ----Files----- Quota
Volume Tree Type ID Used Limit Used Limit Specifier
------- -------- ------ ------- ----- ----- ------ ------ ---------
FG user root 50GB - 1 -
FG user * 800GB 1TB 0 - *
2 entries were displayed.
After the hard disk limit is reached, the quota policy rule target (user, in this case) is blocked from writing more data to the files.
Example 2: Enforcing a quota rule for multiple users
You should create a quota policy rule of type user, where multiple users are specified in the quota target (CIFS users, or a combination of both) and where the rule has both an achievable soft disk limit and hard disk limit.
cluster1::> quota policy rule create -vserver vs0 -policy-name default -volume FG -type user -target "rdavis,ABCCORP\RobertDavis" -qtree "" -disk-limit 1TB -soft-disk-limit 800GB
You can view the quota policy rule by entering the following command:
cluster1::> quota policy rule show -vserver vs0 -policy-name default -volume FG
Vserver: vs0 Policy: default Volume: FG
Soft Soft
User Disk Disk Files Files
Type Target Qtree Mapping Limit Limit Limit Limit Threshold
----- -------- ------- ------- -------- ------- ------ ------- ---------
user "rdavis,ABCCORP\RobertDavis" "" off 1TB 800GB - -To activate the new quota rule, you initialize quotas on the volume by entering the following command:
cluster1::> volume quota on -vserver vs0 -volume FG -foreground true
[Job 49] Job succeeded: SuccessfulYou can verify that the quota state is active by entering the following command:
cluster1::> volume quota show -vserver vs0 -volume FG
Vserver Name: vs0
Volume Name: FG
Quota State: on
Scan Status: -
Logging Messages: on
Logging Interval: 1h
Sub Quota Status: none
Last Quota Error Message: -
Collection of Quota Errors: -You can view the disk usage and file usage information of the FlexGroup volume by using the quota report.
cluster1::> quota report -vserver vs0 -volume FG
Vserver: vs0
----Disk---- ----Files----- Quota
Volume Tree Type ID Used Limit Used Limit Specifier
------- -------- ------ ------- ----- ----- ------ ------ ---------
FG user rdavis,ABCCORP\RobertDavis 0B 1TB 0 - rdavis,ABCCORP\RobertDavisThe quota limit is shared among all users listed in the quota target.
After the hard disk limit is reached, users listed in the quota target are blocked from writing more data to the files.
Example 3: Enforcing quota with user mapping enabled
You should create a quota policy rule of type user, specify a Windows user as the quota target with user-mapping set to on , and create the rule with both an achievable soft disk limit and hard disk limit.
The mapping for Windows users must be configured earlier by using the vserver name-mapping create command.
cluster1::> quota policy rule create -vserver vs0
-policy-name default -volume FG -type user -target rdavis -qtree "" -disk-limit 1TB -soft-disk-limit 800GB -user-mapping onYou can view the quota policy rule by entering the following command:
cluster1::> quota policy rule show -vserver vs0 -policy-name default -volume FG
Vserver: vs0 Policy: default Volume: FG
Soft Soft
User Disk Disk Files Files
Type Target Qtree Mapping Limit Limit Limit Limit Threshold
----- -------- ------- ------- -------- ------- ------ ------- ---------
user rdavis "" on 1TB 800GB - - -To activate the new quota rule, you initialize quotas on the volume by entering the following command:
cluster1::> volume quota on -vserver vs0 -volume FG -foreground true
[Job 49] Job succeeded: SuccessfulYou can verify that the quota state is active by entering the following command:
cluster1::> volume quota show -vserver vs0 -volume FG
Vserver Name: vs0
Volume Name: FG
Quota State: on
Scan Status: -
Logging Messages: on
Logging Interval: 1h
Sub Quota Status: none
Last Quota Error Message: -
Collection of Quota Errors: -You can view the disk usage and file usage information of the FlexGroup volume by using the quota report.
cluster1::> quota report -vserver vs0 -volume FG
Vserver: vs0
----Disk---- ----Files----- Quota
Volume Tree Type ID Used Limit Used Limit Specifier
------- -------- ------ ------- ----- ----- ------ ------ ---------
FG user rdavis,ABCCORP\RobertDavis 0B 1TB 0 - rdavisThe quota limit is shared between the user listed in the quota target and its corresponding Windows.
After the hard disk limit is reached, both the user listed in the quota target and its corresponding Windows is blocked from writing more data to the files.
Example 4: Verifying the qtree size when quota is enabled
You should create a quota policy rule of type tree and where the rule has both an achievable soft disk limit and hard disk limit.
cluster1::> quota policy rule create -vserver vs0 -policy-name default -volume FG -type tree -target tree_4118314302 -qtree "" -disk-limit 48GB -soft-disk-limit 30GB
You can view the quota policy rule by entering the following command:
cluster1::> quota policy rule show -vserver vs0
Vserver: vs0 Policy: default Volume: FG
Soft Soft
User Disk Disk Files Files
Type Target Qtree Mapping Limit Limit Limit Limit Threshold
----- -------- ------- ------- -------- ------- ------ ------- ---------
tree tree_4118314302 "" - 48GB - 20 -To activate the new quota rule, you initialize quotas on the volume by entering the following command:
cluster1::> volume quota on -vserver vs0 -volume FG -foreground true
[Job 49] Job succeeded: SuccessfulYou can view the disk usage and file usage information of the FlexGroup volume by using the quota report.
cluster1::> quota report -vserver vs0
Vserver: vs0
----Disk---- ----Files----- Quota
Volume Tree Type ID Used Limit Used Limit Specifier
------- -------- ------ ------- ----- ----- ------ ------ ---------
FG tree_4118314302 tree 1 30.35GB 48GB 14 20 tree_4118314302The quota limit is shared between the user listed in the quota target and its corresponding Windows user.
From an NFS client, use the df command to view the total space usage, available space, and the used space.
scsps0472342001# df -m /t/10.53.2.189/FG-3/tree_4118314302
Filesystem 1M-blocks Used Available Use% Mounted on
10.53.2.189/FG-3 49152 31078 18074 63% /t/10.53.2.189/FG-3With hard limit, the space usage is calculated from an NFS client as follows:
Total space usage = hard limit for tree
Free space = Hard limit minus qtree space usage
Without hard limit, the space usage is calculated from an NFS client as follows:
Space usage = quota usage
Total space = Sum of quota usage and physical free space in the volume
From the SMB share, use Windows Explorer to view the total space usage, available space, and the used space.
From an SMB share, you should be aware of the following considerations for calculating the space usage:
The user quota hard limit for the user and group is taken into consideration for calculating the total available space.
The minimum value among the free space of the tree quota rule, the user quota rule, and the group quota rule is considered as the free space for the SMB share.
The total space usage is variable for SMB and depends on the hard limit that corresponds to the minimum free space among the tree, user, and group.