«

»

Jan 19 2018

Nutanix AHV VM Reporting Via REST API Version 2.0

So this will be the third release, version 2.0, of the AHV VM Reporting script using Nutanix REST API. You might be aware of that Nutanix moved Self Service Portal functionality from Prism Element (management of single Nutanix cluster) to Prism Central which can manage many Nutanix clusters (PEs) in AOS version 5.5.

What you need to do is decide if you want to include “Self Service Portal Project” and “Self Service Portal VM Owner” information in the script output.

It is controlled in the beginning of the script via the below section meaning you specify Y or N and if you want the information you also provide PC information:

# Is Prism central in use. Available options are Y and N
pcinuse=”Y”
pcfqdn=”PC-FQDN”
pcuser=”User”
pcpasswd=”Password”

This means the script still includes the following metrics:

  • 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

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=”pe.fqdn.com”
  • user=”scriptuser”
  • passwd=”Compl8!xPWD”
  • pcinuse=”y”
  • pcfqdn=”pc.fqdn.com”
  • pcuser=”scriptuser”
  • pcpasswd=”Compl8!xPWD”

The script has been tested on AOS 5.5.0.2 and AHV 20170830.48 and from a few versions of MaxOS and a few Linux OS:es. It works with MacBook regional settings set to Swedish as well πŸ™‚

In addition to the above versions Frederic Lhoest has confirmed the works for Nutanix CE version 2017.12.12 as well. Tnx Frederic.

Feel free to provide feedback for improvements if you have any suggestion.

 

2 comments

  1. Frederic Lhoest

    I can also confirm this is working fine on my CE lab !!! Well done.

  2. magander3

    Awesome, tnx for the info. will add this to the post.

    //Magnus

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