#Volumes and VolumesMetric REST API understanding

1 messages · Page 1 of 1 (latest)

iron pendant
#

Hi everyone,
I'm writing python code to retrieve and analyze data using ONTAP REST API python package. I encounter behaviour that I cannot understand. I hope I am using correct terminology: if not, please correct me so we speak the same language. I'll get to the point:

I'm retrieving all the volumes with the call NetAppResource.Volume.get_collection(). Then I need data for these volumes like: bytes_read, bytes_written but also latency*, read_data and write_data for cifs, nfs etc. Right now I get this data from NetAppResource.CounterRow.get_collection("volume").

a. I understand that in the counters, inside properties, properties.name refers to the Volume name andproperties.uuidrefers to the volume id. Is this right?

  1. I have volumes with NO counters. Is this possibile? I noticed that I have no counters for volumes with no state. Is this right? But also 1 online volume with no counters. This is strange.
  2. I have counters with some volume uuid (see point a.) which I cannot find in the volumes list. How can this be?
  3. Is there a better approach/endpoint to read metrics for a specific Volume? I tried NetAppResource.VolumeMetrics.get_collection() but I always get (for what I tried at least) data with 0 values. How can this be?

I'm using netapp-ontap-9.14.1
Thank you!

iron pendant
#

--
I add a thing, I cannot understand the documentation here: https://docs.netapp.com/us-en/ontap-pcmap-9141/volume.html#table-row-ids
In the end, how should the counter row id (under the key id) should be composed? I have 4 fields, that for my understanding are:
node.name:svm.name:name(volume?):uuid(counter row id or volume id?)

lilac cipher
#

David, without knowing the full context of your code or task, this is how I would iterate over the volumes, and get their details... It is my 'impression' the get_collection() returns rather lightly loaded Volume iter, and only the subsequent get() on such iterated Volume will fill it up with more data fields... For example, this is how I would get the volume metric for every volume in the collection. Note this code is only the example and should not be used verbatim in production...

volumes = netapp_ontap.resources.Volume.get_collection(connection=connection)

for volume in volumes:
  #here, no metric in volume so we have to get it explicitly
  volume.get(fields=['metric']) #this does GET over the wire
  print(volume) #metric should be visible here, after the get

iron pendant
iron pendant
#

I still have these problems is someone can help:

  1. asking for volume information what is the meaning of a "None" state? For some volumes I don't get the state: neither online nor offline etc. What does it mean? I assume it is not an "offline" state because "offline" should be explicitly set...
  2. using the endpoint "/api/cluster/counter/tables/volumes/rows" I still get no counter for the volumes with the "None" state (see point one), and and also no counters for some online volumes. Is there a reason?
lilac cipher
#

Re 1. have you compared the API reply (state=None) versus the ontap command line volume equivalent?