AsBuiltReport / AsBuiltReport.NetApp.ONTAP

A PowerShell module to generate an as built report on the configuration of NetApp ONTAP storage arrays.
MIT License
15 stars 3 forks source link

Script ends when processing the storage section on 9.10.1P6 #22

Closed cse-gh closed 2 years ago

cse-gh commented 2 years ago

Hello,

I've run this on a 9.7 system without issue, but running against 9.10.1P6 the script exits on errors from the storage section. From my investigations I see that 9.10.1P6 is returning null values for aggr space used and raid type and this is causing the script to exit due to null values.

PS C:\asbuiltreport> $AggrSpace

Name                      State       TotalSize  Used  Available Disks RaidType        RaidSize  Volumes
----                      -----       ---------  ----  --------- ----- --------        --------  -------
HUENASCL1_01_NL_SAS_1     online        28.9 TB          28.9 TB  11                      14
HUENASCL1_02_NL_SAS_1     online        62.1 TB          59.4 TB  22                      22

For comparison, 9.7:

PS C:\asbuiltreport> $AggrSpace

Name                      State       TotalSize  Used  Available Disks RaidType        RaidSize  Volumes
----                      -----       ---------  ----  --------- ----- --------        --------  -------
aggr0_MBLBHCL1_01         online       159.9 GB   95%     7.7 GB   5   raid_dp, normal    14           1
aggr0_MBLBHCL1_02         online       159.9 GB   95%     7.7 GB   5   raid_dp, normal    14           1
MBLBHCL1_01_aggr1         online        31.8 TB   74%     8.2 TB   6   raid_dp, normal    14           4
MBLBHCL1_02_aggr1         online        31.8 TB   79%     6.6 TB   6   raid_dp, normal    14           4
rebelinux commented 2 years ago

what version of the NetApp.ONTAP modules you have installed?

Get-Module -ListAvailable Netapp.Ontap | ft -AutoSize

cse-gh commented 2 years ago
ModuleType Version     Name         ExportedCommands
---------- -------     ----         ----------------
Manifest   9.11.1.2208 NetApp.ONTAP {Connect-NaController, Invoke-NaWaflSync, Get-NaNdmpCopy, Invoke-NaNdmpCopy...}
rebelinux commented 2 years ago

At Least it works on 9.9.1:

PS /home/rebelinux> Get-NcSystemVersion

NcController Value
------------ -----
192.168.7.60 NetApp Release 9.9.1: Sun Jun 13 06:06:29 UTC 2021
PS /home/rebelinux> Get-NcAggr         

Name                      State       TotalSize  Used  Available Disks RaidType        RaidSize  Volumes
----                      -----       ---------  ----  --------- ----- --------        --------  -------
aggr0_cluster1_01         online         7.6 GB   89%   829.7 MB  12   raid_dp, normal    24           1
aggr0_cluster1_02         online         7.6 GB   89%   825.6 MB  12   raid_dp, normal    24           1
cluster1_01_SSD_1         online        57.8 GB    0%    57.8 GB  23   raid_dp, normal    24           0
cluster1_02_SSD_1         online        57.8 GB    0%    57.8 GB  23   raid_dp, normal    24           0

PS /home/rebelinux> 
PS /home/rebelinux> Get-Module -ListAvailable Netapp.Ontap | ft -AutoSize

    Directory: /home/rebelinux/.local/share/powershell/Modules

ModuleType Version     PreRelease Name         PSEdition ExportedCommands
---------- -------     ---------- ----         --------- ----------------
Manifest   9.11.1.2208            NetApp.ONTAP Desk      Add-NaHelpInfoUri

PS /home/rebelinux> 
rebelinux commented 2 years ago

It needs to be tested in 9.10+. Unfortunately I don't have access to those versions :(

cse-gh commented 2 years ago

Ok. If I leave out the storage section via the json file, it continues but throws errors on the node license checks as I think licensing has moved to the cluster, but the script continues. Do you need an OVA for ONTAP sim?

cse-gh commented 2 years ago
Get-NcLicenseEntitlementRisk : [400]: The value "entitlement" is invalid for field "fields" (<field,...>)
At C:\Program Files\WindowsPowerShell\Modules\AsBuiltReport.NetApp.ONTAP\0.6.4\Src\Private\Get-AbrOntapClusterLicense.ps1:34 char:52
+ ... ementRisk = Get-NcLicenseEntitlementRisk -Package $Licenses.Package - ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Get-NcLicenseEntitlementRisk], Exception
    + FullyQualifiedErrorId : 400,DataONTAP.C.PowerShell.SDK.Cmdlets.License.GetNcLicenseEntitlementRisk

Error for each license check for each node in the cluster.

cse-gh commented 2 years ago

And one last error near the end of the process which may have already existed.

VERBOSE: [ 10:56:04:090 ] [ Document ] - Processing blank line.
VERBOSE: [ 10:56:04:122 ] [ Document ] - Collecting ONTAP System TimeZone information.
WARNING: [ 10:56:04:516 ] [ Document ] - Cannot convert argument "value", with value: "System.Object[]", for "AddSeconds" to type "System.Double": "Cannot convert the "System.Object[]" value of type "System.Object[]" to type 
"System.Double"."
VERBOSE: [ 10:56:04:525 ] [ Document ] - Processing table 'System TimeZone - HUENASCL1'.
WARNING: [ 10:56:04:535 ] [ Document ] - Cannot bind argument to parameter 'Rows' because it is an empty collection.
VERBOSE: [ 10:56:04:781 ] [ Document ] - Processing section 'NTP Configuration' started.
VERBOSE: [ 10:56:04:816 ] [ Document ] - Collecting ONTAP System NTP information.
VERBOSE: [ 10:56:05:016 ] [ Document ] - Processing table 'System Network Time Protocol - HUENASCL1'.
VERBOSE: [ 10:56:05:038 ] [ Document ] - Processing section 'NTP Configuration' completed.
VERBOSE: [ 10:56:05:051 ] [ Document ] - Processing section 'System Timezone Configuration' completed.
VERBOSE: [ 10:56:05:068 ] [ Document ] - Processing section 'System Configuration Information' completed.
VERBOSE: [ 10:56:05:085 ] [ Document ] - Processing section 'HUENASCL1 Cluster Report' completed.
VERBOSE: [ 10:56:05:199 ] [ Document ] - Document 'NetApp ONTAP As Built Report' processing completed.
VERBOSE: [ 10:56:05:213 ] [ Document ] - Total processing time '1.71' minutes.
rebelinux commented 2 years ago

i have the 9.9.1 sim. At least i need the 9.10+ sim ova or the update images.

rebelinux commented 2 years ago

Or I can throw them on dropbox for you.

I'm fine with that

rebelinux commented 2 years ago

yep, thanks

rebelinux commented 2 years ago

I will delete the comment

cse-gh commented 2 years ago

yep, thanks

Hope that helps. Also ready to test whenever. Thanks!

rebelinux commented 2 years ago

The issue is with the latest NetApp.Ontap module and a bug in RESTAPI. Removing version 9.11.1.2208 and installing v9.10.1.2111 fix the problem

Get-Module -ListAvailable NetApp.ONTAP | Uninstall-Module -Force

Install-Module -Name NetApp.ONTAP -RequiredVersion 9.10.1.2111

PS /home/rebelinux> Get-Module -ListAvailable NetApp.ONTAP | ft -AutoSize         

    Directory: /home/rebelinux/.local/share/powershell/Modules

ModuleType Version     PreRelease Name         PSEdition ExportedCommands
---------- -------     ---------- ----         --------- ----------------
Manifest   9.10.1.2111            NetApp.ONTAP Desk      Add-NaHelpInfoUri

PS /home/rebelinux> 

After installing NetApp.Ontap v9.10.1.2111 close and reopen a new powershell console

https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/PowerShell-Toolkit-9-11-1-2208-iSCSI-command-not-working/m-p/438016#M6577

https://community.netapp.com/t5/Microsoft-Virtualization-Discussions/Add-NcCifsShare-cmdlet-error/m-p/439451

cse-gh commented 2 years ago

Confirmed. Reports for ONTAP 9.10.1P6 generate without issue using PSTK 9.10.1.2111. Thanks for looking into this.

rebelinux commented 2 years ago

Confirmed. Reports for ONTAP 9.10.1P6 generate without issue using PSTK 9.10.1.2111. Thanks for looking into this.

I have made several modifications to the report that add many new sections related to ONTAP v9.10+. If you can test them I would appreciate it.

Get-Module -ListAvailable AsBuiltReport.NetApp.ONTAP | Update-Module -Force

cse-gh commented 2 years ago

Sticking with PSTK 9.10.1.2111 I assume due to that REST bug.

cse-gh commented 2 years ago

9.11.1.2208 was re-installed automatically when I updated the asbuiltreport module. Uninstalling but error says 9.11.1.2208 is required for asbuiltreport.

rebelinux commented 2 years ago

Weird because I set the required module to v9.10.1.2111

Screenshot_20221107_130109

Either way It should work with v9.11.1.2208 on latest report version.

cse-gh commented 2 years ago

Yeah, I had removed 9.11.1 for the original issue above, but after upgrading asbuiltreport to 0.6.5 9.11.1 was back on my machine.

Anyway, running tests now using 9.11.1.2208. 9.10.1.2111 removed from machine before staring tests.

cse-gh commented 2 years ago

Tests: Generated new AsBuiltReprot.NetApp.ONTAP.json and set all InfoLevel options to “2” Using PSTK: 9.11.1.2208 Tested cluster: 9.7P6: Successful, no errors Tested cluster: 9.10.1P6: Successful, no errors

Reviewed reports. Am not sure I’m noticing any new sections, or perhaps these clusters aren’t using what the new sections are checking for. No consistency groups, for example.

rebelinux commented 2 years ago

thanks for your help!