NetAppDocs User Guide
NetAppDocs User Guide
NetAppDocs
PowerShell Module
Jason Cole, NetApp
December 2021
Abstract
This guide is intended to provide an overview of the NetAppDocs PowerShell Module and
highlight some usage examples.
TABLE OF CONTENTS
Overview ...................................................................................................................................................... 4
Available Functions .................................................................................................................................................4
Features ....................................................................................................................................................... 5
Installation ................................................................................................................................................... 6
System Requirements .............................................................................................................................................6
Troubleshooting ........................................................................................................................................ 29
Support ...................................................................................................................................................... 29
Download ................................................................................................................................................... 29
Appendix .................................................................................................................................................... 31
APIs / CLI Commands / ASUP Sections Collected ................................................................................................31
LIST OF FIGURES
No table of figures entries found.
Available Functions
The following functions are available with the NetAppDocs PowerShell module.
The following functions are available with the NetAppDocs-Lite PowerShell module.
Features
The features available with the NetAppDocs PowerShell module are listed below.
Installation
The MSI installer package is the recommended method for installing this module at this time.
System Requirements
• Microsoft Windows
− Windows PowerShell 5.1+ or PowerShell 7.0.3+.
− Microsoft .NET Framework 4.5 or higher.
• MAC/Linux:
− PowerShell 7.0.3+ and 7.1+ (7.2+ support coming soon).
− Libgdiplus and libc6-dev packages.
• NetApp Data ONTAP PowerShell Toolkit (included in the zip file or install package).
Installation Procedure
Note: The installation procedure for the NetAppDocs-Lite package is identical to the main installation,
except for the installer file.
1. If necessary, download and install Windows PowerShell and the .Net Framework.
Note: PowerShell is installed by default in most recent Windows versions.
2. Download the latest NetAppDocs installer file (.msi).
3. Double-click on the installer file (.msi) and follow the installation screens to complete the installation.
4. Click Next.
7. Click Install.
More detailed information on any function can be shown using the Get-Help cmdlet. To display the full
help for a function, use the -Full parameter with the Get-Help function.
PS> Get-Help -Name Get-NtapClusterData
NAME
Get-NtapClusterData
SYNTAX
Get-NtapClusterData [-Name] <String[]> [-Credential <PSCredential>] [-Port <Int32>] [-Timeout
<Int32>] [-ForceSecure] [-DisablePingCheck] [-DisableAsupInvoke] [-InvokeAsup]
[<CommonParameters>]
DESCRIPTION
Uses the NetApp ONTAP PowerShell toolkit to gather as much configuration information as
possible. This
data can be used to automate build docs and health checks. It can also be used for historical
configuration information.
RELATED LINKS
https://community.netapp.com/t5/NetAppDocs/bd-p/netappdocs
Format-NtapClusterData
REMARKS
To see the examples, type: "get-help Get-NtapClusterData -examples".
For more information, type: "get-help Get-NtapClusterData -detailed".
For technical information, type: "get-help Get-NtapClusterData -full".
For online help, type: "get-help Get-NtapClusterData -online"
Additional Notes
By default, no progress or output is shown on the screen while the functions are running (errors will
always be displayed). To enable additional status output, use the -Verbose parameter on any of the
functions. As an example:
PS> Get-NtapClusterData -Name den-cdot -Verbose | Format-NtapClusterData -Verbose | Out-
NtapDocument -ExcelFile X:\den-cdot.xlsx –Verbose
Usage Examples
Live Data Collection
Perform Collection and Documentation Generation in a Single Step for all SVMs
This example gathers the SVM data for all SVMs directly from an ONTAP storage system and generates
the documents required.
PS> Get-NtapVserverData -ClusterName 'cluster1' | Format-NtapVserverData | Out-NtapDocument -
WordFile 'D:\Output\All_SVMs.docx' -ExcelFile 'D:\Output\All_SVMs.xlsx'
Perform Collection and Documentation Generation in a Single Step for Specific SVMs
This example gathers the SVM data for specific SVMs directly from an ONTAP storage system and
generates the documents required.
PS> Get-NtapVserverData -Name 'vs_nfs', 'vs_cifs' -ClusterName 'cluster1' | Format-
NtapVserverData | Out-NtapDocument -WordFile 'D:\Output\Nas_SVMs.docx' -ExcelFile
'D:\Output\Nas_SVMs.xlsx'
7-Mode
Collect in One Step (Raw XML Output) and Generate Documentation in a Second Step
This example is useful if you need to quickly gather the data from the storage system(s) and then
generate the documentation at a later time.
• Collect from multiple storage systems:
ONTAP
Collect in One Step (Raw XML Output) and Generate Documentation in a Second Step
This example is useful if you need to quickly gather the data from the storage system(s) and then
generate the documentation at a later time.
• Collect from a single storage system:
PS> Get-NtapClusterAsupData -Cluster 'den-cdot:394e82bf-485c-11e2-86b3-123478563412' | Export-
Clixml -Path 'D:\Output\den-cdot_Asup-raw.xml'
• Collect from multiple storage systems:
PS> 'cluster1:394e82bf-485c-11e2-86b3-123478563412', 'cluster2:dc1505b8-b993-11e3-9ee7-
123478563412' | ForEach-Object { $_ | Get-NtapClusterAsupData | Export-Clixml -Path
"D:\Output\$(($_ -split ':')[0])_Asup-raw.xml" }
• Generate documentation:
PS> Get-ChildItem -Path 'D:\Output' -Filter *_Asup-raw.xml | Format-NtapClusterData | Out-
NtapDocument -WordFile 'D:\Output\Site_Asup.Docx' -ExcelFile 'D:\Output\Site_Asup.xlsx'
Find the First Validated Weekly ASUP set Using Specific Dates and Perform the Data
Collection
This example highlights how to search the ASUP database using specific dates and performing the data
collection.
PS> Find-NtapClusterAsup -Cluster 'den-cdot:394e82bf-485c-11e2-86b3-123478563412' -StartDate
2014-12-01 -EndDate 2014-12-15 | Get-NtapClusterAsupData | Export-Clixml -Path 'D:\Output\den-
cdot-Asup_raw.xml'
7-Mode
Collect in One Step (Raw XML Output) and Generate Documentation in a Second Step
This example is useful if you need to quickly gather the data from the storage system(s) and then
generate the documentation at a later time.
• Collect from multiple storage systems:
PS> Get-NtapFilerAsupData -System 'mtharvard:30020945!mtmassive:30020946' | Export-Clixml -Path
'D:\Output\mtharvard-mtmassive_Asup-raw.xml'
• Generate documentation:
PS> Get-ChildItem -Path 'D:\Output\mtharvard-mtmassive_Asup-raw.xml' | Format-NtapFilerData |
Out-NtapDocument -WordFile 'D:\Output\mtharvard-mtmassive_Asup.docx' -ExcelFile
'D:\Output\mtharvard-mtmassive_Asup.xlsx'
Find the First Validated Weekly ASUP Set using Specific Dates and perform the Data
Collection
PS> Find-NtapFilerAsup -System 'mtharvard:30020945!mtmassive:30020946' -StartDate 10-15-2014 -
EndDate 11-15-2014 | Get-NtapFilerAsupData | Export-Clixml 'D:\Output\mtharvard-mtmassive_Asup-
raw.xml'
Data Sanitization
Each of the Format-Ntap*Data functions support a -SanitizeLevel parameter, allowing the use of
NetAppDocs within secure sites. The sanitization options are different depending on the system type and
are shown in the table below.
If, however, each controller or cluster has different credentials, there is a mechanism within the NetApp
Data ONTAP PowerShell Toolkit for caching those credentials. It is possible to save the credential for the
current user or for all users (-SystemScope parameter). Upon connection to a controller, the credentials
cache will be queried for an entry to the controller specified.
Note: More help on Add-NaCredential, Get-NaCredential and Remove-NaCredential (or the equivalent
Add-NcCredential, Get-NcCredential and Remove-NcCredential for ONTAP) can be found within
the help files for the Data ONTAP module. (Import-Module DataONTAP; Show-NaHelp)
Why does it seem like nothing is happening when I invoke the scripts (no status output shown)?
Answer: By default, no status output is written to the screen. As this is a PowerShell module, the best
practice is not to use Write-Host for status. My plan, moving forward, is to include a GUI front end for this
module that will provide that status output. But, in the meantime, you can specify a -Verbose to all of the
functions and you will see detailed status information.
For example:
PS> Get-NtapClusterData -Name cluster1 -Verbose
Alternatively, within your PowerShell session you can just set the $VerbosePreference to 'Continue' and
this will turn on -Verbose for every command invoked within that session.
PS> $VerbosePreference = 'Continue'
Using Windows 10, I am unable to connect to a Data ONTAP 7-Mode storage system using HTTPS.
What is the issue?
Answer: By default, the key length used when generating SSL certificates using secureadmin setup ssl in
7-Mode is 512 bits. Windows 10 no longer accepts a certificate with this key length so the HTTPS
connection fails. If using HTTP is not possible, then you must generate a new certificate using a key
length of at least 1024 bits. This shouldn't affect ONTAP, since the default key length in cDOT is 2048
bits. However, it is possible to generate a 512 bit key in cDOT so this same issue could be encountered.
I just got a warning that said the version of NetAppDocs being used to generate the
documentation is older than the version used to collect the data from the systems. Why is this a
problem? Or, I'm sure I'm using the same versions but it tells me that I am not. How can this be
possible?
Answer: Between releases, I may add to or modify the object that is created when the data is gathered off
of the systems. I try my best to be backwards compatible with previous changes but when I change the
structure during the data gathering then older versions may not be able to parse that data properly, hence
the warning message.
If you are certain you have the same versions installed, then it may be that you have another copy of an
older release somewhere else in your path that is getting imported instead of the release that you intend
to be using. To identify which version is importing and where it is installed, run the following:
PS> Import-Module -Name NetAppDocs
PS> Get-Module -Name NetAppDocs | Select-Object -Property Name, Version, ModuleBase
If the version is outdated, you can remove it from the path shown and start over with a fresh PowerShell
session.
I just got an error on the screen stating that 'An unexpected error occurred...' and then the
execution was halted. What do I do now?
Answer: We added some error handling within the code to catch any errors that are outside the Data
ONTAP PowerShell toolkit errors or any problems with the systems themselves (those types of errors are
handled specifically and, hopefully, gracefully). This typically shows up when we are performing an action
and the value is null or empty. An error is thrown and the script is terminated. These are, most definitely,
unexpected errors and we would very much appreciate you sending an email to the support staff. Usually
the fix is simple and the error message should be descriptive enough to help me identify the issue, but
only if we hear about it!
I just got a warning message stating 'Empty DataSet found so document generation not possible.
Answer: This indicates that an issue was encountered either during the data collection or during the
formatting of the data. We try to capture and display any errors that would result in no data being
processed. If no error was not presented on the screen it may be containined within the $Error variable.
You can see the contents of this variable by simply running:
PS> $Error
I just got a warning message stating 'document parameters were not specified'. What does this
mean?
Answer: The Out-NtapDocument function accepts four parameters (CustomerName, CustomerLocation,
ProjectName and AuthorName) that, when specified, will be shown on the cover page of the output
document (Excel or Word output). If you omit these parameters, the default values will be present on the
cover page and should remind you to manually fill those in. However, the proper method for manually
updating these values will depend on which type of document (Excel or Word).
The preferred way to update these documents is to simply use the Update-NtapDocument function
with the appropriate parameters.
• Word Document
To update the Word document you must modify the custom document properties (Author: File ->
Properties -> Advanced Properties / Others: File -> Properties -> Advanced Properties -> Custom).
Once updated, highlight the four relevant lines on the cover page and press the 'F9' key.
• Excel Document
Since it is not possible to use the document properties in the Excel document itself (without using
VBA code), you must modify the value directly in the cover page (replace the ' <Customer Name>'
text, for example). You may also update the document property the same way you modify it in Word.
However, this is only set in the Excel document for consistency with the Word document and you'll
still have to update the cover page directly.
When trying to generate a differences report with the Compare-NtapDocsData function I get an
error stating that the DataSets need to be formatted using at least v3.2.0 of NetAppDocs. What
does this mean?
Answer: During development for v3.2.0, many changes were made to the DataSet schemas that have
made generating differences reports against the older versions difficult. We had to make the decision to
no longer support any formatted data prior to v3.2.0. We do apologize for this inconvenience and in an
upcoming release we will be making the necessary changes in the difference report generation code to
allow for processing data from different NetAppDocs versions (still v3.2.0+ though).
Please send us a quick email to NetAppDocs Support and let us know that you have been affected by this
scenario. We have not seen significant adoption of this feature and are unsure how often a difference
report is generated over greater periods of time.
Is there really nothing I can do to get this differences report generated?
If you still have the raw files used to generate the earlier formatted data, you can use the latest
NetAppDocs version to format those files again and generate an updated formatted XML file. We added a
new -ForceOrder parameter to the Compare-NtapDocsData function for this scenario (where the 'older'
data was formatted after the most recent data was formatted). This -ForceOrder parameter would be
necessary since, by default, the function uses the timestamps the data was formatted to identify the
oldest and the newest formatted DataSets. In this scenario, the older DataSet would have the later
timestamp and so the Compare-NtapDocsData function would sort them incorrectly. You specify the
oldest DataSet using the -DataSet1 parameter, the newest DataSet using the -DataSet2 parameter and
the -ForceOrder parameter will force the sort order properly.
What are the minimum rights necessary to collect data from a NetApp storage system?
Answer: If the admin user (or a user with the role of admin) is not available for use within the
environment, a more restricted user and role can be created using the following commands:
ONTAP:
CLI
security login role create -role netappdocsrole -vserver <ClusterName> -cmddirname DEFAULT -
access readonly
security login role create -role netappdocsrole -vserver <ClusterName> -cmddirname set -access
all
security login role create -role netappdocsrole -vserver <ClusterName> -cmddirname "system node
run" -access all
PowerShell
New-NcRole -Role netappdocsrole -Vserver <ClusterName> -CommandDirectory DEFAULT -AccessLevel
readonly
7-Mode:
CLI
PowerShell
New-NaRole -Role netappdocsrole -Capabilities login-http-admin,api-*,cli-*,security-api-
vfiler,security-priv-advanced
I use the data sanitization functionality and when I generate a differences report I am seeing many
more changes than I would expect. What can I do about this?
Answer: In some tables, the columns used to uniquely identify the row is also set to be sanitized
(depending on the SanitizeLevel specified). This is necessary for some entities when they don't have a
unique UUID that can be used and we have to use the 'Name' property (for instance). Take, for example,
a volume named 'MyVolume' (this is just an example as volumes have unique UUID fields and should not
fall under this scenario). The data sanitization routines will change 'MyVolume' to a generic 'vol0001'
string to mask the actual name. In one run, however, this might be 'vol0001' and in another it might be
ONTAP
The following table contains the table names that are not present in the output documentation.
Table Names
CifsBranchCacheConfiguration IscsiTargetPortalGroups ServiceProcessorImageDetails
CifsLocalGroupMembers LoginBannerAndMotdSettings SnmpUsers
CifsLocalGroups ManagementTemplateParameters StorageQosReadAheadSettings
CifsLocalUsers ManagementTemplates SvmAdministrativeRoles
ClusterAdministrativeRoles NetgroupsFileConfiguration SvmAdministrativeUsers
ClusterAdministrativeUsers NtpServerStatus SvmAdminRoleConfigs
ClusterAdminRoleConfigs NvmeNamespaces SystemTimeSettings
FileDirSecurityPolicyTasks SasShelfConnections SystemTimeSettingsPre83
FirewallPoliciesPre83 SecurityKeyManagerStatus
The following table contains the column names that are missing from the specified tables.
ONTAP – SVM
The following table contains the table names that are not present in the output documentation.
Table Names
CifsBranchCacheConfiguration JobDefinitions StorageQosWorkloads
CifsLocalGroupMembers LoginBannerAndMotdSettings SvmAdministrativeRoles
CifsLocalGroups NetgroupsFileConfiguration SvmAdministrativeUsers
CifsLocalUsers NvmeNamespaces SvmAdminRoleConfigs
FileDirSecurityPolicyTasks SnmpUsers
IscsiTargetPortalGroups StorageQosPolicyGroups
The following table contains the column names that are missing from the specified tables.
Table Names
FpolicyConfiguration LocalGroups SasShelfConnections
LicenseV1Details LocalUsers SnapmirrorMultipathEntries
LicenseV2Details NfsNetgroupsFileConfiguration UserRoles
Table Names
DomainUsers LocalGroups SnapmirrorSchedules
FpolicyConfiguration LocalUsers UnixUsers
LdapClientSchema NameMappings UserRoles
LdapConfiguration NfsNetgroupsFileConfiguration VfilerDns
LicenseV1Details SasShelfConnections VfilerInterfaces
LicenseV2Details SnapmirrorMultipathEntries VfilerStores
The following table contains the column names that are missing from the specified tables.
Statistics Upload
By default, NetAppDocs will submit statistics back to a database for us to track usage and to help drive
future development efforts. No user information is collected. The following table lists the properties that
are sent back to the database.
While we request that you leave the statistics uploading enabled to help us with future development, if
you do need to disable this functionality you may do so by setting a variable within the PowerShell
session. To make this permanent you can add this variable into your PowerShell profile.
Troubleshooting
If the execution policy is not set correctly, an error such as the one below will be generated. To overcome
this issue, follow the steps outlined in Setting up the PowerShell Execution Policy section.
Known Issues
• (ONTAP/7-Mode) The ShelfDetails table may show MisassignedDrives. This is due to a ZAPI issue
where the shelf bay information returns duplicate DiskUids. A more accurate method of calculating
this information in those instances is yet to be obtained. This issue has been identified on only one
system.
• (All) The Visio drawings may get added to the Word document in a different order than what is shown
in the Visio file. This is due to an unresolved issue within the Aspose.Diagram product.
• (ONTAP/Vserver) CIFS Shares: If a CIFS server is status-admin down then ZAPI may or may not
return the shares for that SVM. There is no pattern to this and similar behavior is seen at the CLI. (cifs
share show returns the data, but cifs share show -instance does not).
• (ONTAP/Vserver) In the SnapMirrorRelationships table, intercluster LIFs may be missing from the
Get-NtapVserverData function whereas they will be shown if using Get-NtapClusterData | ConvertTo-
NtapVserverData. It is not clear if this is a ZAPI burt or if it is desired behavior (where the IC
SnapMirror relationships are not returned when the ZAPI is called from a Vserver context).
• (7-Mode) An error may be reported against a single node system if the cluster (cf) license is present,
or cf is disabled for an HA pair (or a more serious node-down issue). Depending on the version of
ONTAP, ZAPI may report a generic 'Internal Error'. When this happens there is no way of knowing if it
is a valid scenario where this error can be safely ignored or not. So, if you encounter this just know
that there may be valid situations where this error does not apply and can be safely ignored.
• (ONTAP/7-Mode) IPv6 sanitization might not be fully correct. The documentation only prefix
'2001:DB8::/32' was used to generate the sanitized string, yet to obtain IPv6 enabled systems to test
with. It is not clear if it is working as desired.
Support
For any additional support issues or enhancement requests, please visit the communities site
(NetAppDocs Community) or send an email to ng-NetAppDocs-support.
Download
The Windows installer (MSI) package is the recommended method for installing the module. However, a
ZIP file is also available for download.