Git Product home page Git Product logo

asbuiltreport.nutanix.prismelement's Introduction

Buy Me a Coffee at ko-fi.com

Nutanix Prism Element As Built Report

๐Ÿ“š Sample Reports

Sample Report - Default Style

Sample Nutanix Prism Element As Built Report with health checks, using default report style.

Sample Nutanix Prism Element As Built Report

Sample Nutanix Prism Element As Built Report HTML file: Sample Nutanix Prism Element As Built Report.html

๐Ÿ”ฐ Getting Started

Below are the instructions on how to install, configure and generate a Nutanix Prism As Built report.

๐Ÿ’พ Supported Versions

Prism / AOS

The Nutanix Prism Element As Built Report supports the following AOS versions;

  • AOS 5.x
  • AOS 6.x

PowerShell

This report is compatible with the following PowerShell versions;

Windows PowerShell 5.1 PowerShell 7
โœ… โœ…

๐Ÿ”ง System Requirements

Each of the following modules will be automatically installed by following the module installation procedure.

These modules may also be manually installed.

Module Name Minimum Required Version PS Gallery GitHub
PScribo 0.10.0 Link Link
AsBuiltReport.Core 1.2.0 Link Link

๐Ÿ” Required Privileges

A user with Prism Cluster Admin privileges is required to generate a Nutanix Prism Element As Built Report.

๐Ÿ“ฆ Module Installation

PowerShell

Open a PowerShell terminal window and install the required modules as follows;

install-module -Name AsBuiltReport.Nutanix.PrismElement

GitHub

If you are unable to use the PowerShell Gallery, you can still install the module manually. Ensure you repeat the following steps for the system requirements also.

  1. Download the latest release zip from GitHub
  2. Extract the zip file
  3. Copy the folder AsBuiltReport.Nutanix.PrismElement to a path that is set in $env:PSModulePath. By default this could be C:\Program Files\WindowsPowerShell\Modules or C:\Users\<user>\Documents\WindowsPowerShell\Modules
  4. Open a PowerShell terminal window and unblock the downloaded files with
    $path = (Get-Module -Name AsBuiltReport.Nutanix.PrismElement -ListAvailable).ModuleBase; Unblock-File -Path $path\*.psd1; Unblock-File -Path $path\Src\Public\*.ps1; Unblock-File -Path $path\Src\Private\*.ps1
  5. Close and reopen the PowerShell terminal window.

Note: You are not limited to installing the module to those example paths, you can add a new entry to the environment variable PSModulePath if you want to use another path.

โœ๏ธ Configuration

The Nutanix Prism As Built Report utilises a JSON file to allow configuration of report information, options, detail and healthchecks.

A Nutanix Prism report configuration file can be generated by executing the following command;

New-AsBuiltReportConfig -Report Nutanix.PrismElement -FolderPath <User specified folder> -Filename <Optional>

Executing this command will copy the default Nutanix Prism report configuration file to a user specified folder.

All report settings can then be configured via the report configuration file.

The following provides information of how to configure each schema within the report's configuration file.

Report

The Report schema provides configuration of the Nutanix Prism report information

Sub-Schema Setting Default Description
Name User defined Nutanix Prism Element As Built Report The name of the As Built Report
Version User defined 1.0 The report version
Status User defined Released The report release status
ShowCoverPageImage true / false true Toggle to enable/disable the display of the cover page image
ShowHeaderFooter true / false true Toggle to enable/disable document headers & footers
ShowTableCaptions true / false true Toggle to enable/disable table captions/numbering

Options

The Options schema allows certain options within the report to be toggled on or off.

There are currently no options defined for this report.

InfoLevel

The InfoLevel schema allows configuration of each section of the report at a granular level.

There are 4 levels (0-3) of detail granularity for each section as follows;

Setting InfoLevel Description
0 Disabled Does not collect or display any information
1 Enabled / Summary Provides summarised information for a collection of objects
2 Detailed Provides detailed information for a collection of objects
3 Adv Detailed Provides detailed information for individual objects, as well as information for associated objects (Disks, VM Disks, VM NICs etc)
4 Comprehensive Provides comprehensive information for individual objects

The table below outlines the default and maximum InfoLevel settings for each section.

Sub-Schema Default Setting Maximum Setting
Cluster 1 1
System 2 4
Hosts 2 3
Storage 2 3
VM 2 3
DataProtection 2 3

Healthcheck

The Healthcheck schema is used to toggle health checks on or off.

Cluster

The Cluster schema is used to configure health checks for the Nutanix cluster.

Sub-Schema Setting Default Description Highlight
Timezone true/false false Enables/Disables the timezone setting health check
TimezoneSetting User Defined UTC Checks the configured timezone for the Nutanix cluster Warning Not compliant with user defined setting
DataResiliency true/false true Checks the data resiliency status of the Nutanix cluster OK Data relisency status is possible
Critical Data relisency status is not possible

CVM

The CVM schema is used to configure health checks for the Nutanix Controller Virtual Machine (CVM).

Sub-Schema Setting Default Description Highlight
PowerState true/false true Highlights if the CVM is powered off Warning CVM is powered off

System

The System schema is used to configure health checks for the entire system.

Sub-Schema Setting Default Description Highlight
ImageState true/false false Highlights images which are in an inactive state Warning Image is in an inactive state
Licensing true/false true Highlights if no license is applied to the cluster Warning No license is applied to the cluster

Hardware

The Hardware schema is used to configure health checks for Nutanix hardware.

Sub-Schema Setting Default Description Highlight
DiskStatus true/false true Highlights disks where their status is not normal Critical Disk status is not normal
DiskMode true/false true Highlights disks which are offline Critical Disk mode is offline

Storage

The Storage schema is used to configure health checks for Nutanix storage containers.

Sub-Schema Setting Default Description Highlight
Compression true/false false Highlights storage containers which do not have compression enabled Warning Compression is disabled
CacheDedupe true/false false Highlights storage containers which do not have cache deduplication enabled Warning Cache deduplication is disabled
CapacityDedupe true/false false Highlights storage containers which do not have capacity deduplication enabled Warning Capacity deduplication is disabled
ErasureCoding true/false false Highlights storage containers which do not have erasure coding enabled Warning Erasure coding is disabled

VM

The VM schema is used to configure health checks for virtual machines.

Sub-Schema Setting Default Description Highlight
PowerState true/false true Highlights VMs which are powered off Warning VM is powered off
NicConnectionState true/false true Highlights VM NICs which are disconnected Warning VM NIC is disconnected

DataProtection

The DataProtection schema is used to configure health checks for Nutanix data protection.

Sub-Schema Setting Default Description Highlight
CompressOnWire true/false false Highlights if line compression is disabled Warning Line compression is disabled
BandwidthThrottling true/false false Highlights if bandwidth throttling is disabled Warning Bandwidth throttling is disabled
Proxy true/false false Highlights if proxy setting is disabled Warning Proxy setting is disabled

๐Ÿ’ป Examples

# Generate a Nutanix Prism Element As Built Report for Nutanix cluster '172.16.30.110' using specified credentials. Export report to HTML & DOCX formats. Use default report style. Append timestamp to report filename. Save reports to 'C:\Users\Tim\Documents'
PS C:\> New-AsBuiltReport -Report Nutanix.PrismElement -Target '172.16.30.110' -Username 'admin' -Password 'nutanix/4u' -Format Html,Word -OutputFolderPath 'C:\Users\Tim\Documents' -Timestamp

# Generate a Nutanix Prism Element As Built Report for Nutanix cluster '172.16.30.110' using specified credentials and report configuration file. Export report to Text, HTML & DOCX formats. Use default report style. Save reports to 'C:\Users\Tim\Documents'. Display verbose messages to the console.
PS C:\> New-AsBuiltReport -Report Nutanix.PrismElement -Target '172.16.30.110' -Username 'admin' -Password 'nutanix/4u' -Format Text,Html,Word -OutputFolderPath 'C:\Users\Tim\Documents' -Verbose

# Generate a Nutanix Prism Element As Built Report for Nutanix cluster '172.16.30.110' using stored credentials. Export report to HTML & Text formats. Use default report style. Highlight environment issues within the report. Save reports to 'C:\Users\Tim\Documents'.
PS C:\> $Creds = Get-Credential
PS C:\> New-AsBuiltReport -Report Nutanix.PrismElement -Target '172.16.30.110' -Credential $Creds -Format Html,Text -OutputFolderPath 'C:\Users\Tim\Documents' -EnableHealthCheck

# Generate a single Nutanix Prism Element As Built Report for Nutanix clusters '172.16.30.110' and '172.16.30.130' using specified credentials. Report exports to WORD format by default. Apply custom style to the report. Reports are saved to the user profile folder by default.
PS C:\> New-AsBuiltReport -Report Nutanix.PrismElement -Target '172.16.30.110','172.16.30.130' -Username 'admin' -Password 'nutanix/4u' -StyleFilePath 'C:\Scripts\Styles\MyCustomStyle.ps1'

# Generate a Nutanix Prism Element As Built Report for Nutanix cluster '172.16.30.110' using specified credentials. Export report to HTML & DOCX formats. Use default report style. Reports are saved to the user profile folder by default. Attach and send reports via e-mail.
PS C:\> New-AsBuiltReport -Report Nutanix.PrismElement -Target '172.16.30.110' -Username 'admin' -Password 'nutanix/4u' -Format Html,Word -OutputFolderPath 'C:\Users\Tim\Documents' -SendEmail

asbuiltreport.nutanix.prismelement's People

Contributors

tpcarman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

asbuiltreport.nutanix.prismelement's Issues

Nutanix report errors with word or html

Describe the bug
I ran the Nutanix as build report for the first time on two different clusters and got the exact error.
New-AsBuiltReport : Cannot bind argument to parameter 'Name' because it is an empty string.
At line:1 char:1

  • New-AsBuiltReport -Report Nutanix.PrismElement -Target '10.11.65.10' ...

Screenshot
Nutanix error

Desktop (please complete the following information):

  • OS: [Windows 2016]
  • Browser [e.g. chrome, safari]
  • powershell Version [5.1.14393.4583]
  • AOS 5.20.1.1 and 5.15.6

IP address Report

Is your feature request related to a problem? Please describe.
It is always important to know the current usage of IP addressing in subnets. Collecting information can be difficult.

Describe the solution you'd like
It would be really useful to have an IP address Report as part of the export. This would allow for easy input into a IPAM, spread sheet, DB, etc. The idea would be to have this in a list of individual IPs. So each IP address would be on a line/row of its own.
Maybe the columns would be something like below.
IP(v4/v6),VMName,vNIC,VLAN#,SubnetName,IPAMMethod,vSwitch,Node/Host,Cluster,Location

Describe alternatives you've considered
Writing my own script to do the same thing but this is a nice solution and would benefit others so coding in a vacuum is not ideal.

Additional context
None

Nutanix Licensing API Bug with AOS 6.5.3 causes script to fail

Describe the bug
In certain conditions on AOS 6.5.3, Licensing in the API reflects starter and not fully licensed.
This causes the script to fail with error "You cannot call a method on a none valued expression" when processing Licensing region beginning at line 425 of Invoke-AsBuiltRreport.Nutanix.PrismElement.ps1.

The specific failure is when ($NtnxLicense.category).Replace('_',' ') is called on line 433 as the object is null and has no methods

To Reproduce
Steps to reproduce the behavior:

  1. Validate AOS version is 6.5.3
  2. In Prism check licensing, if starter license is installed even if Pro is also installed this will trigger the API bug
  3. Run New-AsBuiltReport for Nutanix with -Verbose
  4. See error

Expected behavior
The script looks for information in the object retrieved from the API called licenseDTO. In the fault condition this is null and information is in a different object called licenseInfoDTO which has a different structure.

Screenshots!
image

Desktop (please complete the following information):

  • OS: Windows Server 2019
  • Powershell
  • Version 5.1 and 7

Additional context
This was tested against AOS 6.5.7 on another cluster and the script ran without issue.
Commenting out lines 425 to 483 in Invoke-AsBuiltRreport.Nutanix.PrismElement.ps1. is a work around to let the script continue to run.

Issues with script

Describe the bug
While attempting to run the Nutanix Element script, against a single or multiple PEs, with either admin creds, or AD creds, I get the following error without any files being created:

New-AsBuiltReport : Cannot bind argument to parameter 'Rows' because it is an empty collection.
At line:1 char:1

  • New-AsBuiltReport -Report Nutanix.PrismElement -Target 10.11.6.10 -Cr ...
  •   + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
      + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-AsBuiltRepor
    
    

To Reproduce
I'm using the following to run the script: New-AsBuiltReport -Report Nutanix.PrismElement -Target 10.11.6.10 -Credential (Get-Credential) -Format HTML,Word -OutputPath 'd:\scripts\asbuilt' -TimeStamp -Verbose

Expected behavior
expect it to finish the run without errors and produce the files.

Screenshots
Screenshot attached
image

Desktop (please complete the following information):

  • OS: Windows 10, Powershell as admin
  • Nutanix AOS 5.15.5.1 LTS

New-AsBuiltReport : The remote server returned an error: (412) Precondition Failed

*** Bug Description ***
Receiving the following error when trying to run New-AsBuiltReport against a Nutanix cluster:

New-AsBuiltReport : The remote server returned an error: (412) Precondition Failed.
At line:1 char:1
+ New-AsBuiltReport -Report Nutanix.PrismElement -Target 10.118.17.30 - ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,New-AsBuiltReport

*** To Reproduce (Method 1) ***
Steps to reproduce the behavior:

  1. Open PowerShell (standard user or Administrator)
  2. Run: $nxUser = "<Nutanix Username>"
  3. Run: $nxPassword = ConvertTo-SecureString "<Nutanix Password>" -AsPlainText -Force
  4. Run: $nxCredentials = New-Object System.Management.Automation.PSCredential ( $nxUser, $nxPassword )
  5. Run: New-AsBuiltReport -Report Nutanix.PrismElement -Target <Nutanix Prism Element Cluster VIP> -Credential $nxCredentials -Format Word -Orientation Portrait -OutputPath 'C:\!Incoming\'
  6. Process requested information prompts
  7. See error

*** To Reproduce (Method 2) ***
Steps to reproduce the behavior:

  1. Open PowerShell (standard user or Administrator)
  2. Run: New-AsBuiltReport -Report Nutanix.PrismElement -Target <Nutanix Prism Element Cluster VIP> -Username '<Nutanix Username>' -Password '<Nutanix Password>' -Format Word -Orientation Portrait -OutputPath 'C:\!Incoming\'
  3. Process requested information prompts
  4. See error

Expected behavior
Expecting As Built Report to be generated at 'C:!Incoming'

Screenshots
If applicable, add screenshots to help explain your problem.

*** Environment Information ***

  • OS Version(s): Windows 10 Enterprise 1909, Windows Server 2016 Standard
  • PowerShell Version(s): 5.1.18362.628, 5.1.14393.3471
  • Nutanix Cmdlets Version: 2.1.2
  • Nutanix AOS Version: 5.10.9.1 LTS
  • Browser Version: N/A
  • Module Version (AsBuiltReport.Core): 1.0.3
  • Module Version (AsBuiltReport.Nutanix.PrismElement): 0.1.0
  • PSSnapin Version (NutanixCmdletsPSSnapin): 5.1

*** Additional Context ***

  • Nutanix Prism Element user is 'admin', with full cluster and user rights to target cluster
  • Nutanix Prism Element login has been tested successfully with the standard Nutanix Cmdlets PSSnapin, running Connect-NTNXCluster -Server 10.118.17.30 -Password $nxPassword -UserName admin -AcceptInvalidSSLCerts
  • The above issue has been reproduced over VPN and on local server via RDP

You cannot call a method on a null-valued expression

Describe the bug
VERBOSE: [ 09:29:39:222 ] [ Document ] - Processing section 'Licensing' started.
New-AsBuiltReport: You cannot call a method on a null-valued expression.

Expected behavior
when i launch the script, with admin right on Prism Element, Ip and user admin - password correct.. always this error message.. when the script Process the section 'Licensing' apparently
always at this moment, at this check

Screenshots
Untitled

Desktop (please complete the following information):

  • OS: AOS 6.0.7.6 STS - PC 2023.4 - ahv 8-20230302
  • Powershell :
    PSVersion 7.4.2
    PSEdition Core
    GitCommitId 7.4.2
    OS Microsoft Windows 10.0.19045
    Platform Win32NT
    PSCompatibleVersions {1.0, 2.0, 3.0, 4.0โ€ฆ}
    PSRemotingProtocolVersion 2.3
    SerializationVersion 1.1.0.1
    WSManStackVersion 3.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.