2013-07-11 05:14 AM
I'm trying to find a SDK call similar to what OnTAP CLI 'maxfiles' does.
filer> maxfiles etng_done
Volume etng_done: maximum number of files is currently 174999984 (144602284 used).
I found a 'volume-list-info' API, it looks like what I need, but it doesn't generate exactly the same output:
<files-total>174999984</files-total> // This is current max value from 'maxfiles' output
<files-used>144607960</files-used> // This is not exactly the same value as in 'maxfiles' output
<inodefile-public-capacity>174999984</inodefile-public-capacity> // This is current max value from 'maxfiles' output
So my question is how do I get "files used" of 'maxfiles' output via SDK API?
Solved! SEE THE SOLUTION
2013-07-11 02:02 PM
It is interesting that the manpage for maxfiles doesn't state anything about used files:
maxfiles increases the number of files that a volume can hold, as close as possible to max. File inodes are stored in blocks, and the filer may round the requested max number of files to the nearest block.
Once increased, the value of max can never be lowered, so the new value must be larger than the current value.
The value cannot be changed for a flexcache volume.
If no argument is specified, maxfiles displays the current value of max for all volumes in the system. If just the vol_name argument is given, the current value of max for the specified volume is displayed. For a flexcache volume, the origin volume's value is displayed.
Because each allowable file consumes disk space, and because the value of max can never be reduced, increasing max consumes disk space permanently. Increasing the max number of files to a large value can also result in less available memory after an upgrade. This means, you might not be able to run WAFL_check. If maxfiles identifies a new size as unreasonably large, it queries the user to verify that the new value is correct.
The filer's df command (see na_df(1)) can be used to determine how many files have currently been created in the file system.
I would compare if the df information matches the API information. The used files in the maxfiles could be a hold-over.
- Rick -
2013-07-12 03:58 AM
Do you mean "df -i" ? I think it reports inodes count, but not files count:
filer> df -i etng_done
Filesystem iused ifree %iused Mounted on
/vol/etng_done/ 146615465 28384519 84% /vol/etng_done/
filer> maxfiles etng_done
Volume etng_done: maximum number of files is currently 174999984 (146616019 used).
However 28384519 + 146615465 = 174999984
So it seems that I can definitely say that "max inodes total" = "max files number", however it's controversial about the "files used number".
2013-07-16 05:40 AM
Maybe someone is aware how DFM's "Inode Almost Full" or "Inode Full" alerts are being calculated? That's what I essentially need to have in my SDK based check.