Hello team,
I use Commvault REST API to grab “Number of spare media” of tape libraries as per CV Bol motioned below so we can be notified if spare media is below the threshold that we set in the Python script.
https://documentation.commvault.com/commvault/v11_sp20/article?p=48994_1.htm
The Python script for CV rest API that I created is running fine and we are getting reports daily with all the required info that we need (e.g. library name, total/available space, SpareMedia count, etc…)
Issue:
I come across an issue where our Aux copies job stuck in queue due to lack of spareMedia and end up that is Commvault REST API doesn’t reports accurate SpareMedia Count with the request syntax that outlined in your BOL
https://documentation.commvault.com/commvault/v11_sp20/article?p=48994_1.htm
numOfSpareMedia | Tape library total number of spare media. | tapeLibSummary |
Findings:
CV BOL Rest API only returns the result at root level (tape library summary ), but the accurate SpareMedia count that I’m look for only appears from "Media By location ->Media in the library" level (attached screenshots)
If you look at my screenshots , the SpareMedia count is different between what I see in tape library summary(spare media: 12) and Media In library (Spare media: 0) :
Commcell console showsTape library summary shows we have 12 spare media
However, if go to commcell -> storage reources-> Libraries-> our tape library -> Media By Location -> Media In library (spare media : 0) , we’re running out of spareMedia.
Python - get library details Syntax as per CV BOL :
LibPropsReq = service + "Library/" + str(LibId1)
headers = {'Cookie2': token}
r = requests.get(LibPropsReq, headers=headers)
clientResp = r.text
print(clientResp)
raw output of above command
<EVGui_GetLibraryInfoWCResp><libraryInfo description="" libraryUsedForLogCaching="0" extendedAttributes="394" manufacturer="XX" storagePoolType="-1" libraryVendorId="0" model="XXX" libraryType="1" status=""><tapeLibSummary numOfCleaningMedia="2" offlineReason="N/A" numOfIESlots="0" lastDayThroughput="484.59 GB/Hr" isOnline="Yes" numOfIESlotOccupied="0" lastRestoreTime="Dec 10 2021 9:56AM" numOfActiveMedia="8" numOfSpareMedia="12" vendor="HP" numOfRegSlots="80" model="XXX" ...
custom output of above command:
HP XXXX sparemedia: 12
Questions:
What’s the CV REST API request Syntax to get “Media In Library” summary info for the tape library only so we can get more accurate information about the SpareMedia count.
I have search in CV BOL/MA, etc and it doesn’t bring any search result
thanks