hubblo-org / scaphandre

⚡ Energy consumption metrology agent. Let "scaph" dive and bring back the metrics that will help you make your systems and applications more sustainable !
Apache License 2.0
1.6k stars 106 forks source link

Add support for firecracker vms in addition to qemu/kvm #52

Open mrchrisadams opened 3 years ago

mrchrisadams commented 3 years ago

Problem

If you are using other virtualisation technology like Firecracker, you can't use scaphandre to get an understanding of the power draw from the VMs you spin up that use it.

Firecracker is in used in a lot of places - in addition Amazon's own Serverless offerings, it's in all the options below:

Firecracker is used by/integrated with (in alphabetical order): appfleet , containerd via firecracker-containerd , Fly.io , Kata Containers , OpenNebula , UniK , and Weave FireKube (via Weave Ignite ). Firecracker can run Linux and OSv guests.

Solution

Figure out a way to expose the same kind of information to guest micro-vms as that scaphandre exposes to vms using qemu/kvm like in qemu.rs

/// An Exporter that extracts power consumption data of running
/// Qemu/KVM virtual machines on the host and store those data
/// as folders and files that are supposed to be mounted on the
/// guest/virtual machines. This allow users of the virtual machines
/// to collect and deal with their power consumption metrics, the same way
/// they would do it if they managed bare metal machines.

Alternatives

Additional context

Firecracker uses KVM too, so presumably the approaches used to expose filesystems and info to guest micro-vms, isn't conceptually that different to Scaphandre.

https://github.com/firecracker-microvm/firecracker/blob/master/docs/getting-started.md#prerequisites https://github.com/firecracker-microvm/firecracker/blob/master/docs/dev-machine-setup.md

Further details about what scaphandre exposes for kvm/qemu based machines is detailed in the qemu exporter docs:

https://github.com/hubblo-org/scaphandre/blob/main/docs_src/references/exporter-qemu.md

bpetit commented 3 years ago

That is very interesting. I may work on this in march the soonest. If someone wants to jump on it before that, please do ! :blush: