ONTAP Discussions

Correlate ONTAP volume name with volume address

Abhishek1
1,159 Views

Hello,

 

We would like to correlate the data for volume name, volume ip  address and the owning vserver. For this we have been querying the 2 endpoints ( volume-get-iter, net-interface-get-iter )

 

Using the “volume-get-iter” we are able to get the volume name, the owning-vserver-name.

Using the “net-interface-get-iter” we are able to get the volume ip address and the owning-vserver-name. We would like to correlate this data and would like to get the information such as which ip address belongs to which volume, but unfortunately we are not finding the common data point in both endpoints output that can help us.

 

Below is the sample POC in Python I have created in order to explain the issue.

 

from NetApp import NaServer
from NetApp import NaElement
 
s = NaServer.NaServer("********", 1, 31)
s.set_server_type("FILER")
s.set_transport_type("HTTPS")
s.set_port(443)
s.set_style("LOGIN")
s.set_admin_user("******", "*******")
 
# first loop
tag = 'first'
 
while tag:
   print("----------------- Calling the volume-get-iter -------------------- ")
   api = NaElement.NaElement("volume-get-iter")
   api.child_add_string("max-records", "100")
   if tag != 'first':
       api.child_add_string("tag", tag)
 
   output = s.invoke_elem(api)
 
   volumesattributes = output.child_get('attributes-list').children_get()
   for volume in volumesattributes:
       volumename = volume.child_get('volume-id-attributes').child_get_string('name')
       vserver = volume.child_get('volume-id-attributes').child_get_string('owning-vserver-name')
       print(volumename,vserver)
   tag = output.child_get_string("next-tag")
 
   print("----------------- Calling the net-interface-get-iter -------------------- ")
  
   api2 = NaElement.NaElement("net-interface-get-iter")
   api2.child_add_string("max-records", "100")
   if tag != 'first':
       api2.child_add_string("tag", tag)
 
   output2 = s.invoke_elem(api2)
   networkattributes = output2.child_get('attributes-list').children_get()
   print(networkattributes)
   for net in networkattributes:
       address = net.child_get_string('address')
       vserver = net.child_get_string('vserver')
       print(address,vserver)
   tag = output.child_get_string("next-tag")

 

Here, for example the first print statement finds below correlation between volume name, the owning-vserver-name.

volume name

owning-vserver-name

SVM01XOXO_root

SVM0001

lun_060822909021_030419_16_vol

SVM0001

nfs95ab

SVM0001

vol1230 

cluster96n-01

 

And for example the second print statement finds below correlation between volume address, the owning-vserver-name.

 

volume address

owning-vserver-name

10.141.44.94

SVM0001

10.141.44.95

SVM0001

10.141.44.93

SVM0001

10.141.44.92

cluster96n

10.141.44.91 

cluster96n

 

 

We would like to map these volume ip addresses with the volume name but we certainly need one more common attribute in both these endpoint result’s output. Would you please suggest how this can be achieved.

Many thanks !

2 REPLIES 2

paul_stejskal
1,102 Views

A client can mount on an IP in the SVM, so you need to look at CIFS or NFS connected clients to see what IP a client is accessing in ONTAP.

parisi
1,098 Views

What exactly are you trying to accomplish here?

 

Any volume can be accessed in the SVM by the IP addresses. So mapping them to volumes doesn’t make a lot of sense. If you’re looking for data locality, there are NAS features that do this automatically. But the cluster is designed to allow access regardless of node.

 

Also if you ever start using FlexGroup, they span multiple nodes, so locality is out the window.

 

If you’re simply looking for client/volume/LIF connections and their details, use “cifs session show” and “nfs connected-clients show” (or their corresponding REST API

Public