Microsoft Virtualization Discussions

Getting HTTPS error using New-NaVol command

manuelsanchez
5,715 Views

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: (:) [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

1 ACCEPTED SOLUTION

timothyn
5,712 Views

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

View solution in original post

11 REPLIES 11

timothyn
5,713 Views

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

manuelsanchez
5,694 Views

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.

manuelsanchez
5,694 Views

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>

timothyn
5,694 Views

Glad that worked out for ya!

akansha_a_srivastava
5,694 Views

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.

vinith
5,694 Views

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

akansha_a_srivastava
5,694 Views

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

vinith
5,694 Views

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

akansha_a_srivastava
5,694 Views

Ya, this one I have already tried.

vinith
4,380 Views

Which version of toolkit are you using? Can you try it with the latest one here https://communities.netapp.com/docs/DOC-22259

akansha_a_srivastava
4,380 Views

NetApp Release 8.0.1 7-Mode: Wed Jan  5 17:23:51 PST 2011

Public