[VMC] How to Generate VMware Cloud Usage Reports
search cancel

[VMC] How to Generate VMware Cloud Usage Reports

book

Article ID: 437094

calendar_today

Updated On:

Products

VMware Cloud on AWS

Issue/Introduction

The VMware Cloud Usage Report Generator is a self-contained tool that produces interactive HTML reports for your VMware Cloud on AWS usage. It retrieves data directly from the Usage Analytics API and generates a professional, Broadcom-branded report that you can view in any web browser.

The report covers three types of usage:

  • Host Usage — Daily host counts by instance type and region, including subscription and overage breakdowns
  • SPLA License Usage — Microsoft SPLA license counts by SKU and datacenter
  • Misc/Networking Usage — Networking usage including Bandwidth, Transit Gateway, Elastic IP, and other SKUs by region

Resolution

Prerequisites

RequirementDetails
PythonVersion 3.7 or later
Internet AccessRequired to call the VMware Cloud API's and load the Chart.js library in the browser
CSP API Refresh TokenA valid VMware Cloud Services refresh token with read access to your organization
Organization IDYour VMware Cloud organization ID (UUID format)


How to Get Your CSP API Refresh Token

  1. Log in to VMware Cloud Services
  2. Click your username in the top-right corner and select My Account
  3. Go to the API Tokens tab
  4. Click Generate a New API Token
  5. Give it a name, select the appropriate roles (at minimum, read access to your organization), and set an expiration
  6. Click Generate and copy the token — you will not be able to see it again

How to Find Your Organization ID

  1. Log in to VMware Cloud Services
  2. Click the Organization dropdown in the top navigation bar
  3. Select View Organization
  4. Your Organization ID is displayed on the Organization Settings page (in UUID format, e.g., ########-####-####-####-############)

Installation

Step 1: Download and Extract

Download the vmc_usage_report_generator.zip file provided by your VMware Cloud administrator. Extract it to a folder of your choice:

unzip vmc_usage_report_generator.zip

After extraction, you will have the following files:

├── generate_usage_report.py    # The report generation script
├── requirements.txt            # Python dependencies
├── README.md                   # Quick reference guide
└── logo/
    └── broadcom_logo.png       # Broadcom logo for the report header

Step 2: Install Dependencies

Install the required Python package:

pip install -r requirements.txt

Note: If you encounter an externally-managed-environment error (common on macOS with Homebrew Python), use a virtual environment:

python3 -m venv venv
source venv/bin/activate      # On macOS/Linux
# venv\Scripts\activate       # On Windows
pip install -r requirements.txt

Generating a Report

Basic Usage

python3 generate_usage_report.py <refresh_token> <org_id> <start_date> <end_date> [report_types]
ArgumentRequiredDescription
refresh_tokenYesYour CSP API refresh token
org_idYesOrganization ID in UUID format
start_dateYesStart date in YYYY-MM-DD format
end_dateYesEnd date in YYYY-MM-DD format
report_typesNoComma-separated list: host, spla, misc. Defaults to all three.

 

Examples

Generate a full report (Host + SPLA + Misc) for February 2026:

python3 generate_usage_report.py "your-refresh-token" "your-org-id" "2026-02-01" "2026-02-28"

Generate only the Host usage report:

python3 generate_usage_report.py "your-refresh-token" "your-org-id" "2026-02-01" "2026-02-28" "host"

Generate Host and SPLA reports only:

python3 generate_usage_report.py "your-refresh-token" "your-org-id" "2026-02-01" "2026-02-28" "host,spla"

Generate a report spanning multiple months (the tool automatically handles date ranges greater than 30 days by splitting into multiple API calls):

python3 generate_usage_report.py "your-refresh-token" "your-org-id" "2025-10-01" "2026-02-28"


Output

The script generates an HTML file in the same directory as the script:

usage_report_{org_id}_{start_date}_to_{end_date}_{report_types}.html

For example:

usage_report_XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX_2026-02-01_to_2026-02-28_host_misc_spla.html

Viewing the Report

Open the generated HTML file in any modern web browser (Chrome, Firefox, Edge, Safari). The report requires an internet connection to load the Chart.js library for rendering charts.

Report Sections

Key Performance Indicators (KPIs)

At the top of the report, you will see summary KPIs:

  • Total Days — Number of days in the reporting period
  • Max Hosts (Single Day) — Peak host count across all instance-regions on any single day
  • SPLA SKUs — Total number of unique SPLA license SKUs found
  • Misc Categories — Number of distinct networking/misc usage categories

Host Usage Chart

  • Displays daily host counts for each instance-region combination (e.g., I3EN-APE, I4I-CCR)
  • Three line types per instance-region:
    • Solid line — Actual host count
    • Dashed line — Subscription count
    • Dotted line — Overage count
  • Hover over any data point to see the exact count for that date

SPLA License Usage Chart

  • Displays daily SPLA license counts by SKU (e.g., VOD-I3EN-MSFT-DC)

Misc/Networking Usage Chart

  • Displays daily usage for networking SKUs grouped by category (Bandwidth, Transit Gateway, Elastic IP, etc.)
  • Use the Category dropdown to filter by a specific usage category

Interactive Features

Filtering

Each chart section has filter controls:

  • Filter Instance-Regions / Filter SPLA SKUs / Filter SKU-Regions — Click to open a checkbox panel. Select or deselect individual items to show or hide them on the chart.
  • Select All / Deselect All — Quickly select or clear all items in the filter.
  • Metrics (Host chart only) — Show or hide the Host Count, Subscription, and Overage lines independently.

Data Tables

  • Click the View Table button on any chart to toggle a detailed data table showing daily values for all items.

Troubleshooting

IssueResolution
ModuleNotFoundError: No module named 'requests'Run pip install -r requirements.txt. If using a virtual environment, ensure it is activated.
error: externally-managed-environmentUse a Python virtual environment (see Installation Step 2).
403 Forbidden errorYour refresh token may have expired or lacks the required permissions. Generate a new token in the VMware Cloud Services console.
Charts appear empty in browserEnsure you have an internet connection (required to load Chart.js from CDN). Try hard-refreshing the page (Ctrl+Shift+R or Cmd+Shift+R).
No data available messageVerify the organization ID and date range are correct. Confirm that usage data exists for the specified period.
Report file not found after runningThe report is saved in the same directory as the generate_usage_report.py script.
Logo not showingEnsure the logo/broadcom_logo.png file is in a logo/ subdirectory relative to the HTML report file.

 


FAQ

Q: How long can the date range be?
A: There is no limit. For date ranges longer than 30 days, the tool automatically splits the requests into 30-day intervals and aggregates the data.

Q: Can I share the HTML report with others?
A: Yes. The HTML file is self-contained (except for the Chart.js CDN dependency and the logo image). To share, send the HTML file along with the logo/ folder. The recipient only needs a web browser and internet access.

Q: Does the tool store my refresh token?
A: No. The refresh token is only used in memory to generate a short-lived access token for the API calls. It is not saved to disk.

Q: What if my token expires while the report is being generated?
A: The tool generates an access token at the start and uses it for all API calls. If the process takes a very long time (unlikely), the access token could expire. Simply re-run the script with a valid refresh token.

Additional Information

Usage APIs:
https://developer.broadcom.com/xapis/vmc-on-aws-general/latest/usage-report/

For issues or questions, contact your VMware Cloud administrator or the Usage Analytics support team.

Attachments

vmc_usage_report_generator.zip get_app