[kolla-ansible]change prometheus data volume path

Pierre Riteau pierre at stackhpc.com
Fri Sep 15 08:03:03 UTC 2023


Hello Satish,

The prometheus_server_default_volumes variable is defined as:

prometheus_server_default_volumes:
  - "{{ node_config_directory }}/prometheus-server/:{{
container_config_directory }}/:ro"
  - "/etc/localtime:/etc/localtime:ro"
  - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family ==
'Debian' else '' }}"
  - "prometheus_v2:/var/lib/prometheus"
  - "kolla_logs:/var/log/kolla/"

As you can see, it configures a lot more than just how Prometheus data is
stored. By default it uses the prometheus_v2 Docker volume. If you want to
store your data in /mnt/prometheus, you can use:

prometheus_server_default_volumes:
  - "{{ node_config_directory }}/prometheus-server/:{{
container_config_directory }}/:ro"
  - "/etc/localtime:/etc/localtime:ro"
  - "{{ '/etc/timezone:/etc/timezone:ro' if ansible_facts.os_family ==
'Debian' else '' }}"
  - "/mnt/prometheus:/var/lib/prometheus"
  - "kolla_logs:/var/log/kolla/"

Note that it won't move the data for you. If you want to keep existing
data, stop prometheus_server containers and copy the data from
/var/lib/docker/volumes/prometheus_v2/_data into /mnt/prometheus before
applying this configuration.

Best regards,
Pierre Riteau (priteau)

On Fri, 15 Sept 2023 at 04:29, Satish Patel <satish.txt at gmail.com> wrote:

> Folks,
>
> I have deployed prometheus with koll-ansible and now I want to change the
> path of prometheus volume to store matrices on bigger partitions. How do I
> change the volume path of prometheus to store matrix data on
> separate filesystem?
>
> This is what I did in globals.yml but it doesn't work. Is the following
> variable correct?
>
> prometheus_server_default_volumes: "/mnt/prometheus"
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.openstack.org/pipermail/openstack-discuss/attachments/20230915/c11984a7/attachment-0001.htm>


More information about the openstack-discuss mailing list