I heard from Ariel Sanchez that he needed something tested. It was vDocumentation and him and Edgar Sanchez had something very cool. I want to share it with you as I think it very handy. It produces very nice reports on your vSphere environment. Lets see how to get it working and produce some reports.
The home of this project is in this GitHub location. But all the info you need is right here in this article.
- Have PowerCLI installed - preferably 11.2.0, and be in PowerCLI and execute these commands:
Install-Module ImportExcel -scope CurrentUser
Install-Module vDocumentation -scope CurrentUser
- If you have errors when executing those commands you can add -force at the end of the line.
- If you have installed this cool stuff a few weeks ago you should do:
- If you want to learn what version you have, you can use the following command:
Get-Module vDocumentation -ListAvailable | Format-List
- If you want help on one of the commands you can get it.
get-help Get-ESXSpeculativeExecution -full
- If you want to uninstall you can with :
Now connect to your vCenter (Connect-VIserver -server vcName) and execute the following commands:
Get-ESXInventory -ExportExcel -folderpath c:\
Get-ESXIODevice -ExportExcel -folderpath c:\
Get-ESXNetworking -ExportExcel -folderpath c:\
Get-ESXStorage -ExportExcel -folderpath c:\
Get-ESXPatching -ExportExcel -folderpath c:\
Get-ESXSpeculativeExecution -ExportExcel -folderpath c:\
Get-vSANInfo -ExportExcel -folderpath c:\
Storage red errors gone in version v2.4.3.
Note that there may be some red errors on the Get-ESXStorage but I can tell you they know and are working on it - confirmed that the red with the storage still occurs in my lab (still see the errors in up to and including 2.4.1).
Once the reports are done, and you look in the location where they are written too - by default - your current folder so for me c:\scripts or where you set on the command line.
Below is screenshots of each report. But only the first part, with each one you could scroll down and right in Excel. They are very detailed reports.
There you have it. With very little work, and very little config, you end up with a number of very detailed Excel spreadsheets on your vSphere environment. Very handy stuff and I sure like how easy it is to install and update!
- 11/7/18 - I got errors on storage and speculative and I am told that is due me having Chrome as default rather than IE and if I did those two on Win2K12 or Win2K16 I would not see those errors. I have yet to confirm. Now I can confirm the storage one is OK on Win2K16, but the ESXspec one still has the IE issue. I suspect due to the Win2K16 machine had a default Chrome. Background is that the dev author uses IE to download HCL stuff. Which makes sense he uses IE as that is always there.
- 11/7/18 - the error mentioned in 10.27/18 can be avoided by adding -datacenter * on the command line. That may be a default in future.
- 10/27/18 - added the uninstall info, and vSAN report option. Also, under vSphere 6.7 Update 1 I am getting an error - seen below. I have uninstalled and installed again. I am using PowerShell as an Admin. I am asking around to see what is going on.
- 6/27/19 - checked out the article with PowerCLI 11.2.0 and 2.4.7 of vDocumentation and it all worked great.
- 7/27/18 - test this with latest version of PowerShell / PowerCLI (as of today) and vSphere 6.7. Mostly worked perfect. I had an error on networking due to a Veeam created switch, and and error in patching due to no patches installed and no downloaded patches - I think that it is. But the reports all produced and look right. Maybe missing info but not much.
- 4/28/18 - red storage errors gone in 2.4.3. I used PowerCLI 10.1.0 and all was good.
- 3/25/18 - v2.41 and it works good. Some big changes - where are described in this article. My PowerShell can connect to the Internet so I did not have to download or import files. As well, I have not worked out some of the new parameters so have not updated my example commands above yet.
- 2/4/18 - added new default location above.
- 1/11/18 - and now another updated with more VMware checking for Speculative type stuff. Nice job!
- 1/9/18 - added in the GEt-ESXSpeculativeExecution option, and did some spell checking and added in the patching screen. Also added the comment about -folderpath.
- 12/16/17 - added in the new Get-ESXPatching. Still see the errors in red on storage in 2.0. I need to update the screenshots above, particularly Inventory, and add patching. Will do it soon.
- 10/18/17 - I did the Update-Module vDocumentation and there was an update. Came down fine. Here is the readme from GitHub. One thing I see I really like is that the default path is much easier and logical now - c:\users\your_user_name. I have also used this with PowerCLI 6.5.3 with no issue. If your Get-Module shows you multiple vDocumentation, then use uninstall-module vDocumentation once for each installed version, then install again and you will only have the latest. No matter how many versions you have installed, you will only execute the latest.
=== END ===
10 thoughts on “Document your vSphere environment? Yes you can!”
Hi Michael, you can check this free tool http://www.robware.net/rvtools/.It give you quite good reporting on your environment.
Thanks for reaching out. Yes, I do quite like RVtools and it is in my images. But I also like choices, and the script based ways to get documentation is pretty cool tool. I think it is very nice people like us have two ways to get reports!
This is phenomenal, thanks for sharing!
The Storage report errors if there is no local storage in an ESX server. In our case booting from Dell Dual SD cards and all datastores are SAN based. Other than that thought, these are very cool
Hi, I couldn’t retrieve patch info from hosts when i run this command:
Get-ESXPatching : Could not find any baseline(s) named Critical Host Patches*,Non-Critical Host Patches* on server vCenter1.fqdn, vCenter2.fqdn. Please check Baseline name and try again. At line:1 char:1 + Get-ESXPatching -ExportExcel -folderpath h: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-ESXPatching
I think the issue is you had no baselines attached to the cluster or hosts. My guess anyway.
Tried the latest v2.4.0, and running the Get-ESXSpeculativeExecuteion.ps1 with an input file (server is offline) I get an error - anyone seen (and fixed) this?
Get-Date : Cannot bind parameter ‘Date’. Cannot convert value “10/25/2017” to type “System.DateTime”. Error: “String was not recognized as a valid DateTime.”
At C:\Users\UserName\Documents\WindowsPowerShell\Modules\vDocumentation\2.4.0\Public\Get-ESXSpeculativeExecution.ps1:418 char:41
+ … = Get-Date (($vmhostview.Hardware.BiosInfo.ReleaseDate -split ” “)[0 …
+ CategoryInfo : InvalidArgument: (:) [Get-Date], ParameterBindingException
+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.GetDateCommand
I have not seen this error. Seems like an odd one. You should try tweeting to the authors of the vDocumentation as they are pretty darn good guys and will likely be able to help more than me.