Microsoft Virtualization Discussions

Powershell Get-NCSnapshot timeout

dguinn
1,236 Views

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.

1 ACCEPTED SOLUTION

dguinn
1,158 Views

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.

 

View solution in original post

4 REPLIES 4

dguinn
1,159 Views

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.

 

ACandell
247 Views

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.

rafael-miranda
835 Views

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.

Beardmann
476 Views

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..

Public