Subscribe
Accepted Solution

Getting HTTPS error using New-NaVol command

Here is the command syntax that I am using:

New-NaVol -Name $Vol_Name -Aggregate $Aggr -Size $vol_size -SpaceReserve $Space_R -LanguageCode en_US

This command works with no issues when I use RPC connection to other controllers.

However, for those controllers in my environment where I cannot use RPC and I use HTTPS the same command does not work.

Here is the error output after running "New-NaVol" command:

New-NaVol : Could not connect to xyz.xyz.com on port 443 for protocol

HTTPS.

At C:\posh\create_lun_template.ps1:211 char:10

+ New-NaVol <<<<  -Name $Vol_Name -Aggregate $Aggr -Size $vol_size -SpaceReserv

e $Space_R -LanguageCode en_US

    + CategoryInfo          : InvalidOperation: (msp0nfas04.etdbw.com:NaContro

   ller) [New-NaVol], NaConnectionException

    + FullyQualifiedErrorId : ApiException,DataONTAP.PowerShell.SDK.Cmdlets.Vo

   lume.NewNaVol

Write-Warning : A positional parameter cannot be found that accepts argument 'n

4a2_msp0lwasq020_u01_1'.

At C:\posh\create_lun_template.ps1:213 char:20

+       Write-warning <<<<  "`n ERROR - Could not create new volume: "$Vol_Name

    + CategoryInfo          : InvalidArgument: (Smiley Happy [Write-Warning], ParameterB

   indingException

    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell

   .Commands.WriteWarningCommand

Here is my connection info:

PS C:\batch> $global:CurrentNaController | Format-List *

Ontapi             : 1.14

OntapiMajorVersion : 1

OntapiMinorVersion : 14

Version            : NetApp Release 7.3.5.1P2: Thu Mar 31 14:05:59 PDT 2011

Vfiler             :

Protocol           : HTTPS

Proxy              :

TimeoutMsec        : 10000

Name               : xyz.xyz.com

Address            : 167.19.251.18

Port               : 443

Credentials        : System.Net.NetworkCredential

ValidateIncoming   : False

ValidateOutgoing   : False

Trace              : False

Re: Getting HTTPS error using New-NaVol command

Are you sure you can connect ok via HTTPS?  Can you try a simple sequence like:

Connect-NaController xyz.xyz.com -HTTPS -Credential root
Get-NaAggr

The other possibility is that latency is high enough and/or the command is taking long enough to cause a timeout.  

The timeout defaults to 10000 (10 seconds), but you can set the timeout manually on the NaController object:

$global:CurrentNaController.TimeoutMsec = 60000

Getting HTTPS error using New-NaVol command

Hi Eric,

Yes, I am sure I am using HTTPS. Please look at the protocol line.

PS C:\batch>

PS C:\batch> $global:CurrentNaController | Format-List *

Ontapi             : 1.14

OntapiMajorVersion : 1

OntapiMinorVersion : 14

Version            : NetApp Release 7.3.5.1P2: Thu Mar 31 14:05:59 PDT 2011

Vfiler             :

Protocol           : HTTPS

Proxy              :

TimeoutMsec        : 10000

Name               : xyz.xyz.com

Address            : x.y.z.18

Port               : 443

Credentials        : System.Net.NetworkCredential

ValidateIncoming   : False

ValidateOutgoing   : False

Trace              : False

I can get the aggr list:

PS C:\batch>

PS C:\batch>

PS C:\batch>

PS C:\batch> get-NaAggr

WARNING: 3 columns do not fit into the display and were removed.

Name            State       TotalSize  Used  Available Disks RaidType RaidSize

----            -----       ---------  ----  --------- ----- -------- --------

aggr0_SAS_45... online        12.9 TB   87%     1.7 TB  40   raid_dp     20

aggr1_SAS_45... online        12.9 TB   72%     3.6 TB  40   raid_dp     20

aggr2_SAS_45... online        11.5 TB   67%     3.8 TB  36   raid_dp     20

I will increase the timeout and run the command again.

Getting HTTPS error using New-NaVol command

Hi Eric,

As you pointed out, it seems to be a timeout issue.

After increasing "$global:CurrentNaController.TimeoutMsec" value to 60000, "New-NaVol" command is NOT failing.

I will have to modify my script to increase the controller Timeout value.

Thx for your help!

PS C:\batch> $Aggr = "aggr2_SAS_450_15k"

PS C:\batch> $Vol_Name = "my_test_vol"

PS C:\batch> $vol_size = "10g"

PS C:\batch> $Space_R = "file"

PS C:\batch>

PS C:\batch> $global:CurrentNaController.TimeoutMsec = 60000

PS C:\batch>

PS C:\batch> $global:CurrentNaController | Format-List *

Ontapi             : 1.14

OntapiMajorVersion : 1

OntapiMinorVersion : 14

Version            : NetApp Release 7.3.5.1P2: Thu Mar 31 14:05:59 PDT 2011

Vfiler             :

Protocol           : HTTPS

Proxy              :

TimeoutMsec        : 60000

Name               : xyz.xyz.com

Address            : x.y.z.18

Port               : 443

Credentials        : System.Net.NetworkCredential

ValidateIncoming   : False

ValidateOutgoing   : False

Trace              : False

PS C:\batch>

PS C:\batch> New-NaVol -Name $Vol_Name -Aggregate $Aggr -Size $vol_size -SpaceRe

serve $Space_R -LanguageCode en_US

WARNING: 2 columns do not fit into the display and were removed.

Name                      State       TotalSize  Used  Available Dedupe FilesUs

                                                                             ed

----                      -----       ---------  ----  --------- ------ -------

my_test_vol               online         8.0 GB    0%     8.0 GB False      100

PS C:\batch>

Getting HTTPS error using New-NaVol command

Glad that worked out for ya!

Re: Getting HTTPS error using New-NaVol command

Hi,

I am facing the same issue but with Get-NaVol command when I am trying to run this inline command embedded with the script. It produces output very well when ran alone but gives error ith the script. I have checked the TimeOut and it has been already set to 60s. Any kind of help in this regard will be greatly appreciated.

Re: Getting HTTPS error using New-NaVol command

Can you paste the exact lines of code which you have in your script?

Re: Getting HTTPS error using New-NaVol command

Hi,

Please find the lines of code below:

     $Filer= Read-Host "Enter FAS Controller name to be connected"

     Connect-NaController $Filer -Credential $Credential | ft

     Get-NaVol -Controller $Filer | ft -AutoSize

"$Filer" variable takes user input.

This code is only a snippet from the script. The script file has to be right clicked and "Run As PowerShell".

Re: Getting HTTPS error using New-NaVol command

Can you try this?         

$Filer= Read-Host "Enter FAS Controller name to be connected"          

# When the user run this , he would get a pop up prompt to enter credentials for the controller    

Connect-NaController $Filer -Credential (Get-Credential)     

Get-NaVol | ft -AutoSize

Re: Getting HTTPS error using New-NaVol command

Ya, this one I have already tried.