VMware vCenter Documentation Script Version 1.0

One of the last (and sometimes most painful) steps in most deployment or upgrade projects is the documentation step. Producing usable, accurate documentation can be difficult but it is one of the most important steps in every technology project – the larger the environment, the more important the documentation.

VMware vSphere is one of the most powerful, efficient, secure and robust x86 server virtualization platforms available today. It allows the enterprise to consolidate server and desktop workloads while being highly available and maintaining the highest levels of security and scalability.

Announcing the VMware vSphere PowerShell Documentation Script!

In previous deployments of VMware products (and many other products, really), I had used a few tools to generate some form of documentation, but for the most part, the end customer deliverable was completed by hand.

Enter Carl Webster and his XenApp documentation script. All it required was the XenApp SDK and voila! A beautifully formatted Word document that outlined the entire XenApp farm – all by running a single PowerShell script.

All of my past scripting had been in VBScript, and I knew that times were changing and everything was going the way of PowerShell – change is difficult. I forced myself to try to learn a bit of PowerShell here and there, but didn’t quite have it down like I wanted to. I was looking for an opportunity to solidify my PowerShell knowledge and get away from that “archaic” VBScript – this is that opportunity.

Carl not only provided the ‘Webster Documentation Framework’ that this script uses but has been a HUGE help in getting this done – not to mention the several others that helped with the Framework itself. That being said, this script will be housed on carlwebster.com in the documentation scripts repository.

I will tell you that there is a TON of information, configuration, and settings found in vCenter, the hosts, datastores, networks, VMs…the list goes on. This documentation is what I and others feel are a good collection of settings that are important and need to be documented. I’m sure there are more – and if you’d like for them to be added to the script, just leave a comment!

Here’s What You Get

The following items are documented in the default run mode:

  • vCenter Summary
    • Cluster, host and datastore summary
  • Basic vCenter Server settings
    • DSN information
    • SMTP settings
    • Statistics levels
    • Licensing
  • Clusters
    • HA configuration
    • DRS configuration
    • Hosts in the cluster
  • Resource Polls
    • Settings
    • VMs in the resource pool
  • Hosts
    • Hardware configuration
    • Key service status
The following items are documented in the full run mode:
  • All items in the default run mode
  • Host networking
    • Adapter settings
  • Standard vSwitching
    • vSwitch settings
    • VMs plugged in to the vSwitch
  • Distributed vSwitching
    • vSwitch settings
    • VMs plugged in to the vSwitch
  • Datastores
    • Datastore settings
    • Hosts connected to the datastore
  • Virtual Machines
    • VM settings

The Word output looks like this:

What You Need

  • The script (available here)
  • PowerShell v3 or higher
  • PowerCLI v5.1 or higher (available here)
  • vCenter Server 5.x (Windows or VSA)
  • Microsoft Word for Word and PDF files
  • Credentials with read access to all objects in vCenter
  • Use the command line argument -VIServerName vCenterServerHere to specify your vCenter server – otherwise, the script will prompt for it
  • If you are running the script with an account that has credentials to the vCenter server, you will not be prompted and PowerCLI will use your session credentials – otherwise the script will prompt for credentials
  • If you run the script from a workstation and user account that has remote registry permissions to a Windows vCenter server, the DSN will be included in the report. The VSA does not have this capability currently.
Depending on the size of your environment, this script can take A LONG TIME to run. By default, the script will run in ‘summary mode’ (see above) but if you need to run in ‘full mode’ to gather more data, it will take EVEN LONGER. Why does it take so long especially in Full mode? The Word output is generating a beautifully formatted table in Word for every single Host, Network, vSwitch, VM…you get the idea. How can you speed up the execution time? Running the script in -Text mode will run much faster. Alternatively, if you are running Windows 8.1, you can use PowerShell v5 which has shown improvements of up to 80% (WMF\PS5 available here)
Where to Get the Script
The VMware Inventory script is stored in Carl Webster’s documentation script repository – http://carlwebster.com/where-to-get-copies-of-the-documentation-scripts/ There are a ton of other scripts to document Citrix XenApp, Microsoft DHCP, and many others.
What’s Next?
There are several things planned for Version 2 of the script including an “issues” page with things like datastore\VM mismatch, high utilization of CPU\Memory\Datastore, VM has snapshots, CDROM attached, etc. I’m also looking at importing some statistics from PowerCLI.
If there are any issues you have or feature requests, send them my way. This script is being developed in my spare time, so I can only make my best effort to update it and add features.
Version 1.1 is available! 12/16/2014

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.