From 577bb50a04389fe69cd6245fded69b8a23277b7e Mon Sep 17 00:00:00 2001 From: Kien Nguyen Date: Tue, 6 Nov 2018 10:20:02 +0700 Subject: [PATCH] Add Masakari Ansible role MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Masakari provides Instances High Availability Service for OpenStack clouds by automatically recovering failed Instances. Depends-On: https://review.openstack.org/#/c/615469/ Change-Id: I0b3457232ee86576022cff64eb2e227ff9bbf0aa Implements: blueprint ansible-masakari Co-Authored-By: Gaƫtan Trellu --- README.rst | 1 + ansible/group_vars/all.yml | 4 + ansible/inventory/all-in-one | 9 ++ ansible/inventory/multinode | 9 ++ ansible/roles/common/tasks/config.yml | 1 + .../conf/filter/01-rewrite-0.14.conf.j2 | 5 + .../templates/conf/input/00-global.conf.j2 | 1 + .../templates/cron-logrotate-masakari.conf.j2 | 3 + ansible/roles/common/templates/cron.json.j2 | 1 + ansible/roles/haproxy/tasks/precheck.yml | 13 ++ ansible/roles/horizon/defaults/main.yml | 1 + ansible/roles/horizon/tasks/config.yml | 1 + .../roles/horizon/templates/horizon.json.j2 | 1 + ansible/roles/masakari/defaults/main.yml | 117 ++++++++++++++ ansible/roles/masakari/handlers/main.yml | 48 ++++++ ansible/roles/masakari/meta/main.yml | 3 + ansible/roles/masakari/tasks/bootstrap.yml | 36 +++++ .../masakari/tasks/bootstrap_service.yml | 20 +++ ansible/roles/masakari/tasks/check.yml | 1 + ansible/roles/masakari/tasks/clone.yml | 14 ++ ansible/roles/masakari/tasks/config.yml | 145 ++++++++++++++++++ ansible/roles/masakari/tasks/deploy.yml | 17 ++ ansible/roles/masakari/tasks/loadbalancer.yml | 7 + ansible/roles/masakari/tasks/main.yml | 2 + ansible/roles/masakari/tasks/precheck.yml | 18 +++ ansible/roles/masakari/tasks/pull.yml | 11 ++ ansible/roles/masakari/tasks/reconfigure.yml | 2 + ansible/roles/masakari/tasks/register.yml | 34 ++++ ansible/roles/masakari/tasks/stop.yml | 6 + ansible/roles/masakari/tasks/upgrade.yml | 7 + .../templates/masakari-api-paste.ini.j2 | 44 ++++++ .../masakari/templates/masakari-api.json.j2 | 38 +++++ .../templates/masakari-engine.json.j2 | 29 ++++ .../masakari-instancemonitor.json.j2 | 18 +++ .../templates/masakari-monitors.conf.j2 | 15 ++ .../roles/masakari/templates/masakari.conf.j2 | 53 +++++++ .../masakari/templates/wsgi-masakari.conf.j2 | 30 ++++ ansible/site.yml | 19 +++ doc/source/reference/compute/index.rst | 1 + .../reference/compute/masakari-guide.rst | 34 ++++ etc/kolla/globals.yml | 2 + etc/kolla/passwords.yml | 3 + .../notes/masakari-ddd930cf5db5f713.yaml | 4 + 43 files changed, 828 insertions(+) create mode 100644 ansible/roles/common/templates/cron-logrotate-masakari.conf.j2 create mode 100644 ansible/roles/masakari/defaults/main.yml create mode 100644 ansible/roles/masakari/handlers/main.yml create mode 100644 ansible/roles/masakari/meta/main.yml create mode 100644 ansible/roles/masakari/tasks/bootstrap.yml create mode 100644 ansible/roles/masakari/tasks/bootstrap_service.yml create mode 100644 ansible/roles/masakari/tasks/check.yml create mode 100644 ansible/roles/masakari/tasks/clone.yml create mode 100644 ansible/roles/masakari/tasks/config.yml create mode 100644 ansible/roles/masakari/tasks/deploy.yml create mode 100644 ansible/roles/masakari/tasks/loadbalancer.yml create mode 100644 ansible/roles/masakari/tasks/main.yml create mode 100644 ansible/roles/masakari/tasks/precheck.yml create mode 100644 ansible/roles/masakari/tasks/pull.yml create mode 100644 ansible/roles/masakari/tasks/reconfigure.yml create mode 100644 ansible/roles/masakari/tasks/register.yml create mode 100644 ansible/roles/masakari/tasks/stop.yml create mode 100644 ansible/roles/masakari/tasks/upgrade.yml create mode 100644 ansible/roles/masakari/templates/masakari-api-paste.ini.j2 create mode 100644 ansible/roles/masakari/templates/masakari-api.json.j2 create mode 100644 ansible/roles/masakari/templates/masakari-engine.json.j2 create mode 100644 ansible/roles/masakari/templates/masakari-instancemonitor.json.j2 create mode 100644 ansible/roles/masakari/templates/masakari-monitors.conf.j2 create mode 100644 ansible/roles/masakari/templates/masakari.conf.j2 create mode 100644 ansible/roles/masakari/templates/wsgi-masakari.conf.j2 create mode 100644 doc/source/reference/compute/masakari-guide.rst create mode 100644 releasenotes/notes/masakari-ddd930cf5db5f713.yaml diff --git a/README.rst b/README.rst index 42ca35f9d7..7cb1d9ce6c 100644 --- a/README.rst +++ b/README.rst @@ -62,6 +62,7 @@ Kolla-Ansible deploys containers for the following OpenStack projects: - `Kuryr `__ - `Magnum `__ - `Manila `__ +- `Masakari `__ - `Mistral `__ - `Monasca `__ - `Murano `__ diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 9b5922f3e6..c4997aed48 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -301,6 +301,8 @@ mariadb_wsrep_port: "4567" mariadb_ist_port: "4568" mariadb_sst_port: "4444" +masakari_api_port: "15868" + memcached_port: "11211" mistral_api_port: "8989" @@ -558,6 +560,7 @@ enable_horizon_ironic: "{{ enable_ironic | bool }}" enable_horizon_karbor: "{{ enable_karbor | bool }}" enable_horizon_magnum: "{{ enable_magnum | bool }}" enable_horizon_manila: "{{ enable_manila | bool }}" +enable_horizon_masakari: "{{ enable_masakari | bool }}" enable_horizon_mistral: "{{ enable_mistral | bool }}" enable_horizon_murano: "{{ enable_murano | bool }}" enable_horizon_neutron_vpnaas: "{{ enable_neutron_vpnaas | bool }}" @@ -588,6 +591,7 @@ enable_manila_backend_generic: "no" enable_manila_backend_hnas: "no" enable_manila_backend_cephfs_native: "no" enable_manila_backend_cephfs_nfs: "no" +enable_masakari: "no" enable_mistral: "no" enable_monasca: "no" enable_mongodb: "no" diff --git a/ansible/inventory/all-in-one b/ansible/inventory/all-in-one index 7fbd554ca8..78aa966021 100644 --- a/ansible/inventory/all-in-one +++ b/ansible/inventory/all-in-one @@ -756,3 +756,12 @@ monitoring [prometheus-elasticsearch-exporter:children] elasticsearch + +[masakari-api:children] +control + +[masakari-engine:children] +control + +[masakari-monitors:children] +compute diff --git a/ansible/inventory/multinode b/ansible/inventory/multinode index f8200649f6..28ec388f4e 100644 --- a/ansible/inventory/multinode +++ b/ansible/inventory/multinode @@ -775,3 +775,12 @@ monitoring [prometheus-elasticsearch-exporter:children] elasticsearch + +[masakari-api:children] +control + +[masakari-engine:children] +control + +[masakari-monitors:children] +compute diff --git a/ansible/roles/common/tasks/config.yml b/ansible/roles/common/tasks/config.yml index 94f2068993..401d6a0a34 100644 --- a/ansible/roles/common/tasks/config.yml +++ b/ansible/roles/common/tasks/config.yml @@ -267,6 +267,7 @@ - { name: "magnum", enabled: "{{ enable_magnum }}" } - { name: "manila", enabled: "{{ enable_manila }}" } - { name: "mariadb", enabled: "{{ enable_mariadb }}" } + - { name: "masakari", enabled: "{{ enable_masakari }}" } - { name: "mistral", enabled: "{{ enable_mistral }}" } - { name: "monasca", enabled: "{{ enable_monasca }}" } - { name: "mongodb", enabled: "{{ enable_mongodb }}" } diff --git a/ansible/roles/common/templates/conf/filter/01-rewrite-0.14.conf.j2 b/ansible/roles/common/templates/conf/filter/01-rewrite-0.14.conf.j2 index 11c0549cfa..a85735bdbc 100644 --- a/ansible/roles/common/templates/conf/filter/01-rewrite-0.14.conf.j2 +++ b/ansible/roles/common/templates/conf/filter/01-rewrite-0.14.conf.j2 @@ -176,6 +176,11 @@ pattern ^(monasca-api|monasca-notification|monasca-persister|agent-collector|agent-forwarder|agent-statsd)$ tag openstack_python + + key programname + pattern ^(masakari-engine|masakari-api)$ + tag openstack_python + key programname pattern .+ diff --git a/ansible/roles/common/templates/conf/input/00-global.conf.j2 b/ansible/roles/common/templates/conf/input/00-global.conf.j2 index db0a457dbf..36374d409a 100644 --- a/ansible/roles/common/templates/conf/input/00-global.conf.j2 +++ b/ansible/roles/common/templates/conf/input/00-global.conf.j2 @@ -22,6 +22,7 @@ ( 'kuryr', enable_kuryr ), ( 'magnum', enable_magnum ), ( 'manila', enable_manila ), + ( 'masakari', enable_masakari ), ( 'mistral', enable_mistral ), ( 'monasca', enable_monasca ), ( 'mongodb', enable_mongodb ), diff --git a/ansible/roles/common/templates/cron-logrotate-masakari.conf.j2 b/ansible/roles/common/templates/cron-logrotate-masakari.conf.j2 new file mode 100644 index 0000000000..8f71f0975f --- /dev/null +++ b/ansible/roles/common/templates/cron-logrotate-masakari.conf.j2 @@ -0,0 +1,3 @@ +"/var/log/kolla/masakari/*.log" +{ +} diff --git a/ansible/roles/common/templates/cron.json.j2 b/ansible/roles/common/templates/cron.json.j2 index 593e2f6178..69260144be 100644 --- a/ansible/roles/common/templates/cron.json.j2 +++ b/ansible/roles/common/templates/cron.json.j2 @@ -35,6 +35,7 @@ ( 'magnum', enable_magnum ), ( 'manila', enable_manila ), ( 'mariadb', enable_mariadb ), + ( 'masakari', enable_masakari ), ( 'mistral', enable_mistral ), ( 'monasca', enable_monasca ), ( 'mongodb', enable_mongodb ), diff --git a/ansible/roles/haproxy/tasks/precheck.yml b/ansible/roles/haproxy/tasks/precheck.yml index f3a0dffc2c..2dde07b845 100644 --- a/ansible/roles/haproxy/tasks/precheck.yml +++ b/ansible/roles/haproxy/tasks/precheck.yml @@ -517,6 +517,19 @@ - haproxy_stat.find('mariadb') == -1 - "host_running_haproxy == 'None'" +- name: Checking free port for Masakari API HAProxy + wait_for: + host: "{{ kolla_internal_vip_address }}" + port: "{{ masakari_api_port }}" + connect_timeout: 1 + timeout: 1 + state: stopped + when: + - enable_masakari | bool + - inventory_hostname in groups['haproxy'] + - haproxy_stat.find('masakari_api') == -1 + - "host_running_haproxy == 'None'" + - name: Checking free port for Mistral API HAProxy wait_for: host: "{{ kolla_internal_vip_address }}" diff --git a/ansible/roles/horizon/defaults/main.yml b/ansible/roles/horizon/defaults/main.yml index cda8f0202e..a0d2b85da7 100644 --- a/ansible/roles/horizon/defaults/main.yml +++ b/ansible/roles/horizon/defaults/main.yml @@ -19,6 +19,7 @@ horizon_services: ENABLE_KARBOR: "{{ 'yes' if enable_horizon_karbor | bool else 'no' }}" ENABLE_MAGNUM: "{{ 'yes' if enable_horizon_magnum | bool else 'no' }}" ENABLE_MANILA: "{{ 'yes' if enable_horizon_manila | bool else 'no' }}" + ENABLE_MASAKARI: "{{ 'yes' if enable_horizon_masakari | bool else 'no' }}" ENABLE_MISTRAL: "{{ 'yes' if enable_horizon_mistral | bool else 'no' }}" ENABLE_MURANO: "{{ 'yes' if enable_horizon_murano | bool else 'no' }}" ENABLE_NEUTRON_VPNAAS: "{{ 'yes' if enable_horizon_neutron_vpnaas | bool else 'no' }}" diff --git a/ansible/roles/horizon/tasks/config.yml b/ansible/roles/horizon/tasks/config.yml index 59242ba04a..6e028cc6d6 100644 --- a/ansible/roles/horizon/tasks/config.yml +++ b/ansible/roles/horizon/tasks/config.yml @@ -33,6 +33,7 @@ - { name: "karbor", enabled: "{{ enable_horizon_karbor }}" } - { name: "magnum", enabled: "{{ enable_horizon_magnum }}" } - { name: "manila", enabled: "{{ enable_horizon_manila }}" } + - { name: "masakari", enabled: "{{ enable_horizon_masakari }}" } - { name: "mistral", enabled: "{{ enable_horizon_mistral }}" } - { name: "murano", enabled: "{{ enable_horizon_murano }}" } - { name: "neutron", enabled: "{{ enable_neutron_horizon_policy_file }}" } diff --git a/ansible/roles/horizon/templates/horizon.json.j2 b/ansible/roles/horizon/templates/horizon.json.j2 index 1b302cd815..b4e46fd1ea 100644 --- a/ansible/roles/horizon/templates/horizon.json.j2 +++ b/ansible/roles/horizon/templates/horizon.json.j2 @@ -14,6 +14,7 @@ ( 'karbor', enable_horizon_karbor ), ( 'magnum', enable_horizon_magnum ), ( 'manila', enable_horizon_manila ), + ( 'masakari', enable_horizon_masakari ), ( 'mistral', enable_horizon_mistral ), ( 'murano', enable_horizon_murano ), ( 'neutron', enable_neutron ), diff --git a/ansible/roles/masakari/defaults/main.yml b/ansible/roles/masakari/defaults/main.yml new file mode 100644 index 0000000000..e48d1fff79 --- /dev/null +++ b/ansible/roles/masakari/defaults/main.yml @@ -0,0 +1,117 @@ +--- +project_name: "masakari" + +masakari_services: + masakari-api: + container_name: masakari_api + group: masakari-api + enabled: true + image: "{{ masakari_api_image_full }}" + volumes: "{{ masakari_api_default_volumes + masakari_api_extra_volumes }}" + dimensions: "{{ masakari_api_dimensions }}" + haproxy: + masakari_api: + enabled: "{{ enable_masakari }}" + mode: "http" + external: false + port: "{{ masakari_api_port }}" + masakari_api_external: + enabled: "{{ enable_masakari }}" + mode: "http" + external: true + port: "{{ masakari_api_port }}" + masakari-engine: + container_name: masakari_engine + group: masakari-engine + enabled: true + image: "{{ masakari_engine_image_full }}" + volumes: "{{ masakari_engine_default_volumes + masakari_engine_extra_volumes }}" + dimensions: "{{ masakari_engine_dimensions }}" + masakari-instancemonitor: + container_name: masakari_instancemonitor + group: masakari-monitors + enabled: true + image: "{{ masakari_monitors_image_full }}" + volumes: "{{ masakari_instancemonitor_default_volumes + masakari_instancemonitor_extra_volumes }}" + privileged: True + dimensions: "{{ masakari_monitors_dimensions }}" + + +#################### +# Database +#################### +masakari_database_name: "masakari" +masakari_database_user: "{% if use_preconfigured_databases | bool and use_common_mariadb_user | bool %}{{ database_user }}{% else %}masakari{% endif %}" +masakari_database_address: "{{ database_address }}:{{ database_port }}" + +#################### +# Docker +#################### +masakari_install_type: "{{ kolla_install_type }}" +masakari_tag: "{{ openstack_release }}" + +masakari_api_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ masakari_install_type }}-masakari-api" +masakari_api_tag: "{{ masakari_tag }}" +masakari_api_image_full: "{{ masakari_api_image }}:{{ masakari_api_tag }}" + +masakari_engine_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ masakari_install_type }}-masakari-engine" +masakari_engine_tag: "{{ masakari_tag }}" +masakari_engine_image_full: "{{ masakari_engine_image }}:{{ masakari_engine_tag }}" + +masakari_monitors_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ masakari_install_type }}-masakari-monitors" +masakari_monitors_tag: "{{ masakari_tag }}" +masakari_monitors_image_full: "{{ masakari_monitors_image }}:{{ masakari_monitors_tag }}" + +masakari_api_dimensions: "{{ default_container_dimensions }}" +masakari_engine_dimensions: "{{ default_container_dimensions }}" +masakari_monitors_dimensions: "{{ default_container_dimensions }}" + +masakari_extra_volumes: "{{ default_extra_volumes }}" +masakari_api_extra_volumes: "{{ masakari_extra_volumes }}" +masakari_engine_extra_volumes: "{{ masakari_extra_volumes }}" +masakari_instancemonitor_extra_volumes: "{{ masakari_extra_volumes }}" + +masakari_api_default_volumes: + - "{{ node_config_directory }}/masakari-api/:{{ container_config_directory }}/:ro" + - "/etc/localtime:/etc/localtime:ro" + - "kolla_logs:/var/log/kolla/" + - "{{ kolla_dev_repos_directory ~ '/masakari/masakari:/var/lib/kolla/venv/lib/python2.7/site-packages/masakari' if masakari_dev_mode | bool else '' }}" +masakari_engine_default_volumes: + - "{{ node_config_directory }}/masakari-engine/:{{ container_config_directory }}/:ro" + - "/etc/localtime:/etc/localtime:ro" + - "kolla_logs:/var/log/kolla/" + - "{{ kolla_dev_repos_directory ~ '/masakari/masakari:/var/lib/kolla/venv/lib/python2.7/site-packages/masakari' if masakari_dev_mode | bool else '' }}" + - "masakari:/var/lib/masakari/" +masakari_instancemonitor_default_volumes: + - "{{ node_config_directory }}/masakari-engine/:{{ container_config_directory }}/:ro" + - "/etc/localtime:/etc/localtime:ro" + - "kolla_logs:/var/log/kolla/" + - "{{ kolla_dev_repos_directory ~ '/masakari/masakari:/var/lib/kolla/venv/lib/python2.7/site-packages/masakari' if masakari_dev_mode | bool else '' }}" + + +#################### +# OpenStack +#################### +masakari_admin_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ masakari_api_port }}" +masakari_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ masakari_api_port }}" +masakari_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ masakari_api_port }}" + +masakari_logging_debug: "{{ openstack_logging_debug }}" + +masakari_keystone_user: "masakari" + +openstack_masakari_auth: "{{ openstack_auth }}" + + +#################### +# Kolla +#################### +masakari_git_repository: "{{ kolla_dev_repos_git }}/{{ project_name }}" +masakari_dev_repos_pull: "{{ kolla_dev_repos_pull }}" +masakari_dev_mode: "{{ kolla_dev_mode }}" +masakari_source_version: "{{ kolla_source_version }}" + +masakari_monitors_git_repository: "{{ kolla_dev_repos_git }}/masakarimonitors" +masakari_monitors_dev_repos_pull: "{{ kolla_dev_repos_pull }}" +masakari_monitors_dev_mode: "{{ kolla_dev_mode }}" +masakari_monitors_source_version: "{{ kolla_source_version }}" diff --git a/ansible/roles/masakari/handlers/main.yml b/ansible/roles/masakari/handlers/main.yml new file mode 100644 index 0000000000..a6e63facb1 --- /dev/null +++ b/ansible/roles/masakari/handlers/main.yml @@ -0,0 +1,48 @@ +--- +- name: Restart masakari-api container + vars: + service_name: "masakari-api" + service: "{{ masakari_services[service_name] }}" + become: true + kolla_docker: + action: "recreate_or_restart_container" + common_options: "{{ docker_common_options }}" + name: "{{ service.container_name }}" + image: "{{ service.image }}" + privileged: "{{ service.privileged | default(False) }}" + volumes: "{{ service.volumes|reject('equalto', '')|list }}" + dimensions: "{{ service.dimensions }}" + when: + - kolla_action != "config" + +- name: Restart masakari-engine container + vars: + service_name: "masakari-engine" + service: "{{ masakari_services[service_name] }}" + become: true + kolla_docker: + action: "recreate_or_restart_container" + common_options: "{{ docker_common_options }}" + name: "{{ service.container_name }}" + image: "{{ service.image }}" + privileged: "{{ service.privileged | default(False) }}" + volumes: "{{ service.volumes|reject('equalto', '')|list }}" + dimensions: "{{ service.dimensions }}" + when: + - kolla_action != "config" + +- name: Restart masakari-instancemonitor container + vars: + service_name: "masakari-instancemonitor" + service: "{{ masakari_services[service_name] }}" + become: true + kolla_docker: + action: "recreate_or_restart_container" + common_options: "{{ docker_common_options }}" + name: "{{ service.container_name }}" + image: "{{ service.image }}" + privileged: "{{ service.privileged | default(True) }}" + volumes: "{{ service.volumes|reject('equalto', '')|list }}" + dimensions: "{{ service.dimensions }}" + when: + - kolla_action != "config" diff --git a/ansible/roles/masakari/meta/main.yml b/ansible/roles/masakari/meta/main.yml new file mode 100644 index 0000000000..6b4fff8fef --- /dev/null +++ b/ansible/roles/masakari/meta/main.yml @@ -0,0 +1,3 @@ +--- +dependencies: + - { role: common } diff --git a/ansible/roles/masakari/tasks/bootstrap.yml b/ansible/roles/masakari/tasks/bootstrap.yml new file mode 100644 index 0000000000..da4e7eb545 --- /dev/null +++ b/ansible/roles/masakari/tasks/bootstrap.yml @@ -0,0 +1,36 @@ +--- +- name: Creating Masakari database + become: true + kolla_toolbox: + module_name: mysql_db + module_args: + login_host: "{{ database_address }}" + login_port: "{{ database_port }}" + login_user: "{{ database_user }}" + login_password: "{{ database_password }}" + name: "{{ masakari_database_name }}" + run_once: True + delegate_to: "{{ groups['masakari-api'][0] }}" + when: + - not use_preconfigured_databases | bool + +- name: Creating Masakari database user and setting permissions + become: true + kolla_toolbox: + module_name: mysql_user + module_args: + login_host: "{{ database_address }}" + login_port: "{{ database_port }}" + login_user: "{{ database_user }}" + login_password: "{{ database_password }}" + name: "{{ masakari_database_user }}" + password: "{{ masakari_database_password }}" + host: "%" + priv: "{{ masakari_database_name }}.*:ALL" + append_privs: "yes" + run_once: True + delegate_to: "{{ groups['masakari-api'][0] }}" + when: + - not use_preconfigured_databases | bool + +- include_tasks: bootstrap_service.yml diff --git a/ansible/roles/masakari/tasks/bootstrap_service.yml b/ansible/roles/masakari/tasks/bootstrap_service.yml new file mode 100644 index 0000000000..465032d3e8 --- /dev/null +++ b/ansible/roles/masakari/tasks/bootstrap_service.yml @@ -0,0 +1,20 @@ +--- +- name: Running Masakari bootstrap container + vars: + masakari_api: "{{ masakari_services['masakari-api'] }}" + become: true + kolla_docker: + action: "start_container" + common_options: "{{ docker_common_options }}" + detach: False + environment: + KOLLA_BOOTSTRAP: + KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" + image: "{{ masakari_api.image }}" + labels: + BOOTSTRAP: + name: "bootstrap_masakari" + restart_policy: "no" + volumes: "{{ masakari_api.volumes|reject('equalto', '')|list }}" + run_once: True + delegate_to: "{{ groups[masakari_api.group][0] }}" diff --git a/ansible/roles/masakari/tasks/check.yml b/ansible/roles/masakari/tasks/check.yml new file mode 100644 index 0000000000..ed97d539c0 --- /dev/null +++ b/ansible/roles/masakari/tasks/check.yml @@ -0,0 +1 @@ +--- diff --git a/ansible/roles/masakari/tasks/clone.yml b/ansible/roles/masakari/tasks/clone.yml new file mode 100644 index 0000000000..8d0fe912b8 --- /dev/null +++ b/ansible/roles/masakari/tasks/clone.yml @@ -0,0 +1,14 @@ +--- +- name: Cloning masakari source repository for development + git: + repo: "{{ masakari_git_repository }}" + dest: "{{ kolla_dev_repos_directory }}/{{ project_name }}" + update: "{{ masakari_dev_repos_pull }}" + version: "{{ masakari_source_version }}" + +- name: Cloning masakarimonitors source repository for development + git: + repo: "{{ masakarimonitors_git_repository }}" + dest: "{{ kolla_dev_repos_directory }}/masakarimonitors" + update: "{{ masakarimonitors_dev_repos_pull }}" + version: "{{ masakarimonitors_source_version }}" diff --git a/ansible/roles/masakari/tasks/config.yml b/ansible/roles/masakari/tasks/config.yml new file mode 100644 index 0000000000..3028aeb258 --- /dev/null +++ b/ansible/roles/masakari/tasks/config.yml @@ -0,0 +1,145 @@ +--- +- name: Ensuring config directories exist + file: + path: "{{ node_config_directory }}/{{ item.key }}" + state: "directory" + owner: "{{ config_owner_user }}" + group: "{{ config_owner_group }}" + mode: "0770" + become: true + when: + - item.value.enabled | bool + - inventory_hostname in groups[item.value.group] + with_dict: "{{ masakari_services }}" + +- name: Check if policies shall be overwritten + local_action: stat path="{{ item }}" + run_once: True + register: masakari_policy + with_first_found: + - files: "{{ supported_policy_format_list }}" + paths: + - "{{ node_custom_config }}/masakari/" + skip: true + +- name: Set masakari policy file + set_fact: + masakari_policy_file: "{{ masakari_policy.results.0.stat.path | basename }}" + masakari_policy_file_path: "{{ masakari_policy.results.0.stat.path }}" + when: + - masakari_policy.results + +- name: Copying over existing policy file + template: + src: "{{ masakari_policy_file_path }}" + dest: "{{ node_config_directory }}/{{ item }}/{{ masakari_policy_file }}" + mode: "0660" + become: true + when: + - masakari_policy_file is defined + - inventory_hostname in groups[item.value.group] + - item.value.enabled | bool + with_dict: "{{ masakari_services }}" + notify: + - Restart {{ item.key }} container + +- name: Copying over config.json files for services + template: + src: "{{ item.key }}.json.j2" + dest: "{{ node_config_directory }}/{{ item.key }}/config.json" + mode: "0660" + become: true + when: + - inventory_hostname in groups[item.value.group] + - item.value.enabled | bool + with_dict: "{{ masakari_services }}" + notify: + - Restart {{ item.key }} container + +- name: Copying over masakari.conf + vars: + service: "{{ item.key }}" + merge_configs: + sources: + - "{{ role_path }}/templates/masakari.conf.j2" + - "{{ node_custom_config }}/global.conf" + - "{{ node_custom_config }}/masakari.conf" + - "{{ node_custom_config }}/masakari/{{ item.key }}.conf" + - "{{ node_custom_config }}/masakari/{{ inventory_hostname }}/masakari.conf" + dest: "{{ node_config_directory }}/{{ item.key }}/masakari.conf" + mode: "0660" + become: true + when: + - inventory_hostname in groups[item.value.group] + - item.value.enabled | bool + with_dict: "{{ masakari_services }}" + notify: + - Restart {{ item.key }} container + +- name: Copying over masakari-monitors.conf + vars: + service: "{{ item.key }}" + merge_configs: + sources: + - "{{ role_path }}/templates/masakari-monitors.conf.j2" + - "{{ node_custom_config }}/global.conf" + - "{{ node_custom_config }}/masakari/{{ item.key }}.conf" + - "{{ node_custom_config }}/masakari/masakari-monitors.conf" + - "{{ node_custom_config }}/masakari/{{ inventory_hostname }}/masakari-monitors.conf" + dest: "{{ node_config_directory }}/{{ item.key }}/masakari-monitors.conf" + mode: "0660" + become: true + when: + - inventory_hostname in groups[item.value.group] + - item.value.enabled | bool + with_dict: "{{ masakari_services }}" + notify: + - Restart {{ item.key }} container + +- name: Copying over wsgi-masakari file for services + vars: + service: "{{ masakari_services['masakari-api'] }}" + template: + src: "wsgi-masakari.conf.j2" + dest: "{{ node_config_directory }}/masakari-api/wsgi-masakari.conf" + mode: "0660" + become: true + when: + - inventory_hostname in groups[service.group] + - service.enabled | bool + notify: + - Restart masakari-api container + +- name: Copying over masakari-api-paste.ini + vars: + service: "{{ masakari_services['masakari-api'] }}" + merge_configs: + sources: + - "{{ role_path }}/templates/masakari-api-paste.ini.j2" + - "{{ node_custom_config }}/masakari/masakari-api/masakari-api-paste.ini" + dest: "{{ node_config_directory }}/masakari-api/masakari-api-paste.ini" + mode: "0660" + become: true + when: + - inventory_hostname in groups[service.group] + - service.enabled | bool + notify: + - Restart masakari-api container + +- name: Check masakari containers + become: true + kolla_docker: + action: "compare_container" + common_options: "{{ docker_common_options }}" + name: "{{ item.value.container_name }}" + image: "{{ item.value.image }}" + privileged: "{{ item.value.privileged | default(False) }}" + volumes: "{{ item.value.volumes | reject('equalto', '') | list }}" + dimensions: "{{ item.value.dimensions }}" + when: + - kolla_action != "config" + - inventory_hostname in groups[item.value.group] + - item.value.enabled | bool + with_dict: "{{ masakari_services }}" + notify: + - Restart {{ item.key }} container diff --git a/ansible/roles/masakari/tasks/deploy.yml b/ansible/roles/masakari/tasks/deploy.yml new file mode 100644 index 0000000000..e63d0d841f --- /dev/null +++ b/ansible/roles/masakari/tasks/deploy.yml @@ -0,0 +1,17 @@ +--- +- include_tasks: register.yml + when: inventory_hostname in groups['masakari-api'] + +- include_tasks: config.yml + when: inventory_hostname in groups['masakari-api'] or + inventory_hostname in groups['masakari-engine'] or + inventory_hostname in groups['masakari-monitors'] + +- include_tasks: clone.yml + when: masakari_dev_mode | bool + +- include_tasks: bootstrap.yml + when: inventory_hostname in groups['masakari-api'] + +- name: Flush handlers + meta: flush_handlers diff --git a/ansible/roles/masakari/tasks/loadbalancer.yml b/ansible/roles/masakari/tasks/loadbalancer.yml new file mode 100644 index 0000000000..7154eca6a1 --- /dev/null +++ b/ansible/roles/masakari/tasks/loadbalancer.yml @@ -0,0 +1,7 @@ +--- +- name: "Configure haproxy for {{ project_name }}" + import_role: + role: haproxy-config + vars: + project_services: "{{ masakari_services }}" + tags: always diff --git a/ansible/roles/masakari/tasks/main.yml b/ansible/roles/masakari/tasks/main.yml new file mode 100644 index 0000000000..bc5d1e6257 --- /dev/null +++ b/ansible/roles/masakari/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: "{{ kolla_action }}.yml" diff --git a/ansible/roles/masakari/tasks/precheck.yml b/ansible/roles/masakari/tasks/precheck.yml new file mode 100644 index 0000000000..fd41f5b631 --- /dev/null +++ b/ansible/roles/masakari/tasks/precheck.yml @@ -0,0 +1,18 @@ +--- +- name: Get container facts + become: true + kolla_container_facts: + name: + - masakari_api + register: container_facts + +- name: Checking free port for Masakari API + wait_for: + host: "{{ api_interface_address }}" + port: "{{ masakari_api_port }}" + connect_timeout: 1 + timeout: 1 + state: stopped + when: + - container_facts['masakari_api'] is not defined + - inventory_hostname in groups['masakari-api'] diff --git a/ansible/roles/masakari/tasks/pull.yml b/ansible/roles/masakari/tasks/pull.yml new file mode 100644 index 0000000000..be6f1e1c0f --- /dev/null +++ b/ansible/roles/masakari/tasks/pull.yml @@ -0,0 +1,11 @@ +--- +- name: Pulling masakari images + become: true + kolla_docker: + action: "pull_image" + common_options: "{{ docker_common_options }}" + image: "{{ item.value.image }}" + when: + - inventory_hostname in groups[item.value.group] + - item.value.enabled | bool + with_dict: "{{ masakari_services }}" diff --git a/ansible/roles/masakari/tasks/reconfigure.yml b/ansible/roles/masakari/tasks/reconfigure.yml new file mode 100644 index 0000000000..f670a5b78d --- /dev/null +++ b/ansible/roles/masakari/tasks/reconfigure.yml @@ -0,0 +1,2 @@ +--- +- include_tasks: deploy.yml diff --git a/ansible/roles/masakari/tasks/register.yml b/ansible/roles/masakari/tasks/register.yml new file mode 100644 index 0000000000..71ad23d7b3 --- /dev/null +++ b/ansible/roles/masakari/tasks/register.yml @@ -0,0 +1,34 @@ +--- +- name: Creating the Masakari service and endpoint + become: true + kolla_toolbox: + module_name: "kolla_keystone_service" + module_args: + service_name: "masakari" + service_type: "instance-ha" + description: "OpenStack High Availability" + endpoint_region: "{{ openstack_region_name }}" + url: "{{ item.url }}" + interface: "{{ item.interface }}" + region_name: "{{ openstack_region_name }}" + auth: "{{ openstack_masakari_auth }}" + endpoint_type: "{{ openstack_interface }}" + run_once: True + with_items: + - {'interface': 'admin', 'url': '{{ masakari_admin_endpoint }}'} + - {'interface': 'internal', 'url': '{{ masakari_internal_endpoint }}'} + - {'interface': 'public', 'url': '{{ masakari_public_endpoint }}'} + +- name: Creating the Masakari project, user, and role + become: true + kolla_toolbox: + module_name: "kolla_keystone_user" + module_args: + project: "service" + user: "{{ masakari_keystone_user }}" + password: "{{ masakari_keystone_password }}" + role: "admin" + region_name: "{{ openstack_region_name }}" + auth: "{{ openstack_masakari_auth }}" + endpoint_type: "{{ openstack_interface }}" + run_once: True diff --git a/ansible/roles/masakari/tasks/stop.yml b/ansible/roles/masakari/tasks/stop.yml new file mode 100644 index 0000000000..9aca7ac741 --- /dev/null +++ b/ansible/roles/masakari/tasks/stop.yml @@ -0,0 +1,6 @@ +--- +- import_role: + role: service-stop + vars: + project_services: "{{ masakari_services }}" + service_name: "{{ project_name }}" diff --git a/ansible/roles/masakari/tasks/upgrade.yml b/ansible/roles/masakari/tasks/upgrade.yml new file mode 100644 index 0000000000..20ccddc8f1 --- /dev/null +++ b/ansible/roles/masakari/tasks/upgrade.yml @@ -0,0 +1,7 @@ +--- +- include_tasks: config.yml + +- include_tasks: bootstrap_service.yml + +- name: Flush handlers + meta: flush_handlers diff --git a/ansible/roles/masakari/templates/masakari-api-paste.ini.j2 b/ansible/roles/masakari/templates/masakari-api-paste.ini.j2 new file mode 100644 index 0000000000..2652477db2 --- /dev/null +++ b/ansible/roles/masakari/templates/masakari-api-paste.ini.j2 @@ -0,0 +1,44 @@ +[composite:masakari_api] +use = call:masakari.api.urlmap:urlmap_factory +/: apiversions +/v1: masakari_api_v1 + +[composite:masakari_api_v1] +use = call:masakari.api.auth:pipeline_factory_v1 +keystone = cors http_proxy_to_wsgi request_id faultwrap sizelimit authtoken keystonecontext osapi_masakari_app_v1 + +# filters +[filter:cors] +paste.filter_factory = oslo_middleware.cors:filter_factory +oslo_config_project = masakari + +[filter:http_proxy_to_wsgi] +paste.filter_factory = oslo_middleware.http_proxy_to_wsgi:HTTPProxyToWSGI.factory + +[filter:request_id] +paste.filter_factory = oslo_middleware:RequestId.factory + +[filter:faultwrap] +paste.filter_factory = masakari.api.openstack:FaultWrapper.factory + +[filter:sizelimit] +paste.filter_factory = oslo_middleware:RequestBodySizeLimiter.factory + +[filter:authtoken] +paste.filter_factory = keystonemiddleware.auth_token:filter_factory + +[filter:keystonecontext] +paste.filter_factory = masakari.api.auth:MasakariKeystoneContext.factory + +[filter:noauth2] +paste.filter_factory = masakari.api.auth:NoAuthMiddleware.factory + +# apps +[app:osapi_masakari_app_v1] +paste.app_factory = masakari.api.openstack.ha:APIRouterV1.factory + +[pipeline:apiversions] +pipeline = faultwrap http_proxy_to_wsgi apiversionsapp + +[app:apiversionsapp] +paste.app_factory = masakari.api.openstack.ha.versions:Versions.factory diff --git a/ansible/roles/masakari/templates/masakari-api.json.j2 b/ansible/roles/masakari/templates/masakari-api.json.j2 new file mode 100644 index 0000000000..51805120f0 --- /dev/null +++ b/ansible/roles/masakari/templates/masakari-api.json.j2 @@ -0,0 +1,38 @@ +{% set masakari_cmd = 'apache2' if kolla_base_distro in ['ubuntu', 'debian'] else 'httpd' %} +{% set masakari_dir = 'apache2/conf-enabled' if kolla_base_distro in ['ubuntu', 'debian'] else 'httpd/conf.d' %} +{ + "command": "{{ masakari_cmd }} -DFOREGROUND", + "config_files": [ + { + "source": "{{ container_config_directory }}/masakari.conf", + "dest": "/etc/masakari/masakari.conf", + "owner": "masakari", + "perm": "0600" + }, + { + "source": "{{ container_config_directory }}/masakari-api-paste.ini", + "dest": "/etc/masakari/api-paste.ini", + "owner": "masakari", + "perm": "0600" + }, + { + "source": "{{ container_config_directory }}/wsgi-masakari.conf", + "dest": "/etc/{{ masakari_dir }}/wsgi-masakari.conf", + "owner": "root", + "perm": "0600" + }{% if masakari_policy_file is defined %}, + { + "source": "{{ container_config_directory }}/{{ masakari_policy_file }}", + "dest": "/etc/masakari/{{ masakari_policy_file }}", + "owner": "masakari", + "perm": "0600" + }{% endif %} + ], + "permissions": [ + { + "path": "/var/log/kolla/masakari", + "owner": "masakari:masakari", + "recurse": true + } + ] +} diff --git a/ansible/roles/masakari/templates/masakari-engine.json.j2 b/ansible/roles/masakari/templates/masakari-engine.json.j2 new file mode 100644 index 0000000000..acee59ab57 --- /dev/null +++ b/ansible/roles/masakari/templates/masakari-engine.json.j2 @@ -0,0 +1,29 @@ +{ + "command": "masakari-engine --config-file /etc/masakari/masakari.conf", + "config_files": [ + { + "source": "{{ container_config_directory }}/masakari.conf", + "dest": "/etc/masakari/masakari.conf", + "owner": "masakari", + "perm": "0600" + }{% if masakari_policy_file is defined %}, + { + "source": "{{ container_config_directory }}/{{ masakari_policy_file }}", + "dest": "/etc/masakari/{{ masakari_policy_file }}", + "owner": "masakari", + "perm": "0600" + }{% endif %} + ], + "permissions": [ + { + "path": "/var/lib/masakari", + "owner": "masakari:masakari", + "recurse": true + }, + { + "path": "/var/log/kolla/masakari", + "owner": "masakari:masakari", + "recurse": true + } + ] +} diff --git a/ansible/roles/masakari/templates/masakari-instancemonitor.json.j2 b/ansible/roles/masakari/templates/masakari-instancemonitor.json.j2 new file mode 100644 index 0000000000..6c04b1afd2 --- /dev/null +++ b/ansible/roles/masakari/templates/masakari-instancemonitor.json.j2 @@ -0,0 +1,18 @@ +{ + "command": "masakari-instancemonitor --config-file /etc/masakari-monitors/masakari-monitors.conf", + "config_files": [ + { + "source": "{{ container_config_directory }}/masakari-monitors.conf", + "dest": "/etc/masakari-monitors/masakari-monitors.conf", + "owner": "masakari", + "perm": "0600" + } + ], + "permissions": [ + { + "path": "/var/log/kolla/masakari", + "owner": "masakari:masakari", + "recurse": true + } + ] +} diff --git a/ansible/roles/masakari/templates/masakari-monitors.conf.j2 b/ansible/roles/masakari/templates/masakari-monitors.conf.j2 new file mode 100644 index 0000000000..c3a3241b6e --- /dev/null +++ b/ansible/roles/masakari/templates/masakari-monitors.conf.j2 @@ -0,0 +1,15 @@ +[DEFAULT] +debug = {{ masakari_logging_debug }} +log_dir = /var/log/kolla/masakari + +[api] +region = {{ openstack_region_name }} +auth_url = {{ keystone_admin_url }} +user_domain_id = {{ default_user_domain_id }} +project_name = service +project_domain_id = {{ default_project_domain_id }} +username = {{ masakari_keystone_user }} +password = {{ masakari_keystone_password }} + +[libvirt] +connection_uri = "qemu+tcp://{{ migration_interface_address }}/system" diff --git a/ansible/roles/masakari/templates/masakari.conf.j2 b/ansible/roles/masakari/templates/masakari.conf.j2 new file mode 100644 index 0000000000..b8d97c6f58 --- /dev/null +++ b/ansible/roles/masakari/templates/masakari.conf.j2 @@ -0,0 +1,53 @@ +[DEFAULT] +debug = {{ masakari_logging_debug }} +log_dir = /var/log/kolla/masakari +masakari_api_listen = {{ api_interface_address }} +masakari_api_listen_port = {{ masakari_api_port }} +enabled_apis = masakari_api +state_path = /var/lib/masakari +transport_url = {{ rpc_transport_url }} +os_user_domain_name = {{ default_user_domain_id }} +os_project_domain_name = {{ default_project_domain_id }} +os_privileged_user_tenant = service +os_privileged_user_auth_url = {{ keystone_internal_url }}/v3 +os_privileged_user_name = {{ nova_keystone_user }} +os_privileged_user_password = {{ nova_keystone_password }} + +[database] +connection = mysql+pymysql://{{ masakari_database_user }}:{{ masakari_database_password }}@{{ masakari_database_address }}/{{ masakari_database_name }} +max_retries = -1 + +[keystone_authtoken] +www_authenticate_uri = {{ keystone_internal_url }}/v3 +auth_url = {{ keystone_admin_url }} +auth_type = password +project_domain_name = {{ default_project_domain_name }} +user_domain_name = {{ default_user_domain_name }} +project_name = service +username = {{ masakari_keystone_user }} +password = {{ masakari_keystone_password }} +service_token_roles_required = True +region_name = {{ openstack_region_name }} + +{% if enable_memcached | bool %} +memcache_security_strategy = ENCRYPT +memcache_secret_key = {{ memcache_secret_key }} +memcached_servers = {% for host in groups['memcached'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ memcached_port }}{% if not loop.last %},{% endif %}{% endfor %} +{% endif %} + +[oslo_messaging_notifications] +transport_url = {{ notify_transport_url }} +{% if enable_ceilometer | bool %} +driver = messagingv2 +topics = notifications +{% else %} +driver = noop +{% endif %} + +[oslo_middleware] +enable_proxy_headers_parsing = True + +{% if masakari_policy_file is defined %} +[oslo_policy] +policy_file = {{ masakari_policy_file }} +{% endif %} diff --git a/ansible/roles/masakari/templates/wsgi-masakari.conf.j2 b/ansible/roles/masakari/templates/wsgi-masakari.conf.j2 new file mode 100644 index 0000000000..a551aa0e75 --- /dev/null +++ b/ansible/roles/masakari/templates/wsgi-masakari.conf.j2 @@ -0,0 +1,30 @@ +{% if kolla_base_distro in ['debian', 'ubuntu'] %} + {% set python_path = '/usr/lib/python3/dist-packages' if masakari_install_type == 'binary' else '/var/lib/kolla/venv/lib/python' + distro_python_version + '/site-packages' %} +{% else %} + {% set python_path = '/usr/lib/python2.7/site-packages' if masakari_install_type == 'binary' else '/var/lib/kolla/venv/lib/python' + distro_python_version + '/site-packages' %} +{% endif %} +{% set binary_path = '/usr/bin' if masakari_install_type == 'binary' else '/var/lib/kolla/venv/bin' %} + +Listen {{ api_interface_address }}:{{ masakari_api_port }} + +ServerSignature Off +ServerTokens Prod +TraceEnable off + + + + Options Indexes FollowSymLinks MultiViews + Require all granted + + + + + ## Logging + ErrorLog "/var/log/kolla/masakari/masakari_wsgi_error.log" + LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b %D \"%{Referer}i\" \"%{User-Agent}i\"" logformat + CustomLog "/var/log/kolla/masakari/masakari_wsgi_access.log" logformat + WSGIApplicationGroup %{GLOBAL} + WSGIDaemonProcess masakari group=masakari processes={{ openstack_service_workers }} threads=1 user=masakari python-path={{ python_path }} + WSGIProcessGroup masakari + WSGIScriptAlias / "{{ binary_path }}/masakari-wsgi" + diff --git a/ansible/site.yml b/ansible/site.yml index 1e590a6767..362890eabe 100644 --- a/ansible/site.yml +++ b/ansible/site.yml @@ -53,6 +53,7 @@ - enable_magnum_{{ enable_magnum | bool }} - enable_manila_{{ enable_manila | bool }} - enable_mariadb_{{ enable_mariadb | bool }} + - enable_masakari_{{ enable_masakari | bool }} - enable_memcached_{{ enable_memcached | bool }} - enable_mistral_{{ enable_mistral | bool }} - enable_monasca_{{ enable_monasca | bool }} @@ -244,6 +245,11 @@ tasks_from: loadbalancer tags: mariadb when: enable_mariadb | bool + - include_role: + role: masakari + tasks_from: loadbalancer + tags: masakari + when: enable_masakari | bool - include_role: role: memcached tasks_from: loadbalancer @@ -1241,3 +1247,16 @@ - { role: blazar, tags: blazar, when: enable_blazar | bool } + +- name: Apply role masakari + gather_facts: false + hosts: + - masakari-api + - masakari-engine + - masakari-monitors + - '&enable_masakari_True' + serial: '{{ kolla_serial|default("0") }}' + roles: + - { role: masakari, + tags: masakari, + when: enable_masakari | bool } diff --git a/doc/source/reference/compute/index.rst b/doc/source/reference/compute/index.rst index aa0e86a2bc..5c0020b8c1 100644 --- a/doc/source/reference/compute/index.rst +++ b/doc/source/reference/compute/index.rst @@ -9,6 +9,7 @@ compute services like HyperV, XenServer and so on. :maxdepth: 1 hyperv-guide + masakari-guide nova-fake-driver qinling-guide vmware-guide diff --git a/doc/source/reference/compute/masakari-guide.rst b/doc/source/reference/compute/masakari-guide.rst new file mode 100644 index 0000000000..49e3a75e6a --- /dev/null +++ b/doc/source/reference/compute/masakari-guide.rst @@ -0,0 +1,34 @@ +.. _masakari-guide: + +============================================= +Masakari - Virtual Machines High Availability +============================================= + +Overview +~~~~~~~~ + +Masakari provides Instances High Availability Service for OpenStack clouds by +automatically recovering failed Instances. Currently, Masakari can recover +KVM-based Virtual Machine(VM)s from failure events such as VM process down, +provisioning process down, and nova-compute host failure. Masakari also +provides an API service to manage and control the automated rescue mechanism. + +Kolla deploys Masakari API, Masakari Engine and Masakari Instance Monitor +containers which are the main Masakari components only if ``enable_masakari`` +is set in ``/etc/kolla/globals.yml``. + + +Connection URI to libvirtd +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +By default ``masakari-instancemonitor`` will connect to ``libvirt`` daemon +using ``qemu+tcp://`` connection URI to get events of KVM-based virtual +machines. + +The setting is overridable using custom config, put the content in +``/etc/kolla/config/masakari/masakari-monitors.conf``. + +.. code-block:: ini + + [libvirt] + connection_uri = "xen://{{ migration_interface_address }}/system" diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml index 006c2adc2e..9311fbc726 100644 --- a/etc/kolla/globals.yml +++ b/etc/kolla/globals.yml @@ -242,6 +242,7 @@ #enable_horizon_karbor: "{{ enable_karbor | bool }}" #enable_horizon_magnum: "{{ enable_magnum | bool }}" #enable_horizon_manila: "{{ enable_manila | bool }}" +#enable_horizon_masakari: "{{ enable_masakari | bool }}" #enable_horizon_mistral: "{{ enable_mistral | bool }}" #enable_horizon_murano: "{{ enable_murano | bool }}" #enable_horizon_neutron_vpnaas: "{{ enable_neutron_vpnaas | bool }}" @@ -270,6 +271,7 @@ #enable_manila_backend_hnas: "no" #enable_manila_backend_cephfs_native: "no" #enable_manila_backend_cephfs_nfs: "no" +#enable_masakari: "no" #enable_mistral: "no" #enable_monasca: "no" #enable_mongodb: "no" diff --git a/etc/kolla/passwords.yml b/etc/kolla/passwords.yml index 0dd959b836..7b506ca68e 100644 --- a/etc/kolla/passwords.yml +++ b/etc/kolla/passwords.yml @@ -193,6 +193,9 @@ zun_keystone_password: vitrage_database_password: vitrage_keystone_password: +masakari_database_password: +masakari_keystone_password: + memcache_secret_key: qinling_database_password: diff --git a/releasenotes/notes/masakari-ddd930cf5db5f713.yaml b/releasenotes/notes/masakari-ddd930cf5db5f713.yaml new file mode 100644 index 0000000000..3277ac14da --- /dev/null +++ b/releasenotes/notes/masakari-ddd930cf5db5f713.yaml @@ -0,0 +1,4 @@ +--- +features: + - Ansible role and shared configuration to deploy + Masakari with Kolla-ansible.