Add vitrage-persistor service

Kolla Ansible was missing vitrage-persistor service
required by Vitrage for data storage.

Depends on fixing availability of Kolla image.

Change-Id: I8158ba66b8b624f6bcb89da9c990a30a68b7187b
Depends-On: Id5e143636f9a81e7294b775f3d8b9134bee58054
Closes-Bug: #1869319
This commit is contained in:
Q.hongtao 2020-03-27 16:58:12 +08:00 committed by Qitao
parent 969159cc17
commit d0b06f679b
9 changed files with 74 additions and 3 deletions

View File

@ -708,6 +708,9 @@ vitrage
[vitrage-ml:children] [vitrage-ml:children]
vitrage vitrage
[vitrage-persistor:children]
vitrage
# Blazar # Blazar
[blazar-api:children] [blazar-api:children]
blazar blazar

View File

@ -727,6 +727,9 @@ vitrage
[vitrage-ml:children] [vitrage-ml:children]
vitrage vitrage
[vitrage-persistor:children]
vitrage
# Blazar # Blazar
[blazar-api:children] [blazar-api:children]
blazar blazar

View File

@ -31,7 +31,7 @@
rewriterule28 programname ^(ironic-api|ironic-conductor|ironic-inspector)$ openstack_python rewriterule28 programname ^(ironic-api|ironic-conductor|ironic-inspector)$ openstack_python
rewriterule29 programname ^(panko-api|panko-dbsync)$ openstack_python rewriterule29 programname ^(panko-api|panko-dbsync)$ openstack_python
rewriterule30 programname ^(tacker-server|tacker-conductor)$ openstack_python rewriterule30 programname ^(tacker-server|tacker-conductor)$ openstack_python
rewriterule31 programname ^(vitrage-ml|vitrage-notifier|vitrage-graph)$ openstack_python rewriterule31 programname ^(vitrage-ml|vitrage-notifier|vitrage-graph|vitrage-persistor)$ openstack_python
rewriterule32 programname ^(blazar-api|blazar-manager)$ openstack_python rewriterule32 programname ^(blazar-api|blazar-manager)$ openstack_python
rewriterule33 programname ^(cyborg-api|cyborg-conductor|cyborg-agent)$ openstack_python rewriterule33 programname ^(cyborg-api|cyborg-conductor|cyborg-agent)$ openstack_python
rewriterule34 programname ^(monasca-api|monasca-notification|monasca-persister|agent-collector|agent-forwarder|agent-statsd)$ openstack_python rewriterule34 programname ^(monasca-api|monasca-notification|monasca-persister|agent-collector|agent-forwarder|agent-statsd)$ openstack_python

View File

@ -158,7 +158,7 @@
</rule> </rule>
<rule> <rule>
key programname key programname
pattern ^(vitrage-ml|vitrage-notifier|vitrage-graph)$ pattern ^(vitrage-ml|vitrage-notifier|vitrage-graph|vitrage-persistor)$
tag openstack_python tag openstack_python
</rule> </rule>
<rule> <rule>

View File

@ -41,6 +41,13 @@ vitrage_services:
image: "{{ vitrage_ml_image_full }}" image: "{{ vitrage_ml_image_full }}"
volumes: "{{ vitrage_ml_default_volumes + vitrage_ml_extra_volumes }}" volumes: "{{ vitrage_ml_default_volumes + vitrage_ml_extra_volumes }}"
dimensions: "{{ vitrage_ml_dimensions }}" dimensions: "{{ vitrage_ml_dimensions }}"
vitrage-persistor:
container_name: vitrage_persistor
group: vitrage-persistor
enabled: true
image: "{{ vitrage_persistor_image_full }}"
volumes: "{{ vitrage_persistor_default_volumes + vitrage_persistor_extra_volumes }}"
dimensions: "{{ vitrage_persistor_dimensions }}"
#################### ####################
## Database ## Database
@ -72,10 +79,15 @@ vitrage_ml_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ dock
vitrage_ml_tag: "{{ vitrage_tag }}" vitrage_ml_tag: "{{ vitrage_tag }}"
vitrage_ml_image_full: "{{ vitrage_ml_image }}:{{ vitrage_ml_tag }}" vitrage_ml_image_full: "{{ vitrage_ml_image }}:{{ vitrage_ml_tag }}"
vitrage_persistor_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ vitrage_install_type }}-vitrage-persistor"
vitrage_persistor_tag: "{{ vitrage_tag }}"
vitrage_persistor_image_full: "{{ vitrage_persistor_image }}:{{ vitrage_persistor_tag }}"
vitrage_api_dimensions: "{{ default_container_dimensions }}" vitrage_api_dimensions: "{{ default_container_dimensions }}"
vitrage_notifier_dimensions: "{{ default_container_dimensions }}" vitrage_notifier_dimensions: "{{ default_container_dimensions }}"
vitrage_graph_dimensions: "{{ default_container_dimensions }}" vitrage_graph_dimensions: "{{ default_container_dimensions }}"
vitrage_ml_dimensions: "{{ default_container_dimensions }}" vitrage_ml_dimensions: "{{ default_container_dimensions }}"
vitrage_persistor_dimensions: "{{ default_container_dimensions }}"
vitrage_api_default_volumes: vitrage_api_default_volumes:
- "{{ node_config_directory }}/vitrage-api/:{{ container_config_directory }}/:ro" - "{{ node_config_directory }}/vitrage-api/:{{ container_config_directory }}/:ro"
@ -101,12 +113,19 @@ vitrage_ml_default_volumes:
- "{{ '/etc/timezone:/etc/timezone:ro' if kolla_base_distro in ['debian', 'ubuntu'] else '' }}" - "{{ '/etc/timezone:/etc/timezone:ro' if kolla_base_distro in ['debian', 'ubuntu'] else '' }}"
- "{{ kolla_dev_repos_directory ~ '/vitrage/vitrage:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/vitrage' if vitrage_dev_mode | bool else '' }}" - "{{ kolla_dev_repos_directory ~ '/vitrage/vitrage:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/vitrage' if vitrage_dev_mode | bool else '' }}"
- "kolla_logs:/var/log/kolla/" - "kolla_logs:/var/log/kolla/"
vitrage_persistor_default_volumes:
- "{{ node_config_directory }}/vitrage-persistor/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "{{ '/etc/timezone:/etc/timezone:ro' if kolla_base_distro in ['debian', 'ubuntu'] else '' }}"
- "{{ kolla_dev_repos_directory ~ '/vitrage/vitrage:/var/lib/kolla/venv/lib/python' ~ distro_python_version ~ '/site-packages/vitrage' if vitrage_dev_mode | bool else '' }}"
- "kolla_logs:/var/log/kolla/"
vitrage_extra_volumes: "{{ default_extra_volumes }}" vitrage_extra_volumes: "{{ default_extra_volumes }}"
vitrage_api_extra_volumes: "{{ vitrage_extra_volumes }}" vitrage_api_extra_volumes: "{{ vitrage_extra_volumes }}"
vitrage_notifier_extra_volumes: "{{ vitrage_extra_volumes }}" vitrage_notifier_extra_volumes: "{{ vitrage_extra_volumes }}"
vitrage_graph_extra_volumes: "{{ vitrage_extra_volumes }}" vitrage_graph_extra_volumes: "{{ vitrage_extra_volumes }}"
vitrage_ml_extra_volumes: "{{ vitrage_extra_volumes }}" vitrage_ml_extra_volumes: "{{ vitrage_extra_volumes }}"
vitrage_persistor_extra_volumes: "{{ vitrage_extra_volumes }}"
#################### ####################
# OpenStack # OpenStack

View File

@ -58,3 +58,18 @@
dimensions: "{{ service.dimensions }}" dimensions: "{{ service.dimensions }}"
when: when:
- kolla_action != "config" - kolla_action != "config"
- name: Restart vitrage-persistor container
vars:
service_name: "vitrage-persistor"
service: "{{ vitrage_services[service_name] }}"
become: true
kolla_docker:
action: "recreate_or_restart_container"
common_options: "{{ docker_common_options }}"
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes | reject('equalto', '') | list }}"
dimensions: "{{ service.dimensions }}"
when:
- kolla_action != "config"

View File

@ -6,7 +6,8 @@
when: inventory_hostname in groups['vitrage-api'] or when: inventory_hostname in groups['vitrage-api'] or
inventory_hostname in groups['vitrage-ml'] or inventory_hostname in groups['vitrage-ml'] or
inventory_hostname in groups['vitrage-graph'] or inventory_hostname in groups['vitrage-graph'] or
inventory_hostname in groups['vitrage-notifier'] inventory_hostname in groups['vitrage-notifier'] or
inventory_hostname in groups['vitrage-persistor']
- include_tasks: clone.yml - include_tasks: clone.yml
when: vitrage_dev_mode | bool when: vitrage_dev_mode | bool

View File

@ -0,0 +1,24 @@
{
"command": "vitrage-persistor --config-file /etc/vitrage/vitrage.conf",
"config_files": [
{
"source": "{{ container_config_directory }}/vitrage.conf",
"dest": "/etc/vitrage/vitrage.conf",
"owner": "vitrage",
"perm": "0644"
}{% if vitrage_policy_file is defined %},
{
"source": "{{ container_config_directory }}/{{ vitrage_policy_file }}",
"dest": "/etc/vitrage/{{ vitrage_policy_file }}",
"owner": "vitrage",
"perm": "0600"
}{% endif %}
],
"permissions": [
{
"path": "/var/log/kolla/vitrage",
"owner": "vitrage:vitrage",
"recurse": true
}
]
}

View File

@ -0,0 +1,6 @@
---
fixes:
- |
Adds missing ``vitrage-persistor`` service, required by Vitrage
deployments for storing data.
`LP#1869319 <https://launchpad.net/bugs/1869319>`__