Automating VMware Infrastructure Reporting

I was recently referred to do consulting work for a company that was looking to automate their VMware Infrastructure reporting. The client wanted a reporting service that:

  • Provided aggregate detailed reporting from all eight vCenters
  • Centralized reporting
  • Standardized reporting
  • Access reports via a web browser
  • Automated the whole process

When it came to deciding which reports the client wanted made available, he stated that his SAN team was particularly interested in detailed reports on LUNs, specifically RDMs; meanwhile, his Windows Server team wanted a detailed inventory of vCenter clusters, hosts, virtual machines, snapshots, distributed switches, et cetera; and incidentally, an aggregate report on alerts from all eight vCenters. And, of course, these reports needed to be undated twice a day.

PowerCLI smFrom a vSphere automation perspective, PowerCLI is my scripting tool of choice. For those not familiar with PowerCLI, it is essentially a PowerShell module developed by VMware. It’s provided as an executable that you install on your Windows’ computer that extends your PoSh environment. With this module extension you can manage and automate your vCenter infrastructure via a shell command line interface. And while this module extension is not without its quirks, it’s definitely worthwhile to use. You can download PowerCLI from VMware’s site, at no cost.

The consulting work involved creating an automation script that pulled data from the vCenters; the data was passed to a database residing on a remote server. However, prior to developing the script, a database schema needed to be created; notwithstanding, designing the database [along with its respective tables] was initially the most challenging and tedious aspect of the process. However, since I had already developed the automation script, and designed the database schema from a previous gig, I was able to recycle the whole shebang.

The report rendering phase would be the last component of the job. There were several rendering options to choose from, i.e. PowerBI, Crystal Reports, et al; however, since the RDBMS that was used to manage the database was MS SQL, it made sense to go with SSRS, since Visual Studio’s Data Tools is bundled with the installation software.

The final result was an automated reporting services platform that was accessible via a web browser. The reports included dashboards and other visuals and the ability to export reports [if needed] to other formats, i.e., CSV, PDF, MS Word, TIFF, XML, or Excel.