«

»

Oct 03 2017

Nutanix AHV VM Reporting Via REST API

“VMTurbo"
Some time ago I provided a virtual machine reporting script for Nutanix hypervisor AHV virtual machines via the blog post “Nutanix AHV VM Reporting”.That script was running on a Nutanix Controller Virtual Machine (CVM) so it had some shortcomings in terms of flexibility and scheduling options.

This new script provides all the output parameters included in the previous script and also the following information per VM:

  • Flash Mode Enabled
  • Self Service Portal Project
  • Self Service Portal VM Owner

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)
  • Flash Mode Enabled
  • AHV Snapshots
  • Local 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.2 and AHV 20160925.84 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.

——————————————————————————————————————————————–
Load/access your VMware software remotely from anywhere with citrix cloud hosting by CloudDesktopOnline with top-notch support from Apps4Rent.
——————————————————————————————————————————————–

 

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="">