Skip to content

Power & Carbon Tracking

Aggregates per-node power telemetry into a kWh + CO₂e dashboard. Designed for ESG / scope-2 reporting and for spotting the rack that's silently drawing 600 W more than its neighbour.

How it's calculated

PegaProx does NOT read hardware power. It estimates consumption from the same metrics_history CPU/RAM utilization snapshots that Insights and the Cost Dashboard use, multiplied by an admin-configurable linear power model:

  • total_w = ((node_max_w − node_idle_w) × cpu_util + idle_share + mem_gb × mem_w_per_gb) × PUE
  • kWh = total_w × running_hours / 1000, cost = kWh × kwh_price, kg_CO₂e = kWh × kg_co2_per_kwh.

There is no BMC/Redfish/IPMI/RAPL integration - the node idle/max watts are values you enter, not measured. Because it rides on metrics_history, the maximum window is 30 days (retention).

Per-host model and host profiles

New in 1.4.0

The per-host model and the host profiles come with 1.4.0. 1.3.0 uses the per-VM formula above.

From 1.4.0 the estimate starts at the hosts, for every 5-minute interval of the history:

  • host_w = idle_w + (max_w − idle_w) × host_cpu_util, plus host_mem_used_gb × mem_w_per_gb for a host that uses the cluster rates.
  • Each guest that ran on the host in that interval gets its share: idle_w split by its vCPUs among the guests running there, (max_w − idle_w) / host_cores per core it actually used, and mem_w_per_gb per GB it actually used.
  • What no guest explains (a host without running guests, host CPU above what its guests use) is shown as Unallocated. Guests plus Unallocated add up to the hosts, and the hosts to the cluster.
  • kWh = W × PUE × interval_h / 1000. A gap in the history (PegaProx down) counts as missing, not bridged; the monthly figure is extrapolated from the hours actually covered, and the page says how many were missing.

Host profiles (Reports → Power & Carbon → Host profiles, needs cluster.config): enter a host's whole-system idle and full-load watts at the wall, ideally read off a power meter. A host without a profile uses the cluster rates. A host profile already includes RAM, so mem_w_per_gb is not added on top of it. Changes are written to the audit log.

Lower numbers after the update

The old per-VM formula gave every guest a share of the host idle power by its vCPU count. On hosts with more vCPUs assigned than cores, the idle power was counted several times, so the totals could exceed what the hosts can draw at all. The per-host model cannot hand out more than the hosts draw. On a lab cluster with three hosts and the default rates, the monthly estimate went from 637 kWh to 382 kWh. Expect lower kWh, cost and CO₂ figures after the update, and compare reports across the update with that in mind.

History recorded before the update does not know which host a guest ran on; for it, the guest's current host is used and the page says for how many guests that applies. A guest that migrated within the window is costed on each host it ran on.

Configuration (Settings → Sustainability)

  • Carbon intensity per cluster (kg_co2_per_kwh) - default uses the European grid average; per-cluster override for renewable / nuclear-heavy regions.
  • Electricity price per kWh (kwh_price) - feeds back into the Cost Dashboard.
  • Power-model rates per cluster: node_idle_w, node_max_w, mem_w_per_gb and pue - the linear model above uses these instead of any hardware reading.

What you see

  • Live W per node (last 60 s) + 24 h sparkline.
  • kWh per day / month, € per day / month, kg CO₂e per day / month.
  • Idle-VM watt waste estimate (CPU% × node W per vCPU share).
  • PDF + CSV export for the auditor / sustainability officer.

API

Method Endpoint Description
GET /api/clusters/<id>/power/summary?days=30 Window + monthly kWh/cost/CO₂ rollup, by-node, top-10 consumers
GET /api/clusters/<id>/power/per-vm?days=30 Full per-VM kWh/cost/CO₂ table
GET /api/power/rates / /api/power/rates/<id> List / read power-model rates
PUT DELETE /api/power/rates/<id> Update / delete per-cluster rates (needs cluster.config)
GET /api/clusters/<id>/power/hosts Every host with the profile it is costed with (1.4.0 and newer)
PUT DELETE /api/clusters/<id>/power/hosts/<node> Set / remove a host profile {idle_w, max_w, notes} (needs cluster.config, 1.4.0 and newer)

days is 1–30 (metrics retention cap); CSV/PDF export is generated client-side, there is no export endpoint.