rmohr.vdsm-prometheus
vdsm-prometheus
This guide explains how to install and set up vdsm-prometheus
, the latest version available through the copr. It will configure systemd, the firewall, and start the service.
Once the role is applied to a host, you can access metrics collected by VDSM in Prometheus format at port 8181
. By default, TLS and client certificates secure access to vdsm-prometheus
. Any client certificate signed by the oVirt Engine Certificate Authority (CA) will be accepted.
You can customize the vdsm-prometheus
configuration in your playbooks.
For more information, check the vdsm-prometheus role page on GitHub for source code and to report any issues.
To see the source or report issues related to vdsm-prometheus
, visit the vdsm-prometheus GitHub page.
Requirements
There are no specific requirements.
Role Variables
The only variable you can use is opts
, found in vars/main.yml. This variable allows you to set command-line arguments for vdsm-prometheus
when it starts via systemd. To view all possible options, run vdsm-prometheus --help
.
Dependencies
There are no dependencies.
Example Playbook
To install vdsm-prometheus
on the vdsm
host group with the command-line argument -no-verify
, use the following playbook:
---
- hosts: vdsm
roles:
- { role: vdsm-prometheus, opts: "-no-verify" }
To disable TLS and client certificate authentication, use this example:
---
- hosts: vdsm
roles:
- { role: vdsm-prometheus, opts: "-no-verify -no-prom-auth" }
To see all configuration options for vdsm-prometheus
, run vdsm-prometheus --help
.
oVirt Inventory
To create an initial oVirt inventory, you can query the oVirt Engine REST API:
export ENGINE_HOST=http://localhost:8080
export ENGINE_PWD=engine
echo "[vdsm]" > hosts && \
curl -H "Accept: application/json" -H "Content-type: application/json" -X GET --user admin@internal:$ENGINE_PWD $ENGINE_HOST/ovirt-engine/api/hosts \
| jq '.host[].address' -r >> hosts
Using Ansible on these hosts is straightforward since the oVirt installation includes an SSH key and VDSM has the Python interpreter installed.
To run the sample playbook using the engine SSH key, use this command:
ansible-playbook -i hosts -u root --private-key $ENGINE_HOME/etc/pki/ovirt-engine/keys/engine_id_rsa vdsm-prometheus.yml
License
GPLv3
Author Information
Roman Mohr rmohr@redhat.com
Install vdsm-prometheus agent for monitoring VMs with Prometheus
ansible-galaxy install rmohr.vdsm-prometheus