WilliamLam.com

  • About
    • About
    • Privacy
  • VMware Cloud
  • Tanzu
    • Application Modernization
    • Tanzu services
    • Tanzu Community Edition
    • Tanzu Kubernetes Grid
    • vSphere with Tanzu
  • Home Lab
  • Nested Virtualization
  • Apple
You are here: Home / Automation / Exploring new VCSA VAMI API w/PowerCLI: Part 7

Exploring new VCSA VAMI API w/PowerCLI: Part 7

02.07.2017 by William Lam // Leave a Comment

In the previous article (Part 6), we demonstrated how you can easily associate the list of VMDKs to their respective OS partitions within a VCSA or PSC node, which is useful when you need to increase the disk capacity for a specific OS partition. In Part 7, we are now going to drill down a bit further into the underlying filesystem and retrieve both the storage capacity as well as utilization of each partition.

VAMI UI Area of Focus

There is not a granular view of the individual OS partitions within the VAMI UI (https://[VCSA]:5480). However, this information is available as part of the VAMI information when logged into the vSphere Web Client by navigating to System Configuration->Nodes->Monitor->Storage as shown in the screenshot below.


The workflow for retrieving the storage statistics using the VAMI APIs is also applicable for retrieving other statistics such as compute, memory and networking. You first need to retrieve the list of VAMI Statistic IDs that are available from the monitoring API endpoint which is demonstrated with the Get-VAMIStatsList function. From each VAMI Stat ID, you can also drill down further to get more details such as description and the unit of measurement. Once you have the Stat IDs that you are interested in, you can then perform a query based on a specific set of search criteria which can be time range (start and stop time), interval, etc. To demonstrate how the query API works, I have created the Get-VAMIStorageUsed function to demonstrate its usage.

VAMI APIs Used

  • GET /appliance/monitoring
  • GET /appliance/monitoring/query

PowerCLI Function

  • Get-VAMIStatsList
  • Get-VAMIStorageUsed

Sample Output

The first function Get-VAMIStatsList does exactly as it sounds, it simply lists all VAMI Stat IDs that are available. Most of the Stat ID names are pretty descriptive but you can always retrieve more information by performing a GET on /appliance/monitoring/[VAMI-STAT-ID].


As stated in the beginning, we are interested in the grabbing the storage stats. The Get-VAMIStorageUsed function takes a subset of the VAMI Stats ID, specifically the storage ones that map to the OS partitions and retrieves both the total and used capacity (MB) as shown in the screenshot below.

  • Exploring new VCSA VAMI API w/PowerCLI: Part 1
  • Exploring new VCSA VAMI API w/PowerCLI: Part 2
  • Exploring new VCSA VAMI API w/PowerCLI: Part 3
  • Exploring new VCSA VAMI API w/PowerCLI: Part 4
  • Exploring new VCSA VAMI API w/PowerCLI: Part 5
  • Exploring new VCSA VAMI API w/PowerCLI: Part 6
  • Exploring new VCSA VAMI API w/PowerCLI: Part 7
  • Exploring new VCSA VAMI API w/PowerCLI: Part 8
  • Exploring new VCSA VAMI API w/PowerCLI: Part 9
  • Exploring new VCSA VAMI API w/PowerCLI: Part 10

More from my site

  • Exploring new VCSA VAMI API w/PowerCLI: Part 10
  • Exploring new VCSA VAMI API w/PowerCLI: Part 9
  • Exploring new VCSA VAMI API w/PowerCLI: Part 8
  • Exploring new VCSA VAMI API w/PowerCLI: Part 6
  • Exploring new VCSA VAMI API w/PowerCLI: Part 5

Categories // Automation, PowerCLI, vSphere 6.5 Tags // PowerCLI, vami, vcenter server appliance, VCSA 6.5, vSphere 6.5

Thanks for the comment! Cancel reply

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

Search

Author

William Lam is a Senior Staff Solution Architect working in the VMware Cloud team within the Cloud Infrastructure Business Group (CIBG) at VMware. He focuses on Cloud Native technologies, Automation, Integration and Operation for the VMware Cloud based Software Defined Datacenters (SDDC)

Connect

  • Email
  • GitHub
  • LinkedIn
  • RSS
  • Twitter
  • Vimeo

Recent

  • How to disable the Efficiency Cores (E-cores) on an Intel NUC? 03/24/2023
  • Changing the default HTTP(s) Reverse Proxy Ports on ESXi 8.0 03/22/2023
  • NFS Multi-Connections in vSphere 8.0 Update 1 03/20/2023
  • Quick Tip - How to download ESXi ISO image for all releases including patch updates? 03/15/2023
  • SSD with multiple NVMe namespaces for VMware Homelab 03/14/2023

Advertisment

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

Copyright WilliamLam.com © 2023

 

Loading Comments...