Sample vSphere As Built report with health checks, using default report style.
Sample vSphere As Built report with health checks, using custom report style.
Below are the instructions on how to install, configure and generate a VMware vSphere As Built report.
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
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
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
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
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.
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 |
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 |
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 |
The Healthcheck sub-schema is used to toggle health checks on or off.
The vCenter sub-schema is used to configure health checks for vCenter Server.
The Cluster sub-schema is used to configure health checks for vSphere Clusters.
The VMHost sub-schema is used to configure health checks for VMHosts.
The vSAN sub-schema is used to configure health checks for vSAN.
Schema | Sub-Schema | Setting | Description | Highlight |
---|
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% | 75 - 90% utilized >90% utilized |
The DSCluster sub-schema is used to configure health checks for Datastore Clusters.
The VM sub-schema is used to configure health checks for virtual machines.
- 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
-
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.