Per-VM energy attribution using hardware RAPL counters and CPU-time proportional modeling. A host-side daemon that reads real energy data from Intel/AMD RAPL and delivers per-VM power readings to guests via virtio serial port.
Read the manifesto: Open VM Energy Manifesto | Discussion
- Reads host-level energy from
/sys/class/powercap/intel-rapl:*/energy_uj(works for both Intel and AMD despite the naming) - Finds the QEMU process for a given VM via libvirt
- Computes the VM's energy share:
E_vm = E_host × (T_vm / T_total) - Writes the attributed power (watts) to the VM via a virtio serial port every 2 seconds
The guest reads its energy data from /dev/ttyS1 — no agent, no driver, no network stack needed.
- Linux host with RAPL support (
/sys/class/powercap/intel-rapl:*must exist) - QEMU/KVM with libvirt
- A VM configured with a virtio serial port
- Root access (RAPL and libvirt require it)
- Go 1.25+ and
libvirt-devheaders
make buildOn the host — start the daemon, pointing it at your VM name and the PTY path that QEMU allocated for the serial port:
sudo ./vrapl <VM_NAME> <SERIAL_PATH>
# Example:
sudo ./vrapl ubuntu25.04 /dev/pts/2Note: The PTY path is not deterministic. Check
virsh dumpxml <VM_NAME>or QEMU logs to find the allocated path.
Inside the guest — read the energy data:
sudo cat /dev/ttyS1You'll see real-time power attribution:
This is an early proof of concept demonstrating the virtio serial port delivery mechanism. See the Open VM Energy Manifesto for the broader proposal to cloud providers.
See LICENSE.
