«

»

Nov 28 2017

Nutanix AHV VM Reporting Via REST API Version 1.1

“VMTurbo"
A while ago I published a blog post that includes a script you can use to create Nutanix AHV VM reports. The blog post can be found here. Now it’s time for version 1.1 and it comes with additional VM information to make   it more useful. The new metrics included are:

  • Remote Protection Domain Snapshots
  • Volume Groups
    • Number of VGs
    • VG Names
    • VG Disk Allocated GB

This means the following information will be included for all your AHV based VMs:

  • VM Name
  • Total Number of vCPUs
  • Number of CPUs
  • Number of Cores per vCPU
  • Memory GB
  • Disk Usage GB (not including CD-ROM)
  • Disk Allocated GB (not including CD-ROM)
  • Number of VGs
  • VG Names
  • VG Disk Allocated GB
  • Flash Mode Enabled
  • AHV Snapshots
  • Local Protection Domain Snapshots
  • Remote Protection Domain Snapshots
  • IP Address/IP Addresses
  • Network Placement
  • AHV Host placement
  • Self Service Portal Project
  • Self Service Portal VM Owner

The major improvement with this new script is that it uses the Nutanix Representational State Transfer (REST) Application programming interface (API) meaning you can run or schedule it from your Linux or MacBook and you do not need to use the Nutanix CVM.

Sample output from the script after some excel magic 🙂

After downloading the script from My GitHub Reporting Repository or just copy and paste the script from this blog post you need to change the following parameters to make it work in your environment:

  • directory=”/Users/magander/Documents/script/REST”
  • clusterfqdn=”my.fqdn.com”
  • user=”scriptuser”
  • passwd=”Compl8!xPWD”

The script has been tested on AOS 5.1.3 and AHV20160925.90 and from a few versions of MaxOS and a few Linux OS:es as well. It works with MacBook regional settings set to Swedish as well 🙂

Next improvement will be to change the script from a bash one to python….

Please provide feedback for improvements if you have any suggestion.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">