In our previous articles, we deployed Openstack in multiple nodes and as well as in a single node. In one of the articles, we explained important configuration files and this article will also discuss those configuration files. In this article, we will discuss how to add monitoring in Openstack through Kolla-Ansible.
In this article, we will discuss how to deploy important OpenStack and service-related Prometheus exporters in different nodes. Also, we will configure a basic Grafana Dashboard.
Prometheus is an open-source system monitoring and alerting toolkit. Prometheus collects and stores its metrics as time-series data, i.e. metrics information is stored with the timestamp at which it was recorded. Prometheus provides exporters that export different metrics to Prometheus. It also provides the alert manager which handles alerts sent by the Prometheus server and notifies admins/users of the situation.
Adding new OpenStack service in an already running Openstack deployment through kolla-ansible is straightforward. We need to enable the services in gloabls.yaml config. Here we will enable Prometheus and Grafana. Prometheus allows adding Prometheus exporters in the nodes and Grafana will allow creating grafana server and showing very nice graphs of prometheus matrics.
enable_prometheus: "yes" enable_grafana: "yes"
In this file, you can configure what type of nodes you want to install which service components, and which components you want to ignore. Prometheus has many exporters (components) for example ha proxy, Memcached and OpenStack exporter etc. Here, we will just deploy a few of the exporters. In the following multinode entries, I am commenting out the HA proxy and Memcached and a few more exporters.
In the following configuration, we can see that we there is the exporter-related configuration for every exporter under its heading we mention different node groups. For example here In monitoring, we have mentioned kolla-controller-[1:2] both nodes are in the monitoring group and Prometheus-node-exporter will be installed in the monitoring nodes. The similar configuration has been done for control compute, network, and storage node groups as will
[monitoring] kolla-controller-[1:2] #monitoring01 # Prometheus [prometheus-node-exporter:children] monitoring control compute network storage [prometheus-mysqld-exporter:children] #mariadb [prometheus-memcached-exporter:children] memcached [prometheus-cadvisor:children] #monitoring #control #compute #network #storage [prometheus-alertmanager:children] #monitoring [prometheus-openstack-exporter:children] monitoring [prometheus-elasticsearch-exporter:children] #elasticsearch [prometheus-blackbox-exporter:children] #monitoring
Running reconfiguring through kolla
We have also explained in Kolla-ansible important command configuration article that kolla-ansible can reconfigure different services in running OpenStack deployment with out stopping any of the running services. See the following code section for more details.
[root@kolla-controller1 ~]# source train-venv/bin/activate (train-venv) [root@kolla-controller1 ~]# (train-venv) [root@kolla-controller1 ~]# kolla-ansible -i /etc/kolla/multinode reconfigure -t prometheus,grafana
After running the kolla-ansible command make sure that it doesn’t end up with any error.
Grafana Dashboard configuration
Grafana is multi-platform open-source analytics and interactive visualization web application. It provides charts, graphs, and alerts for the web when connected to supported data sources.
To configure the data source use the following steps:
- Open Grafan GUI, grafana is running on a 3000 port and you can get the user name and password from your /etc/kolla/passowrd.yml file.
- On the left side in the middle, there is a configuration button, and hovering over it you can see a drop-down menu click on dashboard.
- In our case data source is Prometheus in the below snapshot you will see how to configure the Prometheus data source.
After configuring the data source now you need to configure your dashboard to see the matrics. To show a simple OpenStack services-related dashboard we will use the already created OpenStack Prometheus dashboard from the grafana. Go to grafana website then you can search for the OpenStack dashboard and copy its template-id (in our case it was 9701). In the following screenshots, we will show how to use this template id to get the whole dashboard.
Enter template id 9701 in the Import via grafana.com section and press the Load button.
After pressing load you will be redirected to the new page show the snapshot following and select the Prometheus datasource here and then click on import.
For Prometheus verification, we can just visit different nodes and see if Prometheus-related docker containers are running or not. We can also check on grafana dashboard to check different graphs and metrics but make sure you have configured OpenStack dashboard.
You will see the following dashboard if you have configured everything correctly till now.
Monitoring is an important part of any deployment, it will give you a clear perspective on how things are going on in your environment and what you need to improve your deployment. Monitoring comes in handy when you are looking for resource consumption (for networks, storage, node load), faulty services, resource upper limits etc. In this article, we have discussed how to set up simple prometheus monitoring through kolla-ansible.