Nutanix VM Inventory Script using powershell

Nutanix VM Inventory Script

Last week Magnus Andersson posted a Nutanix AHV VM Reporting script which leverages the internal commandline options to export some basic VM configuration to an excel file. In the same week our team got a question about how to do this based on powershell.

When I combined those two I took on the challenge and wrote a few lines of powershell to collect similar information and drop it into CSV.

The script will collect the following information:

  • VM Name
  • Contrainer (which datastore the primary boot disk is stored on)
  • Protection Domains
  • Host Placement
  • Power State
  • The number of network adapters
  • IP addresses
  • The number of vCPUs
  • The amount of vRAM assigned to the VM (GB)
  • Disk count
  • Provisioned space (GB)
  • Used space (GB)

Running the script is pretty straightforward, make sure you have the powershell cmdlets installed (Go to Prism, select Admin and click on “Download Cmdlets installer). This script was tested with the cmdlets in AOS5. Once the cmdlets are installed you can run the following command line:

This will provide you with a CSV file stored on your desktop called “NutanixVMInventory.csv”:

Screen Shot 2017-02-23 at 15.44.44

The script itself:

A thank you goes out to Andrew Morgan for being ever so patient and answering my questions!

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.

Leave a Reply