ONTAP Discussions

NFS Volume Mount Client Listing

chris_mckean
60,416 Views

Hi Guys,

probably a few times a week I get asked "what servers mount that volume" as the mount points on our linux servers are often named differently from the volumes themselves.  for example

corporate-websites-htmlt:/vol/CORPWEBSERVICES_HTML

                      41943040   2183648  39759392   6% /lamp_website_home

So everybody but myself and the other guys who deal with the storage know this volume as '/lamp_website_home' and when I raise an incident around the volume filling up they do not know what I'm talking about.  This is where the difficulty comes in.  I have no way of saying "check server 1234 as i know that currently has the volume mounted" to point them in the direction of a server currently mounting this volume. 

So the only way for them to know what volume I'm raising an incident about is by logging onto a lot of servers to see what the volume is known as in their world.  Then they can find out who owns the data in there and chat to them about clearing some out.

So I'm wondering if anyone knows any command or other way to get a lits of what IP's are currently mounting a volume via NFS?

We're currently running OnTAP 8.1.3(CMODE) and 8.2(CMODE) on our clusters.

Cheers

Chris

15 REPLIES 15

parisi
60,263 Views

In clustered Data ONTAP, there is a way to see what clients are mounted via NFS, CIFS, etc.

::*> network connections active show -service ?

  mount                       Mount stream protocol

  nfs                         NFS stream protocol

  nfs-v2                      NFS version 2 stream protocol

  nfs-v3                      NFS version 3 stream protocol

  nlm-v4                      Network lock manager stream protocol

  sm                          Session Manager stream protocol

  ftp-ctrl                    FTP control stream protocol

  ftp-data                    FTP data stream protocol

  http-1-0                    HTTP version 1 stream protocol

  http-1-1                    HTTP version 1.1 stream protocol

  iscsi                       ISCSI stream protocol

  cifs-srv                    CIFS server stream protocol

  cifs-nam                    CIFS name server stream protocol

  loopback                    loopback stream protocol

  rf                          RC stream protocol

  rawscp                      Raw secure copy stream protocol

  discard                     Descard stream protocol

  port-map                    Port map stream protocol

  pass-thru                   Passthru stream protocol

  rclopcp                     Rc connection stream protocol

  nfs-v4                      NFS version 4 stream protocol

  fcache                      Flex cache stream protocol

  ctlopcp                     Ct connection stream protocol

  rquota                      Rquota stream protocol

  cifs-msrpc                  CIFS MsRpc stream protocol

  unknown                     unknown protocol

Example:

::*> network connections active show -service nfs*

              Vserver   Interface         Remote

      CID Ctx Name      Name:Local Port   Host:Port            Protocol/Service

--------- --- --------- ----------------- -------------------- ----------------

Node: parisi-cdot-02

3461168229  4 flexvol   data2:2049        centos64.domain.win2k8.netapp.com:745

                                                               TCP/nfs

However, the above does not show you which volume is mounted. But it does help narrow it down...

To see specific information about volumes, turn on per-client stats for NFS:

::> statistics settings modify -display-rates true -client-stats enabled

Warning: System performance may be significantly impacted. Are you sure?

Do you want to continue? {y|n}: y

::> statistics show -object client

Object: client

Instance: 10.228.225.140

Start-time: 6/4/2014 14:47:08

End-time: 6/4/2014 14:47:22

Node: parisi-cdot-02

    Counter                                                     Value

    -------------------------------- --------------------------------

    hostname

                                   centos64.domain.win2k8.netapp.com

    total-ops                                                      79

    nfs3-ops                                                        0

    nfs4-ops                                                        0

    cifs-ops                                                       79

    recv-data                                                      0B

    sent-data                                                     23B

    recv-packets                                                 3916

    sent-packets                                                    0

    volumes                             flexvol:unix

flexvol:rootvol

    avg-latency                                                   0us

    nlm-ops                                                         0

    mount-ops                                                       0

    local-ops                                                       0

    remote-ops                                                     24

    avg-latency-local                                             0us

    avg-latency-remote                                            0us

danmalcor
57,646 Views

Did the connection between the client and the volume disapear in 8.3?

okieunixsam1
52,508 Views

I agree I do not see hostname or volume listed in the stats output at all.


@danmalcor wrote:

Did the connection between the client and the volume disapear in 8.3?


 

DOUGLASSIGGINS
54,878 Views

Greetings,

 

Like Dan I also do not see a way to do nfsstats by client in 8.3, coming back to cmode (Justin probably remembers me from GX) I'd assumed this part was done. Is there another option I should be looking for in ngsh (or whatever this new cmode shell is called now)?

 

 

I can however still run nperf and pcpconfig, and I dont think I have to convert hex anymore.

DPOLEARY1
47,650 Views

I too am desparate for a simple way of listing out what clients are connecting to what volumes. In 7-mode, you could look in /etc/rmtab to get a list, and although it wasn't 100% accurate (it often listed clietns after they disconnect), it was a huge help. I wouldn't think this should be that difficult to implement. On any linux box running an NFS server, I can run a "showmount -a" to get a list of clients and what nfs exports each is mounting. Migrations are very difficult when I have to take educated guesses on which clients will be affected. If anyone else has any methods of obtaining this information, please share. I'll keep searching and also post anything I find.

parisi
44,354 Views

There is currently no way to do this today. I've been leaning on engineering to include this in a future version of ONTAP.

Jim_Robertson
43,773 Views

I'm guessing this also means there is no way to tell if an NFS connection is encrypted or not?


For SMB (using OnTap 9.1), I use this command to get a lot of useful information about all the connections to my cluster:
cifs session show -fields node,vserver,lif-address,address,windows-user,auth-mechanism,shares,protocol-version,is-session-signed,smb-encryption-status


This is the closest I've been able to come to it for NFS. It shows me the servers and the LIFs they are connecting to, but I see no way to correlate this to a particular volume.

network connections active show -node * -service NFS* -fields node,cid,vserver,lif-name,local-address,local-port,remote-ip,remote-host,remote-port

 

 

Nate_Hudson
42,993 Views

Is there any update to this thread?  I've tried this process on a system running 9.1P2, and there is still no correlation between volume and hostname. 

yuvaraja
36,297 Views

nfs modify -vserver vserver_name -showmount enabled
showmount -e (filerIP)
/test1 (everyone)
/test1/qtree1 (everyone)
/test1/qtree2 (everyone)

 

showmount -a vserverIP ...check with this command once..

 

DPOLEARY1
27,534 Views

Thanks , but this does not provide a list of clients that are accessing a particular share.This just shows what exports are available. I need to be able to generate a list of clients that are currently mounting some export path (ex. /export), similar to what you would get by running "showmount -a" on a linux machine with an nfs server running.

Henrik_Aicher
26,520 Views

Hi,

if you have a 1:1 relationship between Export and Lif,

why not use:
net connections active show -lif-name <name> -inst

 

Cheers,

 

Henrik

danmalcor
26,507 Views


@Henrik_Aicher wrote:

Hi,

if you have a 1:1 relationship between Export and Lif,

why not use:
net connections active show -lif-name <name> -inst

 

Cheers,

 

Henrik


Of course having 500 LIFs has it’s own problems. 

DPOLEARY1
26,500 Views

Hi,

Thanks, but no we don't have a 1:1 relationship between exports and LIFs. I doubt that's a common configuration. On a typical system we may have 50 or so exports and mabye 5 LIFs.

 

There's still no great solution apparently. I usually have to run:

network connections active show -service nfs

which returns a list of clients. Then if I'm looking for a specific export, I run a script which goes out to every client in that list and check if it's mounting that export. It's a lot of work to gather information that should be available with a simple command imo.

Vidhs
24,475 Views

 

Just learnt that the ability to map NFS clients to specific volume and IP addresses are being introduced from ontap 9.7, something like this. As ontap 9.7 is just released, will be interesting to look into this availability :

 

cluster::> nfs connected-clients show ?
  [ -instance | -fields <fieldname>, ... ]
  [[-node] <nodename>]                                               Node Name
  [[-vserver] <vserver>]                                             Vserver
  [[-data-lif-ip] <IP Address>]                                      Data LIF IP Address
  [[-client-ip] <IP Address>]                                        Client IP Address
  [[-volume] <volume name>]                                          Volume Accessed
  [[-protocol] <Client Access Protocol>]                             Protocol Version
  [ -idle-time <[<integer>d][<integer>h][<integer>m][<integer>s]> ]  Idle Time (Sec)
  [ -local-reqs <integer> ]                                          Number of Local Reqs
  [ -remote-reqs <integer> ]                                         Number of Remote Reqs

 

Jim_Robertson
24,444 Views

@Vidhs wrote:

 

Just learnt that the ability to map NFS clients to specific volume and IP addresses are being introduced from ontap 9.7, something like this. As ontap 9.7 is just released, will be interesting to look into this availability :


Thanks, @Vidhs !

Here's a brief overview they did as part of the Tech OnTap podcast:

https://whyistheinternetbroken.wordpress.com/2019/11/08/ontap97-feature-sneak-peek-nfs-client-to-volume-mapping/

I, for one, am very glad to see that this has been added.

Public