Microsoft Virtualization Discussions

New-NcClusterLogForward generating a StackOverflowException


The following is what I am getting when using the New-NcClusterLogForward cmdlet. I am using version 4.4 of PowerShell Toolkit. The cluster is ONTAP 9.2 vSIM.


Is there a workaround or a fix for this issue that I can implement?







PS C:\Users\chrisj1> import-module dataontap
PS C:\Users\chrisj1> Connect-NcController -Name -Credential (Get-Credential)

cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:

Name                 Address           Vserver              Version
----                 -------           -------              -------
cj-cluster01.sydl...                          NetApp Release 9.2: Mon Jun 19 22:20:04 UTC 2017

PS C:\Users\chrisj1> New-NcClusterLogForward -destination -port 514
WARNING: WriteObject: object has no NcController field.

Process is terminated due to StackOverflowException.





Hi Chris,


I'm not certain what would be causing the cmdlet to crash your powershell session but here is a workaround by invoking the ZAPI.


   [Parameter(Mandatory=$True, HelpMessage="The cluster to connect to")]   
   [Parameter(Mandatory=$True, HelpMessage="The credentials for the cluster")]   
Import-Module DataONTAP
Connect-NcController -Name $Cluster -HTTPS -Credential $Credentials
$request = New-Object "System.Xml.XmlDocument"
Write-Host "Invoking the 'cluster-log-forward-create' ZAPI"                 
$response = Invoke-NcSystemApi $request

Here is an example usage:


PS C:\Scripts\PowerShell\Projects\CreateClusterLogFoward> .\CreateClusterLogFoward.ps1 -Cluster cluster2.testlab.local -Credentials $credentials

Name                 Address           Vserver              Version
----                 -------           -------              -------
cluster2.testlab....                          NetApp Release 9.1: Thu Dec 22 23:05:58 UTC 2016
Invoking the 'cluster-log-forward-create' ZAPI

destination   : wfa.testlab.local
facility      : user
force         : false
port          : 514
protocol      : udp-unencrypted
return-record : true
verify-server : false

And from the CLI it now shows the cluster log foward configuration:


cluster2::> cluster log-forwarding show

                                                Verify  Syslog
Destination Host         Port   Protocol        Server  Facility
------------------------ ------ --------------- ------  --------
wfa.testlab.local        514    udp-unencrypted false   user

Hope that helps



If this post resolved your issue, help others by selecting ACCEPT AS SOLUTION or adding a KUDO.
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner