ONTAP Discussions

nfs-connected clients show - Not real time - ontap 9.7

DONBARTON1
6,320 Views

The results of the below command are not real time.  I imagine there is a cache?  Does anyone know how this can be cleared? If it can?  Is there a plan to make this command real-time?   Having this command and it not being real-time, is not really that helpful and confuses matter in my opinion.

 

cluster1::*> nfs connected-clients show

 

1 ACCEPTED SOLUTION

parisi
6,288 Views

They are real time as of the time of connection. Meaning, if you have a client that connects and then run the command, you'll see the client in the list.

 

Otherwise, they are cached for I believe 24 hours, if the clients are not actively using the mounts. If there are keepalives or IOPS, the mount stays in the connected-clients output. I don't know of a way to flush that cache and there are no current plans to have that cache flush more often (caches save resources).

 

You can filter the command by idle time if you want more useful output.

 

For example, if you only want to see clients newer than 2.5 hours:

 

ontap9-tme-8040::*> nfs connected-clients show -node ontap9-tme-8040-0* -vserver DEMO -idle-time <2h30m

Node: ontap9-tme-8040-02
Vserver: DEMO
Data-Ip: 10.193.67.219
Client-Ip Volume-Name Protocol Idle-Time Local-Reqs Remote-Reqs
--------------- ---------------- -------- ------------- ---------- -----------
10.x.x.x dd_test__0001 nfs3 2h 15m 31s 0 8291
10.x.x.x dd_test__0002 nfs3 2h 15m 33s 0 7259
10.x.x.x dd_test__0003 nfs3 2h 20m 48s 0 9289
10.x.x.x dd_test__0004 nfs3 2h 15m 31s 0 6180
10.x.x.x dd_test__0005 nfs3 2h 20m 20s 0 10443
10.x.x.x dd_test__0006 nfs3 2h 20m 1s 0 9317
10.x.x.x dd_test__0007 nfs3 2h 20m 41s 0 7266
10.x.x.x dd_test__0008 nfs3 2h 20m 18s 0 9284
10.x.x.x scripts nfs3 2h 20m 48s 0 90
9 entries were displayed.

View solution in original post

4 REPLIES 4

parisi
6,289 Views

They are real time as of the time of connection. Meaning, if you have a client that connects and then run the command, you'll see the client in the list.

 

Otherwise, they are cached for I believe 24 hours, if the clients are not actively using the mounts. If there are keepalives or IOPS, the mount stays in the connected-clients output. I don't know of a way to flush that cache and there are no current plans to have that cache flush more often (caches save resources).

 

You can filter the command by idle time if you want more useful output.

 

For example, if you only want to see clients newer than 2.5 hours:

 

ontap9-tme-8040::*> nfs connected-clients show -node ontap9-tme-8040-0* -vserver DEMO -idle-time <2h30m

Node: ontap9-tme-8040-02
Vserver: DEMO
Data-Ip: 10.193.67.219
Client-Ip Volume-Name Protocol Idle-Time Local-Reqs Remote-Reqs
--------------- ---------------- -------- ------------- ---------- -----------
10.x.x.x dd_test__0001 nfs3 2h 15m 31s 0 8291
10.x.x.x dd_test__0002 nfs3 2h 15m 33s 0 7259
10.x.x.x dd_test__0003 nfs3 2h 20m 48s 0 9289
10.x.x.x dd_test__0004 nfs3 2h 15m 31s 0 6180
10.x.x.x dd_test__0005 nfs3 2h 20m 20s 0 10443
10.x.x.x dd_test__0006 nfs3 2h 20m 1s 0 9317
10.x.x.x dd_test__0007 nfs3 2h 20m 41s 0 7266
10.x.x.x dd_test__0008 nfs3 2h 20m 18s 0 9284
10.x.x.x scripts nfs3 2h 20m 48s 0 90
9 entries were displayed.

DONBARTON1
6,246 Views

Thanks, this was very helpful!   Especially sorting by idle time.  I will also test how long mounts are cached for.

 

I have inherited systems with a lot of legacy volumes that don't have any tracking back to a server or owner.  I really want to use this command to trace back to individual volumes and show they are not being mounted.

parisi
6,228 Views

I have a write up here with a number of other CLI tricks:

 

https://whyistheinternetbroken.wordpress.com/2015/02/16/techbecome-a-clustered-data-ontap-cli-ninja/

 

It's from 2015, but much of it still applies.

 

Connected clients will only show active mounts. If a client has not been used for a while (meaning it's mounted but never is accessed) then it won't show up in that list.

 

For example, this client has a mount to "home", but only populates the cache when I cd or run ls to it.

 

demo:/home on /mnt/home type nfs4 (rw,relatime,vers=4.1,rsize=1048576,wsize=1048576,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,clientaddr=10.x.x.x,local_lock=none,addr=10.x.x.y)

 

ontap9-tme-8040::*> nfs connected-clients show -node ontap9-tme-8040-0* -client-ip 10.x.x.x -volume home
There are no entries matching your query.

 

# cd /mnt/home
# pwd
/mnt/home

 

ontap9-tme-8040::*> nfs connected-clients show -node ontap9-tme-8040-0* -client-ip 10.x.x.x -volume home

Node: ontap9-tme-8040-02
Vserver: DEMO
Data-Ip: 10.x.x.y
Client-Ip Volume-Name Protocol Idle-Time Local-Reqs Remote-Reqs
--------------- ---------------- -------- ------------- ---------- -----------
10.x.x.x home nfs4.1 19s 2 0

tahmad
6,270 Views

The nfs connected-clients show command displays information about currently connected NFS clients, and also other NFS clients that are are currently idle but can be connected.

vserver nfs connected-clients show 

Public