ListVms icon
Script icon
Docker icon
Load icon
SlackIncomingWebhook icon
Schedule icon

Nutanix AHV Inventory and Chargeback Report

Automate Nutanix AHV chargeback with Kestra. List VMs, compute per-VM cost from vCPU cores, append rows to a Google Sheet, and post a Slack summary on a monthly schedule.

Categories
Infrastructure

Finance teams running private cloud on Nutanix AHV need a recurring, defensible cost-allocation report, but the inventory lives in Prism Central while the chargeback ledger lives in a spreadsheet. This blueprint closes that gap. It pulls every AHV virtual machine with its resource configuration, computes a cost per VM from vCPU cores and a configurable rate, appends the rows to a Google Sheet that accumulates one period per run, and posts a summary to Slack so stakeholders see the numbers without opening a tool. It is a complete Nutanix inventory, showback, and chargeback pipeline you can run on day one.

How it works

  • list_vms (io.kestra.plugin.ee.nutanix.ahv.ListVms) queries Prism Central with fetchType: FETCH and returns all AHV VMs and their socket and core configuration as rows.
  • compute_chargeback (io.kestra.plugin.scripts.python.Script, run on a python:3.11-slim Docker task runner) reads those rows, multiplies numSockets by numCoresPerSocket per VM, applies the core_hour_rate input, writes a chargeback.csv, and emits vm_count and total_cost outputs.
  • append_to_sheet (io.kestra.plugin.googleworkspace.sheets.Load) loads the CSV into the Chargeback range with insertType: APPEND, so each run adds a fresh period to the finance ledger.
  • notify (io.kestra.plugin.slack.notifications.SlackIncomingWebhook) posts the VM count and period total to Slack.
  • A Schedule trigger (monthly_report) is wired for the 1st of each month at 06:00 and ships disabled, ready to enable.

What you get

  • A current Nutanix AHV VM inventory on every run.
  • A per-VM cost breakdown driven by a single, adjustable rate input.
  • A growing Google Sheet ledger that finance can pivot and audit.
  • A Slack summary with VM count and total cost per period.

Who it's for

  • Platform and virtualization teams running Nutanix AHV.
  • FinOps and finance owners who need showback or chargeback numbers.
  • Infrastructure engineers automating recurring cost reporting.

Why orchestrate this with Kestra

Prism Central can list VMs but cannot run them through a pricing model, write them to a finance spreadsheet, and notify a channel on a schedule. Kestra ties those steps into one declarative YAML flow with event and schedule triggers, automatic retries, and full execution lineage, so a failed Sheets write or Slack post is visible and replayable instead of silent. You get auditable runs, versioned logic, and a single place to evolve the cost model.

Prerequisites

  • A Nutanix Prism Central endpoint reachable from your Kestra workers.
  • A Google Sheet shared with the service account, and its spreadsheet ID.
  • A Slack incoming webhook.

Secrets

  • NUTANIX_HOST: Prism Central host.
  • NUTANIX_TOKEN: Prism Central bearer token.
  • GCP_SERVICE_ACCOUNT: service account key JSON with Google Sheets access.
  • SLACK_WEBHOOK_URL: Slack incoming webhook URL.

Quick start

  1. Add the four secrets above to your Kestra namespace.
  2. Share the target spreadsheet with the service account and pass its ID as spreadsheet_id.
  3. Set core_hour_rate to your pricing (defaults to 0.05).
  4. Run the flow, then enable the monthly_report trigger to schedule it.

How to extend

  • Enrich the cost model in compute_chargeback with memory and storage, not just cores.
  • Add per-cluster or per-project labels and split the spreadsheet ranges accordingly.
  • Swap or add a destination, for example a database or object storage, alongside the Google Sheet.
  • Change the Schedule cron to weekly or quarterly, or trigger the flow from an external event.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.