Open TheElectronWill opened 1 year ago
Since April 2023, on ESXi 8.0 Update 1, they introduced per VM metric on the power usage.
So querying the PerformanceManager we can get the Power (watt) and Energy (joule) for Host and VM.
Interesting link. Is it known how this splitting is done on the hypervisor level?
Problem
Scaphandre is able to analyze qemu/KVM virtual machines (if qemu is started in system mode, it doesn't seem to work in user mode. For instance, it doesn't work with a simple vm managed by Gnome Boxes, but it does work with virt-manager). However, the implementation is specific to libvirt and doesn't work with the VMware ESXi hypervisor.
Solution
A method similar to qemu/KVM support (i.e. detecting vms on the host, computing their power consumption and offering a fake interface to the guest OS) could be implemented for VMWare ESXi.
If RAPL isn't available on the hypervisor, maybe we could use the vSphere metrics API.
Alternatives
Never support VMware ESXi, but that would be a bit sad because it's quite popular.
Additional context
The vSphere UI shows power metrics for hosts and for VMs, so that information is available to the hypervisor in some way.