This blog is a quick workaround and addition to my earlier blog “NetApp ONTAP Tip – Quick File Count Reporting with Null Quotas” A customer noticed that the null qtree quotas only report file counts and space usage on qtrees, but they also wanted to see file counts in the base volume (non-qtree) data. Below is a demonstration using both user and group null quotas for all users and groups. The same former example with a null qtree quota is also shown. You could choose to enable null quotas for either all users or all groups with the same null result, but all three null methods are shown. A null user quota by itself provides all real-time file counts.
Note that user or group quotas are necessary to see file counts in the base volume (non-qtree contained data) and report all paths (base volume plus qtrees), so you need subtract qtree file counts to get the standalone base volume file count. If you do not have qtrees, then you will have the total base volume file count. The real-time file count and usage report is useful when a du may run for hours or days.
ONTAP continually evolves, and I look forward to new native analytics features coming that we are testing in our lab. This post will be replaced by a future method coming soon.
The example below has one volume named “quota_vol1” with one qtree named “prod”.
Create a Quota Policy called “null”
quota policy create -vserver quotas -policy-name null
Create Quota Policy Rules using dash “-“ to track without enforcement
Create Null Tree, User and Group Quotas for all users/groups/trees
quota policy rule create -vserver quotas -policy-name null -volume quota_vol1 -type tree -target “” -disk-limit – -file-limit – -threshold –
quota policy rule create -vserver quotas -policy-name null -volume quota_vol1 -type user -target “” -disk-limit – -file-limit – -threshold – -qtree “”
Group (you likely would use user or group, not both)
quota policy rule create -vserver quotas -policy-name null -volume quota_vol1 -type group -target “” -disk-limit – -file-limit – -threshold – -qtree “”
Modify the SVM to use the quota policy (only one policy at a time per SVM is active and up to five are supported with one active and four inactive)
vserver modify -vserver quotas -quota-policy null
Enable Quotas on the Volume
quota on -vserver quotas -volume quota_vol1
Show Quotas and Report
quota show -state on
Quota Report to real-time check file count and space used
quota report -vserver quotas
As seen below, a user null quota provides ALL information needed, and group and tree are redundant when calculating file counts for the volume and trees
- Tree – we have 43,328 files
- 43,327 files plus the parent volume “.” in the “prod” qtree
- User/Group – we have 67,844 total files
- 67,842 files plus 2x parent volumes “.”
- For non-qtree, base volume files
- 67,844 volume files minus 43,328 qtree files = 24,516
- 24,515 files plus the parent volume “.”
- Note that for additional qtrees, you would subtract all qtrees from the base volume count