Quantcast
Channel: ONTAP Discussions topics
Viewing all articles
Browse latest Browse all 4880

Correlate ONTAP volume name with volume address

$
0
0

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 !


Viewing all articles
Browse latest Browse all 4880

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>