Skip to content

kovarus/AsBuiltReport.VMware.vSphere

 
 

Repository files navigation

VMware vSphere As Built Report

Sample Reports

Sample Report 1 - Default Style

Sample vSphere As Built report with health checks, using default report style.

Sample vSphere Report 1

Sample Report 2 - Custom Style

Sample vSphere As Built report with health checks, using custom report style.

Sample vSphere Report 2

Getting Started

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

Supported vSphere Versions

The VMware vSphere As Built Report supports the following vSphere versions;

  • vSphere 5.0
  • vSphere 5.1
  • vSphere 5.5
  • vSphere 6.0
  • vSphere 6.5
  • vSphere 6.7

Pre-requisites

Windows PowerShell 5.1 and the following PowerShell modules are required for generating a VMware vSphere As Built report. PowerShell Core is not currently supported.

Each of these modules can be easily downloaded and installed via the PowerShell Gallery

Module Installation

Open a Windows PowerShell terminal window and install each of the required modules.

Note: VMware PowerCLI 10.0 or higher required.

install-module VMware.PowerCLI -MinimumVersion 10.0
install-module AsBuiltReport.VMware.vSphere

Required Privileges

The following role assigned privileges are required to generate a VMware vSphere As Built Report.

  • Global > Licenses
  • Global > Settings
  • Host > CIM > CIM Interaction
  • Host > Configuration > Change Settings
  • Profile-driven Storage > Profile-driven storage view
  • VMware vSphere Update Manager > View Compliance Status

Configuration

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

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

New-AsBuiltReportConfig -Report VMware.vSphere -Path <User specified folder> -Name <Optional> 

Executing this command will copy the default vSphere report JSON configuration to a user specified folder.

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

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

Report

The Report sub-schema provides configuration of the vSphere report information

Schema Sub-Schema Description
Report Name The name of the As Built Report
Report Version The report version
Report Status The report release status

Options

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

Schema Sub-Schema Setting Description
Options ShowLicenseKeys true / false Toggle to mask/unmask vSphere license keys

Masked License Key
*****-*****-*****-56YDM-AS12K

Unmasked License Key
AKLU4-PFG8M-W2D8J-56YDM-AS12K
Options ShowVMSnapshots true / false Toggle to enable/disable reporting of VM snapshots

InfoLevel

The InfoLevel sub-schema allows configuration of each section of the report at a granular level. The following sections can be set

Schema Sub-Schema Default Setting
InfoLevel vCenter 3
InfoLevel ResourcePool 3
InfoLevel Cluster 3
InfoLevel VMHost 3
InfoLevel Network 3
InfoLevel vSAN 3
InfoLevel Datastore 3
InfoLevel DSCluster 3
InfoLevel VM 2
InfoLevel VUM 3

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

Setting InfoLevel Description
0 Disabled does not collect or display any information
1 Summary** provides summarised information for a collection of objects
2 Informative provides condensed, detailed information for a collection of objects
3 Detailed provides detailed information for individual objects
4 Adv Detailed provides detailed information for individual objects, as well as information for associated objects (Hosts, Clusters, Datastores, VMs etc)
5 Comprehensive provides comprehensive information for individual objects, such as advanced configuration settings

Healthcheck

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

vCenter

The vCenter sub-schema is used to configure health checks for vCenter Server.

Schema Sub-Schema Setting Description Highlight
vCenter Mail true / false Highlights mail settings which are not configured Critical Not Configured
vCenter Licensing true / false Highlights product evaluation licenses Warning Product evaluation license in use
vCenter Alarms true / false Highlights vCenter Server alarms which are disabled Warning Alarm disabled

Cluster

The Cluster sub-schema is used to configure health checks for vSphere Clusters.

Schema Sub-Schema Setting Description Highlight
Cluster HAEnabled true / false Highlights vSphere Clusters which do not have vSphere HA enabled Warning vSphere HA disabled
Cluster HAAdmissionControl true / false Highlights vSphere Clusters which do not have vSphere HA Admission Control enabled Warning vSphere HA Admission Control disabled
Cluster HostFailureResponse true / false Highlights vSphere Clusters which have vSphere HA Failure Response set to disabled Warning vSphere HA Host Failure Response disabled
Cluster HostMonitoring true / false Highlights vSphere Clusters which do not have vSphere HA Host Monitoring enabled Warning vSphere HA Host Monitoring disabled
Cluster DatastoreOnPDL true / false Highlights vSphere Clusters which do not have Datastore on PDL enabled Warning vSphere HA Datastore on PDL disabled
Cluster DatastoreOnAPD true / false Highlights vSphere Clusters which do not have Datastore on APD enabled Warning vSphere HA Datastore on APD disabled
Cluster APDTimeOut true / false Highlights vSphere Clusters which do not have APDTimeOut enabled Warning APDTimeOut disabled
Cluster vmMonitoing true / false Highlights vSphere Clusters which do not have VM Monitoting enabled Warning VM Monitoring disabled
Cluster DRSEnabled true / false Highlights vSphere Clusters which do not have vSphere DRS enabled Warning vSphere DRS disabled
Cluster DRSAutomationLevelFullyAuto true / false Checks the vSphere DRS Automation Level is set to 'Fully Automated' Warning vSphere DRS Automation Level not set to 'Fully Automated'
Cluster PredictiveDRS true / false Highlights vSphere Clusters which do not have Predictive DRS enabled Warning Predictive DRS disabled
Cluster DRSVMHostRules true / false Highlights DRS VMHost rules which are disabled Warning DRS VMHost rule disabled
Cluster DRSRules true / false Highlights DRS rules which are disabled Warning DRS rule disabled
Cluster vSANEnabled true / false Highlights vSphere Clusters which do not have Virtual SAN enabled Warning Virtual SAN disabled
Cluster EVCEnabled true / false Highlights vSphere Clusters which do not have Enhanced vMotion Compatibility (EVC) enabled Warning vSphere EVC disabled
Cluster VUMCompliance true / false Highlights vSphere Clusters which do not comply with VMware Update Manager baselines Warning Unknown
Critical Not Compliant

VMHost

The VMHost sub-schema is used to configure health checks for VMHosts.

Schema Sub-Schema Setting Description Highlight
VMHost ConnectionState true / false Highlights VMHosts connection state Warning Maintenance
Critical Disconnected
VMHost HyperThreading true / false Highlights VMHosts which have HyperThreading disabled Warning HyperThreading disabled
VMHost ScratchLocation true / false Highlights VMHosts which are configured with the default scratch location Warning Scratch location is /tmp/scratch
VMHost IPv6 true / false Highlights VMHosts which do not have IPv6 enabled Warning IPv6 disabled
VMHost UpTimeDays true / false Highlights VMHosts with uptime days greater than 9 months Warning 9 - 12 months
Critical >12 months
VMHost Licensing true / false Highlights VMHosts which are using production evaluation licenses Warning Product evaluation license in use
VMHost SSH true / false Highlights if the SSH service is enabled Warning TSM / TSM-SSH service enabled
VMHost ESXiShell true / false Highlights if the ESXi Shell service is enabled Warning TSM / TSM-EsxiShell service enabled
VMHost NTP true / false Highlights if the NTP service has stopped or is disabled on a VMHost Critical NTP service stopped / disabled
VMHost StorageAdapter true / false Highlights storage adapters which are not 'Online' Warning Storage adapter status is 'Unknown'
Critical Storage adapter status is 'Offline'
VMHost NetworkAdapter true / false Highlights physical network adapters which are not 'Connected'
Highlights physical network adapters which are 'Down'
Critical Network adapter is 'Disconnected'
Critical Network adapter is 'Down'
VMHost LockdownMode true / false Highlights VMHosts which do not have Lockdown mode enabled Warning Lockdown Mode disabled
VMHost VUMCompliance true / false Highlights VMHosts which are not compliant with VMware Update Manager software packages Warning Unknown
Critical Incompatible

vSAN

The vSAN sub-schema is used to configure health checks for vSAN.

Schema Sub-Schema Setting Description Highlight

Datastore

The Datastore sub-schema is used to configure health checks for Datastores.

Schema Sub-Schema Setting Description Highlight
Datastore CapacityUtilization true / false Highlights datastores with storage capacity utilization over 75% Warning 75 - 90% utilized
Critical >90% utilized

DSCluster

The DSCluster sub-schema is used to configure health checks for Datastore Clusters.

Schema Sub-Schema Setting Description Highlight
DSCluster CapacityUtilization true / false Highlights datastore clusters with storage capacity utilization over 75% Warning 75 - 90% utilized
Critical >90% utilized
DSCluster SDRSAutomationLevelFullyAuto true / false Checks the Datastore Cluster SDRS Automation Level is set to 'Fully Automated' Warning Storage DRS Automation Level not set to 'Fully Automated'

VM

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

Schema Sub-Schema Setting Description Highlight
VM PowerState true / false Enables/Disables checking if the VM is powered on Warning VM is powered off
VM ConnectionState true / false Enables/Disables checking if the VM is orphaned or inaccessible Critical VM is orphaned or inaccessible
VM CpuHotAdd true / false Highlights virtual machines which have CPU Hot Add enabled Warning CPU Hot Add enabled
VM CpuHotRemove true / false Highlights virtual machines which have CPU Hot Remove enabled Warning CPU Hot Remove enabled
VM MemoryHotAdd true / false Highlights VMs which have Memory Hot Add enabled Warning Memory Hot Add enabled
VM ChangeBlockTracking true / false Highlights VMs which do not have Change Block Tracking enabled Warning Change Block Tracking disabled
VM SpbmPolicyCompliance true / false Highlights VMs which do not comply with storage based policies Warning VM storage based policy compliance is unknown
Critical VM does not comply with storage based policies
VM VMToolsStatus true / false Highlights Virtual Machines which do not have VM Tools installed, are out of date or are not running Warning VM Tools not installed, out of date or not running
VM VMSnapshots true / false Highlights Virtual Machines which have snapshots older than 7 days Warning VM Snapshot age >= 7 days
Critical VM Snapshot age >= 14 days

Examples

  • Generate HTML & Word reports with Timestamp Generate a vSphere As Built Report for vCenter Server 'vcenter-01.corp.local' using specified credentials. Export report to HTML & DOC formats. Use default report style. Append timestamp to report filename. Save reports to 'C:\Users\Tim\Documents'
New-AsBuiltReport -Target 'vcenter-01.corp.local' -Username 'administrator@vsphere.local' -Password 'VMware1!' -Report VMware.vSphere -Format Html,Word -OutputPath 'C:\Users\Tim\Documents' -Timestamp
  • Generate HTML & Text reports with Health Checks Generate a vSphere As Built Report for vCenter Server 'vcenter-01.corp.local' 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'
New-AsBuiltReport -Target 'vcenter-01.corp.local' -Credential $Creds -Report VMware.vSphere -Format Html,Text -OutputPath 'C:\Users\Tim\Documents' -EnableHealthCheck
  • Generate report with multiple vCenter Servers using Custom Style Generate a single vSphere As Built Report for vCenter Servers 'vcenter-01.corp.local' and 'vcenter-02.corp.local' 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.
New-AsBuiltReport -Target 'vcenter-01.corp.local','vcenter-02.corp.local' -Username 'administrator@vsphere.local' -Password 'VMware1!' -Report Vmware.vSphere -StylePath C:\Scripts\Styles\MyCustomStyle.ps1
  • Generate HTML & Word reports, attach and send reports via e-mail Generate a vSphere As Built Report for vCenter Server 'vcenter-01.corp.local' using specified credentials. Export report to HTML & DOC formats. Use default report style. Reports are saved to the user profile folder by default. Attach and send reports via e-mail.
New-AsBuiltReport -Target 'vcenter-01.corp.local' -Username 'administrator@vsphere.local' -Password 'VMware1!' -Report Vmware.vSphere -Format Html,Word -OutputPath C:\Users\Tim\Documents -SendEmail

Known Issues

  • Error message "Unable to determine the identity of the domain" when saving a report.

    • Issue relates to Isolated Storage and occurs when generating large reports.
    • A workaround to this issue is to run the report using PowerShell ISE.
  • In HTML documents, word-wrap of table cell contents is not working, causing the following issues;

    • Cell contents may overflow table columns
    • Tables may overflow page margin
    • PScribo Issue #83
  • In Word documents, some tables are not sized proportionately. To prevent cell overflow issues in HTML documents, most tables are auto-sized, this causes some tables to be out of proportion.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PowerShell 100.0%