This project enables energy metrics collection on virtual machines using Scaphandre, a lightweight agent in C for VM monitoring, and a custom Grafana dashboard. Follow the steps below to configure your environment correctly.
- Ensure the QEMU guest agent is running inside each virtual machine (VM).
- OpenNebula Frontends (FE) must be accessible and configured to support custom Prometheus collectors.
-
Download the latest release of the official Scaphandre package from GitHub and install on every OpenNebula Host:
👉 https://github.com/hubblo-org/scaphandre/releases -
Deploy the systemd service file for Scaphandre:
- You can copy it from a host where Scaphandre is already installed.
- If Scaphandre is deployed via Docker, ensure the systemd configuration matches your container setup.
-
Configure the target port:
- Add the following environment variable in the host’s configuration:
#/etc/default/scaphandre SCAPHANDRE_PROMETHEUS_PORT=9930
- Add the following environment variable in the host’s configuration:
Install the custom VM monitoring agent inside every VM:
-
Clone the repository:
git clone https://github.com/6G-SANDBOX/power_monitoring
-
Build and run the agent inside the VM following the instructions provided in the get_proc_ticks folder.
-
Copy the modified Prometheus collector files to:
/usr/lib/one/opennebula_exporter
-
Restart the OpenNebula Prometheus exporter service:
systemctl restart opennebula-prometheus
- Open your Grafana instance.
- Go to the sidebar and click Dashboards → Import.
- Select or paste the contents of the JSON file with the dashboard definition.
- Choose the appropriate Prometheus data source.
- Click Import to load the dashboard.