Software Development Kit (SDK) and API Discussions

OnTAP maxfiles command analogue in SDK

vladimirzhigulin
4,222 Views

Hello,

I'm trying to find a SDK call similar to what OnTAP CLI 'maxfiles' does.

eg.

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:

<volume-info>
                        <name>etng_done</name>

                         ...

                        <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
                        <files-private-used>513</files-private-used>
                        <inodefile-public-capacity>174999984</inodefile-public-capacity> // This is current max value from 'maxfiles' output
                        <inodefile-private-capacity>31142</inodefile-private-capacity>
                        ...

So my question is how do I get "files used" of 'maxfiles' output via SDK API?

Thanks,

Vladimir

1 ACCEPTED SOLUTION

vladimirzhigulin
4,222 Views

I ended up using "files-used" and "files-total" per "volume" basis from "volume-list-info" object to calculate "inodes free %" metric.

Vladimir

View solution in original post

5 REPLIES 5

rle
NetApp Alumni
4,222 Views

Hi Vladimir,

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.

Regards,

   - Rick -

vladimirzhigulin
4,223 Views

Hi Rick,

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

and finally

<files-total>174999984</files-total>
<files-used>146631954</files-used>

<inodefile-public-capacity>174999984</inodefile-public-capacity>

So it seems that I can definitely say that "max inodes total"  = "max files number", however it's controversial about the "files used number".

Vladimir

vladimirzhigulin
4,223 Views

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.

Thanks,

Vladimir

vladimirzhigulin
4,223 Views

Replying to my own question: the DFM alerts are based on CLI's "df -i" output.

So I need SDK call to get the same values as "df -i" generates ..

Vladimir

vladimirzhigulin
4,223 Views

I ended up using "files-used" and "files-total" per "volume" basis from "volume-list-info" object to calculate "inodes free %" metric.

Vladimir

Public