Microsoft Virtualization Discussions

SSL issues using -controller argument with ONTAP PowerShell

dearmon

So, I'm having an issue that I'm hoping is a simple fix, but am not having any luck getting it resolved.  When using the DataONTAP PowerShell to do simple stuff like get-naVol, I have to do a connect-nacontroller first every time, instead of just being able to specify -controller in the arguments for the command.  If I do use -controller, I get something like this:

PS X:\powershell> get-nasnapmirror -Controller xxxfiler
Get-NaSnapmirror : Could not connect to xxxfiler on port 443 for protocol HTTPS.
At line:1 char:17
+ get-nasnapmirror <<<<  -Controller xxxfiler
    + CategoryInfo          : InvalidOperation: (NetApp.Ontapi.Filer.NaController:NaController) [Get-NaSnapmirror], NaConnectionSSLException
    + FullyQualifiedErrorId : ApiException,DataONTAP.PowerShell.SDK.Cmdlets.Snapmirror.GetNaSnapmirror


SSL is *NOT* enabled on the filers here.  Enabling it isn't an option at present.  How can I force PowerShell to use RPC to make these requests?  if I connect to the filer first, it works fine (like this) and uses RPC:

PS X:\powershell> connect-nacontroller xxxfiler

OntapiMajorVersion : 1
OntapiMinorVersion : 7
Protocol           : RPC
Vfiler             :
Name               : xxxfiler
Address            : xxx.xxx.xxx.xxx
Port               : 0
Credentials        :
ValidateIncoming   : False
ValidateOutgoing   : False
Trace              : False
PS X:\powershell> get-nasnapmirror

BaseSnapshot         : xxx-filer(0000000000)_xxxfiler_maillogs1.1820
Contents             : -
CurrentTransferError :
CurrentTransferType  :
DestinationLocation  : xxx-filer:xxxfiler_maillogs1
LagTime              : 10741
LastTransferDuration : 1682
LastTransferFrom     : -
LastTransferSize     : 769868
LastTransferType     : -
MirrorTimestamp      : 1286406160
SourceLocation       : xxxfiler:maillogs1
State                : source
Status               : idle
TransferProgress     : 0
-----------output cut off --------------
1 REPLY 1

cknight

Hello, dearmon.

The value passed to a Toolkit cmdlet's -Controller parameter is of type NaController (the type returned by Connect-NaController), not System.String.  So here are the typical usage examples for RPC connections:

1. Pre-connect

Connect-NaController xxxfiler

Get-NaSnapmirror

2. Save the value

$xxxfiler = Connect-NaController xxxfiler

Get-NaSnapmirror -Controller $xxxfiler

3. All together


Get-NaSnapmirror -Controller (Connect-NaController xxxfiler)

All of these work with HTTP/HTTPS connections as well, given the needed -Credentials parameter to Connect-NaController.

Announcements
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
Public