Updated: VM Reporting Script for Nutanix AHV with Powershell

PowershellHere I found myself wondering around the twitter sphere where I found this little gem posted by Aaron Parker: “Out-HtmlView – HTML alternative to Out-GridView “. This made me modify the current VM Reporting script for AHV and now the script will output to this HTML view when the PSWriteHTML module is installed and otherwise it will output to CSV.

From that older blog, the following interfaces are available:

  • REST API
  • HTML5 GUI
  • CLI – ACLI & NCLI
  • Scripting interfaces (PowerShell)

The following definitions are from the Nutanix Bible as Steve Poitras already explained this:

REST API
The REST API exposes every capability and data point of the Prism UI and allows for orchestration or automation tools to easily drive Nutanix action.  This enables tools like Saltstack, Puppet, vRealize Operations, System Center Orchestrator, Ansible, etc. to easily create custom workflows for Nutanix. Also, this means that any third-party developer could create their own custom UI and pull in Nutanix data via REST.

HTML5 GUI (Prism UI)
The HTML5 UI is a key part to Prism to provide a simple, easy to use management interface.  However, another core ability are the APIs which are available for automation.  All functionality exposed through the Prism UI is also exposed through a full set of REST APIs to allow for the ability to programmatically interface with the Nutanix platform.  This allow customers and partners to enable automation, 3rd-party tools, or even create their own UI.

CLI – ACLI & NCLI
The Acropolis CLI (ACLI) is the CLI for managing the Acropolis portion of the Nutanix product.  These capabilities were enabled in releases after 4.1.2. The Nutanix CLI is the CLI for managing the Nutanix product and is more heterogeneous across hypervisors.

PowerShell
Windows PowerShell is a powerful shell (hence the name ;P) and scripting language built on the .NET framework.  It is a very simple to use language and is built to be intuitive and interactive.
Running the script
The actual output (CSV file)
The output in an HTML file
The following two tabs change content below.

Kees Baggerman

Kees Baggerman is a Staff Solutions Architect for End User Computing at Nutanix. Kees has driven numerous Microsoft and Citrix, and RES infrastructures functional/technical designs, migrations, implementations engagements over the years.

5 comments

  1. […] you excellent reporting I try to automate as much as possible so I decided to alter the excisting Reporting Script I had written before to have working set size for read/write IO and potential CPU RDY times in the […]

  2. Balramsinh Solanki says:

    Hi there, It seems this scrip will meet my requirement, but getting error while adding IP, and credentials. Kind help will appreciate.

  3. Neo says:

    Hi I got the same errors:

    Irreducible Null’s arithmetic call method.
    At C:\ nutanix_report-script_v.ps1: 67 characters: 5
    + if(!($loadsnapins.Contains(” NutanixCmdletsPSSnapin”))){
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~
    + CategoryInfo: InvalidOperation:(:) [], RuntimeException
    + FullyQualifiedErrorId: InvokeMethodOnNull
    03:03:29 | INFO | Nutanix CMDlets are not loaded, aborting the script

  4. Brian D says:

    Great script but I am not getting some of the fields which I really need. Pulling a get-ntnxvm -Verbose there is no .spec listed and I really need the following:
    num_sockets
    num_vcpus_per_socket

Leave a Reply

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