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.

5 comments

  1. Is it possible to add functionality to get this list in email?

  2. Donovan Sobrero says:

    I’m running AOS 5.1.4 and i don’t seem to be able to location the cmdlets for 5.1.4 i have 5.1.2 any help locating the correct cmdlets would be awesome!!

    • k.baggerman says:

      You can download them from your cluster, go to Prism, click on Admin and Download Cmdlets.

  3. WideNET says:

    Hi, is there a way to list VM by Date of creation?

  4. […] vGPU enabled VMs on AHV.I wrote earlier this month and wanted to reuse that script for the VM Inventory script I had written back in 2017 and with the new capabilities of Nutanix AHV it made sense to add the […]

Leave a Reply

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