«

»

Nutanix AHV VM Reporting Via REST API Version 2.1

A new release, version 2.1, of the AHV VM Reporting script using Nutanix REST API.

I have been asked a few times about how to add information about when a VM was created and it is included in this version. However, the information is available via Prism Central (PC) so you need to decide if you want the PC specific information included in the report or not. If you include PCVM ย information you’ll get:

  • VM Create Date
  • Self Service Portal Project
  • Self Service Portal VM Owner

PC information or not is still controlled in the PC information section of the script and you specify Y or N if you want the information or not.

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

This means the report script includes the following metrics:

  • VM Name
  • VM Create Date
  • 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”
  • user=”admin”
  • passwd=”secret”
  • pcinuse=”y”
  • pcfqdn=”PC-FQDN”
  • pcuser=”admin”
  • pcpasswd=”secret”The script has been tested on AOS 5.8.-5.8.2 and AHV 20170830.156-166 and from a few versions of MaxOS and a few Linux OS:es. It works with MacBook regional settings set to Swedish as well ๐Ÿ™‚

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