Microsoft Virtualization Discussions
Microsoft Virtualization Discussions
I have a script that we use at several locations to set snapmirror-labels. Runs just fine on all my other systems, but here I'm getting an error on the Get-NCSnapshot command.
WARNING: Record doesn't exist
I've tried extending my timeout ($global:CurrentNCController.TimeoutMsec=600000), and that helped some, but I'm still getting this error. The system I'm connecting from is on the same subnet, and I can HTTPS or SSH into the system with no delay or issue. Running "volume snapshot show -vserver <vserver name> -volume <volume name>" via SSH runs instantly, no delay...but running "Get-NCSnapshot -vserver <vserver name> -volume <volume name>" takes forever...it will list a couple of snapshots, then give that warning message.
I'm running ONTAP 9.12.1P4, with the Powershell module version 9.13.1.2306 on Powershell 5.1, in Windows Server 2019.
Solved! See The Solution
I found a workaround fix. I added -ZapiCall to the end of my powershell call to the NetApp, and that took care of it. There must be something with the REST version of the call for Get-NCSnapshot that doesn't jive with ONTAP 9.12.1P4.
I found a workaround fix. I added -ZapiCall to the end of my powershell call to the NetApp, and that took care of it. There must be something with the REST version of the call for Get-NCSnapshot that doesn't jive with ONTAP 9.12.1P4.
Thanks for this! I'm fetching timestamps of oldest and latest snapshots for each volume with these kind of calls:
Get-NcSnapshot -volume $name | Sort-Object -Property created | Select-Object -first 1 -ExpandProperty Created
Since Get-NcSnapshot now takes like a minute for *each* snapshot, a call like that would take forever. "-ZapiCall" fixed it but I assume that just uses the old, soon to be depreciated, API so let's hope they get the PowerShell module fixed.
It also happens on ONTAP 9.10.1, but instead of the timeout I receive an error message when creating snapshots with New-NcSnapshot or querying for snapshots with Get-NcSnapshot.
Adding -ZapiCall fixed this.
Well... I have the same issue as described. Only thing is that when using -ZapiCall the "SnapmirrorLabel" attribute is $null... Then can then be "solved" using something like this:
$snaps = Get-NcSnapshot -Volume $vol -Attributes @{ "snapmirrorlabel" = ""}-ZapiCall
Then then pulls the right SnapmirrorLabel, but not much else... and I also need the "Created" attribute which for some reason I cannot get at the same time... any ideas are very welcome..
From the 9.15.1 release, a new parameter will be introduced: hydrate, which will allow Yes, No, Partial.
Yes, this is the default behaviour as it stands now. After a successful API call, it would fetch the full result.
No: will it pass?return_records=true in the REST API, and then it will display any fields ONTAP configured (usually just keys, but sometimes a few more).
Partial: it will be responsible for fetching only the important properties of the commandlet.
After introducing the hydrate feature, the timeout concerns will be fixed.