#PowerShell Toolkit ASAr2 -- 400 Responses

1 messages · Page 1 of 1 (latest)

vocal galleon
#

Doing some testing / validation of some pieces of basic build scripts and we have on AFF/FAS systems with ASAr2 in LOD and the and I'm getting mixed results.

Using the PSTK (9.16.1.2501) on PS5 or PS7
LOD appears to be running:
NetApp Release Cloudstream__9.16.1: Mon Nov 04 05:51:46 UTC 2024

The errors are usually a 400, which tells me it's something with the payload .. but I haven't been able to pin down what it is. Curious if anyone else has run into the same / can give me any pointers.

Some examples:

#

`$cluster = "LAB"
$list = @('SVM1','SVM2','SVM3')
$nodes = Get-NcNode
$domain = 'TEST'
$ports = @('0a','0b')

Good

foreach ($app in $list) {
New-NcVserver -Name ($cluster+"-"+$app)
}

Good

foreach ($app in $list){
New-NcPortSet -Name ($domain+"A") -Protocol fcp -VserverContext ($cluster+"-"+$app)
}

Fail

foreach ($node in $nodes) {
foreach ($app in $list) {
foreach ($port in $ports) {
New-NcNetInterface -Name ("$app"+"FCLIF"+(($node.Node) -split '-')[1]+""+$port).ToUpper() -Vserver ($cluster+"-"+$app) -node $node.Node -Port $port -DataProtocols fcp
Add-NcPortSetPort -Name ($domain+"A") -VserverContext ($cluster+"-"+$app) -Port ("$app"+"FCLIF"+(($node.Node) -split '-')[1]+"
"+$port).ToUpper()
}
}
}`

`Example:
PS C:\Users\Administrator.DEMO> New-NcNetInterface -Name ("$app"+"FCLIF"+(($node.Node) -split '-')[1]+"_"+$port).ToUpper() -Vserver ($cluster+"-"+$app) -node $node.Node -Port $port -DataProtocols fcp
New-NcNetInterface : [400]: "0b" is an invalid value for field "location.home_port.name" (<netport>)
At line:1 char:1

  • New-NcNetInterface -Name ("$app"+"FCLIF"+(($node.Node) -split '-')[ ...
  •   + CategoryInfo          : InvalidOperation: (:) [New-NcNetInterface], Exception
      + FullyQualifiedErrorId : 400,DataONTAP.C.PowerShell.SDK.Cmdlets.Net.NewNcNetInterface`
    
    

LUN Creation Example: PS C:\Users\Administrator.DEMO> $svm.name svm1 PS C:\Users\Administrator.DEMO> $svm.uuid 9b361799-b31e-11ef-81e1-005056b0cea0 PS C:\Users\Administrator.DEMO> New-NcLun -VserverContext $svm.name -Path ps_test_lun -OsType windows -size 2gb New-NcLun: [400]: Either "svm.uuid" or "svm.name" must be provided. PS C:\Users\Administrator.DEMO> New-NcLun -VserverContext $svm.uuid -Path ps_test_lun -OsType windows -size 2gb New-NcLun: [400]: Either "svm.uuid" or "svm.name" must be provided.

dusky flower
#

Hello from Lab on Demand!
The error message seems unfounded when the syntax explicitly contains the data.
Here's a quick data collection plan that's you can tweak to your situation:

Start-Transcript # Take note of where this is saving
Set-NaToolkitConfiguration -LogLevel DEBUG
Get-NaToolkitConfiguration
# reproduce issue

Email transcript data to ng-ontap-pstk-queries@netapp.com and ng-ontap-pstk-rest@netapp.com
In the mean time you can probably tack on the -UseZAPI parameter.

#

In the email, include the ONTAP version and model, you could include the cluster UUID up front too in case the engineer wants to see anything from the cluster autosupports.

vocal galleon
#

Ok.. I'll start collecting some stuff and send it over

I've used '-UseZAPI' on traditional AFF/FAS instances where REST was giving me fits, but ZAPI is disabled on ASAr2

dusky flower
#

Oh, shoot, I forgot about that... ummm......

vocal galleon
#

Took a first pass at New-NcLun in PS7 with all that enabled and the transcript was pretty bland... really just has the same 400 error I got on the pipeline

dusky flower
#

I'd keep that one, then maybe do another with Set-PSDebug -Trace 2

#

and provide both transcripts. and do a little spot check to make sure the transcript is capturing everything...

vocal galleon
#

Yep, will do... thanks for the guidance and contacts