Hello,
OnTap 9.12.1P11
FAS2720 & AFF-0300
PSTK : 9.14.1
Prior to our update of OnTAP our scripts to report on snapshot usage ran by simply executing the Get-NcSnapshot cmdlet.
After the upgrade, running our script our script returned errors and research shows that the PSTK checks the version of OnTap and defaults to REST-API rather than ZAPI.
Our script was quickly fixed by forcing ZAPI usage with the -ZAPICALL argument on the Connect-NcController cmdlet.
I'd prefer to use the REST-API as I can see ZAPI is now being deprecated.
Using the REST API the Get-NcSnapshot cmdlet usage changes and seems to mandate the use of the -volume argument.
I re-wrote the line in the script to loop through the list of volumes and push the results into a variable.
This is working, but it is exceptionally slow.
One volume (on SSD storage) took over 7 minutes to get a list of snapshots on the volume (there were 32 snapshots).
Another volume took over 22 minutes (again 32 snapshots and again on SSD storage). These timings were obtained by writing out to a log file.
Is there a quicker way to get this information?
Old code using ZAPI :
$snapshots = Get-NcSnapshot -controller $controller
New code using REST API:
$volumes = Get-NcVol -controller $controller
$snapshots = ForEach ($volume in $volumes){
Get-NcSnapshot -volume $volume -WarningAction SilentlyContinue
}
There is a similar article that references the changes where someone was trying to use the Get-NcSnapshot command and had issues getting the list of snapshots for their volumes (https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Powershell-Pipe-issues/td-p/445340) and I based the new code used above on the information in the article.
Thank you!