WIP Stacklight install 43/52043/10
authorDelia Popescu <delia.popescu@enea.com>
Mon, 12 Feb 2018 13:04:09 +0000 (15:04 +0200)
committerDelia Popescu <delia.popescu@enea.com>
Tue, 20 Feb 2018 16:36:29 +0000 (18:36 +0200)
Some state changes will be made

[alav]
- add new deploy arg `-M` which enables Stacklight installation;
- adjust `do_templates` to support env vars during 1st stage parsing;
- states: stacklight: use `notify`, minor style edits;
- move stacklight reclass dir to common-ha;
- add stacklight classes for ovs-ha scenario, based on
  common-ha/stacklight, move scenario specifics there;
- add stacklight state (conditional) for NOVCP scenarios;

NOTE: For NOVCP, a lot more changes are needed, including aligning
hostnames / IPs of StackLight node definitions with the existing
kvm (ctl) nodes.

Most likely, the current state of this change does NOT work and serves
only as a PoC for the desired integration.

TOOD:
- move all passwords outside hardcoded reclass;
- add stacklight classes for the rest of HA scenarios (odl, dpdk);
- novcp: add conditions for stacklight nodes class inheritance;
- novcp: override hostnames to kvm0*;

JIRA: FUEL-308

Change-Id: I4bac4f460e8ebf834fcffbcc697d56b1b9e82a06
Signed-off-by: Delia Popescu <delia.popescu@enea.com>
19 files changed:
ci/deploy.sh
mcp/config/scenario/os-nosdn-nofeature-ha.yaml.j2
mcp/config/states/stacklight [new file with mode: 0755]
mcp/reclass/classes/cluster/mcp-pike-common-ha/infra/config.yml.j2 [moved from mcp/reclass/classes/cluster/mcp-pike-common-ha/infra/config.yml with 92% similarity]
mcp/reclass/classes/cluster/mcp-pike-common-ha/infra/init.yml.j2
mcp/reclass/classes/cluster/mcp-pike-common-ha/infra/kvm.yml.j2 [moved from mcp/reclass/classes/cluster/mcp-pike-common-ha/infra/kvm.yml with 64% similarity]
mcp/reclass/classes/cluster/mcp-pike-common-ha/infra/kvm_pdf.yml.j2 [deleted file]
mcp/reclass/classes/cluster/mcp-pike-common-ha/stacklight/client.yml [new file with mode: 0644]
mcp/reclass/classes/cluster/mcp-pike-common-ha/stacklight/init.yml [new file with mode: 0644]
mcp/reclass/classes/cluster/mcp-pike-common-ha/stacklight/log.yml [new file with mode: 0644]
mcp/reclass/classes/cluster/mcp-pike-common-ha/stacklight/log_curator.yml [new file with mode: 0644]
mcp/reclass/classes/cluster/mcp-pike-common-ha/stacklight/monitor.yml [new file with mode: 0644]
mcp/reclass/classes/cluster/mcp-pike-common-ha/stacklight/proxy.yml [new file with mode: 0644]
mcp/reclass/classes/cluster/mcp-pike-common-ha/stacklight/telemetry.yml [new file with mode: 0644]
mcp/reclass/classes/cluster/mcp-pike-ovs-ha/stacklight/log.yml [new file with mode: 0644]
mcp/reclass/classes/cluster/mcp-pike-ovs-ha/stacklight/monitor.yml [new file with mode: 0644]
mcp/reclass/classes/cluster/mcp-pike-ovs-ha/stacklight/proxy.yml [new file with mode: 0644]
mcp/reclass/classes/cluster/mcp-pike-ovs-ha/stacklight/telemetry.yml [new file with mode: 0644]
mcp/scripts/lib.sh

index c35eb9a..de3d6e6 100755 (executable)
@@ -38,7 +38,7 @@ $(notify "USAGE:" 2)
   $(basename "$0") -l lab-name -p pod-name -s deploy-scenario \\
     [-b Lab Config Base URI] \\
     [-S storage-dir] [-L /path/to/log/file.tar.gz] \\
-    [-f[f]] [-F] [-e | -E[E]] [-d] [-D] [-N]
+    [-f[f]] [-F] [-e | -E[E]] [-d] [-D] [-M] [-N]
 
 $(notify "OPTIONS:" 2)
   -b  Base-uri for the stack-configuration structure
@@ -55,6 +55,7 @@ $(notify "OPTIONS:" 2)
   -s  Deploy-scenario short-name
   -S  Storage dir for VM images
   -L  Deployment log path and file name
+  -M  Enable StackLight installation
   -N  Experimental: Do not virtualize control plane (novcp)
 
 $(notify_i "Description:" 2)
@@ -100,6 +101,8 @@ $(notify_i "Input parameters to the build script are:" 2)
 -s Deployment-scenario, this points to a short deployment scenario name, which
    has to be defined in config directory (e.g. os-odl-nofeature-ha).
 -S Storage dir for VM images, default is mcp/deploy/images
+-M Install and configure Mirantis StackLight (the Logging, Monitoring and
+   Alerting toolchain of Mirantis Openstack)
 
 $(notify_i "[NOTE] sudo & virsh priviledges are needed for this script to run" 3)
 
@@ -135,6 +138,7 @@ USE_EXISTING_INFRA=${USE_EXISTING_INFRA:-0}
 INFRA_CREATION_ONLY=${INFRA_CREATION_ONLY:-0}
 NO_DEPLOY_ENVIRONMENT=${NO_DEPLOY_ENVIRONMENT:-0}
 ERASE_ENV=${ERASE_ENV:-0}
+MCP_STACKLIGHT=${MCP_STACKLIGHT:-0}
 MCP_VCP=${MCP_VCP:-1}
 
 source "${DEPLOY_DIR}/globals.sh"
@@ -148,7 +152,7 @@ source "${DEPLOY_DIR}/lib.sh"
 # BEGIN of main
 #
 set +x
-while getopts "b:dDfEFl:L:Np:Ps:S:he" OPTION
+while getopts "b:dDfEFl:L:MNp:Ps:S:he" OPTION
 do
     case $OPTION in
         b)
@@ -205,6 +209,9 @@ do
                 STORAGE_DIR="${OPTARG}"
             fi
             ;;
+        M)
+            MCP_STACKLIGHT=1
+            ;;
         h)
             usage
             exit 0
@@ -267,8 +274,8 @@ fi
 # Clone git submodules and apply our patches
 make -C "${REPO_ROOT_PATH}/mcp/patches" deepclean patches-import
 
-# Expand scenario files, pod_config based on PDF
-export MCP_VCP
+# Expand scenario files, pod_config based on PDF data and initial env vars
+export MCP_STACKLIGHT MCP_VCP
 SCENARIO_DIR="$(readlink -f "../config/scenario")"
 do_templates "${REPO_ROOT_PATH}" "${STORAGE_DIR}" "${TARGET_LAB}" \
              "${TARGET_POD}" "${BASE_CONFIG_URI}" "${SCENARIO_DIR}"
index 11eb0ed..738cc8c 100644 (file)
@@ -25,6 +25,9 @@ cluster:
 {%- endif %}
     - openstack_ha
     - networks
+{%- if conf.MCP_STACKLIGHT %}
+    - stacklight
+{%- endif %}
 virtual:
   nodes:
     - cfg01
diff --git a/mcp/config/states/stacklight b/mcp/config/states/stacklight
new file mode 100755 (executable)
index 0000000..7247c1e
--- /dev/null
@@ -0,0 +1,94 @@
+#!/bin/bash -e
+##############################################################################
+# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+CI_DEBUG=${CI_DEBUG:-0}; [[ "${CI_DEBUG}" =~ (false|0) ]] || set -x
+
+source "$(dirname "${BASH_SOURCE[0]}")/../../scripts/globals.sh"
+
+# Install the StackLight backends
+notify 'Deploy Elasticsearch' 2
+salt -C 'I@elasticsearch:server' state.sls elasticsearch.server -b 1
+
+notify 'Deploy InfluxDB' 2
+salt -C 'I@influxdb:server' state.sls influxdb -b 1
+salt -C 'I@kibana:server' state.sls kibana.server -b 1
+
+notify 'Deploy Grafana server' 2
+salt -C 'I@grafana:server' state.sls grafana.server -b 1
+
+notify 'Deploy Sensu' 2
+salt -C 'I@nagios:server' state.sls nagios.server
+salt -C 'I@sensu:server and I@rabbitmq:server' state.sls rabbitmq
+salt -C 'I@sensu:server and I@rabbitmq:server' cmd.run 'rabbitmqctl cluster_status'
+salt -C 'I@redis:cluster:role:master' state.sls redis
+salt -C 'I@redis:server' state.sls redis
+salt -C 'I@sensu:server' state.sls sensu -b 1
+salt -C 'I@sensu:client' state.sls sensu
+
+notify 'Configure clients to communicate with the server' 2
+salt -C 'I@elasticsearch:client' state.sls elasticsearch.client.service
+salt -C 'I@kibana:client' state.sls kibana.client.service
+
+notify 'Restart minions on the nodes where clients are installed' 2
+salt -C 'I@kibana:client or I@elasticsearch:client' --async service.restart salt-minion
+sleep 10 # FIXME: no hardcoded timeouts
+
+notify 'Configure elasticsearch, kibana servers' 2
+salt -C 'I@elasticsearch:client' state.sls elasticsearch.client
+salt -C 'I@kibana:client' state.sls kibana.client
+
+# StackLight SOIP (StackLight operational insights pipeline)
+notify 'Restart minions' 2
+salt -C '*' --async service.restart salt-minion; sleep 15 # FIXME: no hardcoded timeouts
+salt -C '*' mine.flush
+
+notify 'Clean grains files' 2
+salt -C '*' file.remove /etc/salt/grains.d/collectd
+salt -C '*' file.remove /etc/salt/grains.d/grafana
+salt -C '*' file.remove /etc/salt/grains.d/heka
+salt -C '*' file.remove /etc/salt/grains.d/sensu
+salt -C '*' file.remove /etc/salt/grains
+
+notify 'Install collectd and heka' 2
+salt -C '*' state.sls collectd -b 1
+salt -C '*' state.sls heka -b 1
+salt -C 'I@sensu:client' state.sls sensu
+salt -C 'I@grafana:collector' state.sls grafana.collector
+
+notify 'Update salt mine' 2
+salt -C '*' state.sls salt.minion.grains -b 1
+salt -C '*' saltutil.refresh_modules
+salt -C '*' mine.update
+
+sleep 5 # FIXME
+
+notify 'Update heka' 2
+salt -C 'I@heka:aggregator:enabled:True or I@heka:remote_collector:enabled:True' state.sls heka -b 1
+
+notify 'Update collectd' 2
+salt -C 'I@collectd:remote_client:enabled:True' state.sls collectd
+
+notify 'Update Nagios' 2
+salt -C 'I@nagios:server' state.sls nagios
+salt -C 'I@nagios:server' service.stop nagios3
+
+notify 'Update sensu' 2
+salt -C 'I@sensu:server' state.sls sensu
+
+notify 'Finalize the configuration of Grafana (add the dashboards)' 2
+salt -C 'I@grafana:client' --async service.restart salt-minion; sleep 10 # FIXME
+salt -C 'I@grafana:client' state.sls grafana.client
+
+notify 'Get StackLight monitor VIP' 2
+vip=$(salt-call pillar.data _param:stacklight_monitor_address --out key|awk '/_param:/ { print $2; }')
+
+salt -G "ipv4:$vip" service.restart remote_collectd
+salt -G "ipv4:$vip" service.restart remote_collector
+salt -G "ipv4:$vip" service.restart aggregator
+salt -G "ipv4:$vip" service.restart nagios3
@@ -21,9 +21,11 @@ classes:
   - system.reclass.storage.system.openstack_database_cluster
   - system.reclass.storage.system.openstack_message_queue_cluster
   - system.reclass.storage.system.openstack_telemetry_cluster
-  # - system.reclass.storage.system.stacklight_log_cluster
-  # - system.reclass.storage.system.stacklight_monitor_cluster
-  # - system.reclass.storage.system.stacklight_telemetry_cluster
+{%- if conf.MCP_STACKLIGHT %}
+  - system.reclass.storage.system.stacklight_log_cluster
+  - system.reclass.storage.system.stacklight_monitor_cluster
+  - system.reclass.storage.system.stacklight_telemetry_cluster
+{%- endif %}
   - system.reclass.storage.system.infra_maas_single
   - cluster.mcp-pike-common-ha.include.lab_proxy_pdf
 parameters:
@@ -108,13 +110,15 @@ parameters:
         openstack_proxy_node02:
           params:
             linux_system_codename: xenial
-        # stacklight_log_node01:
-        #   classes:
-        #     - system.elasticsearch.client.single
-        # stacklight_monitor_node01:
-        #   classes:
-        #     - system.grafana.client.single
-        #     - system.kibana.client.single
+{%- if conf.MCP_STACKLIGHT %}
+        stacklight_log_node01:
+          classes:
+            - system.elasticsearch.client.single
+        stacklight_monitor_node01:
+          classes:
+            - system.grafana.client.single
+            - system.kibana.client.single
+{%- endif %}
         openstack_control_node01:
           classes:
             - cluster.mcp-pike-common-ha.openstack_control_init
index 7f3839e..795773f 100644 (file)
@@ -9,15 +9,17 @@
 classes:
   - system.linux.system.single
   - cluster.all-mcp-arch-common
-  # - cluster.mcp-pike-common-ha.stacklight
-  # - cluster.mcp-pike-common-ha.stacklight.client
+{%- if conf.MCP_STACKLIGHT %}
+  - cluster.mcp-pike-common-ha.stacklight
+  - cluster.mcp-pike-common-ha.stacklight.client
+{%- endif %}
 parameters:
   _param:
     apt_mk_version: nightly
     mcp_repo_version: 1.1
     salt_version: 2016.11
     cluster_domain: ${_param:cluster_name}.local
-    stacklight_environment: ${_param:cluster_domain}
+    stacklight_environment: ${_param:cluster_domain}
     reclass_data_revision: master
     reclass_config_master: ${_param:opnfv_infra_config_pxe_address}
     cluster_public_host: ${_param:openstack_proxy_address}
@@ -5,6 +5,11 @@
 # which accompanies this distribution, and is available at
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
+{#- NOTE: br-{mgmt,ctl} are cross-referenced, careful when changing names #}
+{%- import 'net_map.j2' as nm with context %}
+{#- Filter-out NIC duplicates by constructing a dict (used NICs only) #}
+{%- set nics = { nm.ctl01.nic_admin: True, nm.ctl01.nic_mgmt: True, nm.ctl01.nic_public: True } %}
+{%- set vlans = { nm.vlan_admin: nm.ctl01.nic_admin, nm.vlan_mgmt: nm.ctl01.nic_mgmt, nm.vlan_public: nm.ctl01.nic_public } %}
 ---
 classes:
   - system.linux.system.repo.glusterfs
@@ -18,10 +23,11 @@ classes:
   - system.salt.control.cluster.openstack_database_cluster
   - system.salt.control.cluster.openstack_message_queue_cluster
   - system.salt.control.cluster.openstack_telemetry_cluster
-  # - system.salt.control.cluster.stacklight_server_cluster
-  # - system.salt.control.cluster.stacklight_log_cluster
-  # - system.salt.control.cluster.stacklight_telemetry_cluster
-  - cluster.mcp-pike-common-ha.infra.kvm_pdf
+{%- if conf.MCP_STACKLIGHT %}
+  - system.salt.control.cluster.stacklight_server_cluster
+  - system.salt.control.cluster.stacklight_log_cluster
+  - system.salt.control.cluster.stacklight_telemetry_cluster
+{%- endif %}
   - cluster.mcp-pike-common-ha.include.maas_proxy
   - cluster.mcp-pike-common-ha.include.lab_proxy_pdf
 parameters:
@@ -34,12 +40,6 @@ parameters:
     cluster_node03_address: ${_param:infra_kvm_node03_address}
     keepalived_vip_interface: br-ctl
     keepalived_vip_virtual_router_id: 69
-  linux:
-    system:
-      kernel:
-        boot_options:
-          - spectre_v2=off
-          - nopti
   libvirt:
     server:
       service: libvirtd
@@ -69,21 +69,23 @@ parameters:
           ram: 3072
           disk_profile: xxlarge
           net_profile: default
-        # stacklight.log:
-        #   cpu: 2
-        #   ram: 4096
-        #   disk_profile: xxlarge
-        #   net_profile: default
-        # stacklight.server:
-        #   cpu: 2
-        #   ram: 4096
-        #   disk_profile: small
-        #   net_profile: default
-        # stacklight.telemetry:
-        #   cpu: 2
-        #   ram: 4096
-        #   disk_profile: xxlarge
-        #   net_profile: default
+{%- if conf.MCP_STACKLIGHT %}
+        stacklight.log:
+          cpu: 2
+          ram: 4096
+          disk_profile: xxlarge
+          net_profile: default
+        stacklight.server:
+          cpu: 2
+          ram: 4096
+          disk_profile: small
+          net_profile: default
+        stacklight.telemetry:
+          cpu: 2
+          ram: 4096
+          disk_profile: xxlarge
+          net_profile: default
+{%- endif %}
         openstack.proxy:
           cpu: 2
           ram: 2048
@@ -158,3 +160,60 @@ parameters:
             cluster.favorite-child-policy: mtime
             diagnostics.client-log-level: WARNING
             diagnostics.brick-log-level: WARNING
+  linux:
+    system:
+      kernel:
+        boot_options:
+          - spectre_v2=off
+          - nopti
+    network:
+      interface:
+{%- for nic in nics %}
+        {{ nic }}:
+          enabled: true
+          type: eth
+          proto: manual
+          address: 0.0.0.0
+          netmask: 255.255.255.0
+          name: {{ nic }}
+          noifupdown: true
+{%- endfor %}
+
+{%- for vlan in vlans %}
+    {%- if vlan and vlan != 'native' %}
+        {{ vlans[vlan] }}.{{ vlan }}:
+          enabled: true
+          proto: manual
+          type: vlan
+          name: {{ vlans[vlan] }}.{{ vlan }}
+          use_interfaces:
+            - {{ vlans[vlan] }}
+          noifupdown: true
+    {%- endif %}
+{%- endfor %}
+
+        br-mgmt:
+          enabled: true
+          proto: dhcp
+          type: bridge
+          use_interfaces:
+            - {{ nm.ctl01.nic_admin }}{% if nm.vlan_admin and nm.vlan_admin != 'native' %}.{{ nm.vlan_admin }}{% endif %}
+          noifupdown: true
+        br-ctl:
+          enabled: true
+          type: bridge
+          proto: static
+          address: ${_param:single_address}
+          netmask: 255.255.255.0
+          use_interfaces:
+            - {{ nm.ctl01.nic_mgmt }}{% if nm.vlan_mgmt and nm.vlan_mgmt != 'native' %}.{{ nm.vlan_mgmt }}{% endif %}
+          noifupdown: true
+        br-ex:
+          enabled: true
+          proto: manual
+          address: 0.0.0.0
+          netmask: ${_param:opnfv_net_public_mask}
+          type: bridge
+          use_interfaces:
+            - {{ nm.ctl01.nic_public }}{% if nm.vlan_public and nm.vlan_public != 'native' %}.{{ nm.vlan_public }}{% endif %}
+          noifupdown: true
diff --git a/mcp/reclass/classes/cluster/mcp-pike-common-ha/infra/kvm_pdf.yml.j2 b/mcp/reclass/classes/cluster/mcp-pike-common-ha/infra/kvm_pdf.yml.j2
deleted file mode 100644 (file)
index 120b6fb..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-##############################################################################
-# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Apache License, Version 2.0
-# which accompanies this distribution, and is available at
-# http://www.apache.org/licenses/LICENSE-2.0
-##############################################################################
-{#- NOTE: br-{mgmt,ctl} are cross-referenced, careful when changing names #}
-{%- import 'net_map.j2' as nm with context %}
-{#- Filter-out NIC duplicates by constructing a dict (used NICs only) #}
-{%- set nics = { nm.ctl01.nic_admin: True, nm.ctl01.nic_mgmt: True, nm.ctl01.nic_public: True } %}
-{%- set vlans = { nm.vlan_admin: nm.ctl01.nic_admin, nm.vlan_mgmt: nm.ctl01.nic_mgmt, nm.vlan_public: nm.ctl01.nic_public } %}
----
-parameters:
-  linux:
-    network:
-      interface:
-{%- for nic in nics %}
-        {{ nic }}:
-          enabled: true
-          type: eth
-          proto: manual
-          address: 0.0.0.0
-          netmask: 255.255.255.0
-          name: {{ nic }}
-          noifupdown: true
-{%- endfor %}
-
-{%- for vlan in vlans %}
-    {%- if vlan and vlan != 'native' %}
-        {{ vlans[vlan] }}.{{ vlan }}:
-          enabled: true
-          proto: manual
-          type: vlan
-          name: {{ vlans[vlan] }}.{{ vlan }}
-          use_interfaces:
-            - {{ vlans[vlan] }}
-          noifupdown: true
-    {%- endif %}
-{%- endfor %}
-
-        br-mgmt:
-          enabled: true
-          proto: dhcp
-          type: bridge
-          use_interfaces:
-            - {{ nm.ctl01.nic_admin }}{% if nm.vlan_admin and nm.vlan_admin != 'native' %}.{{ nm.vlan_admin }}{% endif %}
-          noifupdown: true
-        br-ctl:
-          enabled: true
-          type: bridge
-          proto: static
-          address: ${_param:single_address}
-          netmask: 255.255.255.0
-          use_interfaces:
-            - {{ nm.ctl01.nic_mgmt }}{% if nm.vlan_mgmt and nm.vlan_mgmt != 'native' %}.{{ nm.vlan_mgmt }}{% endif %}
-          noifupdown: true
-        br-ex:
-          enabled: true
-          proto: manual
-          address: 0.0.0.0
-          netmask: ${_param:opnfv_net_public_mask}
-          type: bridge
-          use_interfaces:
-            - {{ nm.ctl01.nic_public }}{% if nm.vlan_public and nm.vlan_public != 'native' %}.{{ nm.vlan_public }}{% endif %}
-          noifupdown: true
diff --git a/mcp/reclass/classes/cluster/mcp-pike-common-ha/stacklight/client.yml b/mcp/reclass/classes/cluster/mcp-pike-common-ha/stacklight/client.yml
new file mode 100644 (file)
index 0000000..57faae5
--- /dev/null
@@ -0,0 +1,13 @@
+##############################################################################
+# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+classes:
+  - system.collectd.client.output.heka
+  - system.heka.log_collector.single
+  - system.heka.metric_collector.single
+  - service.grafana.collector
diff --git a/mcp/reclass/classes/cluster/mcp-pike-common-ha/stacklight/init.yml b/mcp/reclass/classes/cluster/mcp-pike-common-ha/stacklight/init.yml
new file mode 100644 (file)
index 0000000..21d8b2b
--- /dev/null
@@ -0,0 +1,197 @@
+##############################################################################
+# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+parameters:
+  _param:
+    # Stacklight Monitor
+    stacklight_monitor_address: ${_param:opnfv_stacklight_monitor_address}
+    stacklight_monitor_node01_address: ${_param:opnfv_stacklight_monitor_node01_address}
+    stacklight_monitor_node02_address: ${_param:opnfv_stacklight_monitor_node02_address}
+    stacklight_monitor_node03_address: ${_param:opnfv_stacklight_monitor_node03_address}
+    stacklight_log_address: ${_param:opnfv_stacklight_log_address}
+    stacklight_log_node01_address: ${_param:opnfv_stacklight_log_node01_address}
+    stacklight_log_node02_address: ${_param:opnfv_stacklight_log_node02_address}
+    stacklight_log_node03_address: ${_param:opnfv_stacklight_log_node03_address}
+    stacklight_telemetry_address: ${_param:opnfv_stacklight_telemetry_address}
+    stacklight_telemetry_node01_address: ${_param:opnfv_stacklight_telemetry_node01_address}
+    stacklight_telemetry_node02_address: ${_param:opnfv_stacklight_telemetry_node02_address}
+    stacklight_telemetry_node03_address: ${_param:opnfv_stacklight_telemetry_node03_address}
+
+    # StackLight service hostnames
+    stacklight_monitor_hostname: mon
+    stacklight_monitor_node01_hostname: mon01
+    stacklight_monitor_node02_hostname: mon02
+    stacklight_monitor_node03_hostname: mon03
+    stacklight_log_hostname: log
+    stacklight_log_node01_hostname: log01
+    stacklight_log_node02_hostname: log02
+    stacklight_log_node03_hostname: log03
+    stacklight_telemetry_hostname: mtr
+    stacklight_telemetry_node01_hostname: mtr01
+    stacklight_telemetry_node02_hostname: mtr02
+    stacklight_telemetry_node03_hostname: mtr03
+
+    kibana_elasticsearch_host: ${_param:stacklight_log_address}
+    heka_elasticsearch_host: ${_param:stacklight_log_address}
+    heka_influxdb_host: ${_param:stacklight_telemetry_address}
+    heka_aggregator_host: ${_param:stacklight_monitor_address}
+    aggregator_port: 5565
+    grafana_user: admin
+    cluster_elasticsearch_port: 9200
+    cluster_kibana_port: 5601
+    cluster_grafana_port: 3000
+    rabbitmq_monitor_password: 'opnfv_secret'
+    rabbitmq_monitor_port: 5672
+    mysql_grafana_password: 'opnfv_secret'
+    grafana_influxdb_host: ${_param:stacklight_telemetry_address}
+    elasticsearch_port: 9200
+    influxdb_stacklight_password: 'opnfv_secret'
+    influxdb_admin_password: 'opnfv_secret'
+    influxdb_port: 8086
+    influxdb_database: lma
+    influxdb_user: lma
+    influxdb_password: 'opnfv_secret'
+    nagios_host: ${_param:stacklight_monitor_address}
+    nagios_status_port: 8001
+    nagios_username: nagiosadmin
+    nagios_password: password
+    nagios_notification_smtp_server: 127.0.0.1
+    nagios_notification_from: 'nagios@localhost'
+    nagios_notification_email: 'root@localhost'
+    stacklight_log_keepalived_password: 'opnfv_secret'
+    stacklight_monitor_keepalived_password: 'opnfv_secret'
+    stacklight_telemetry_keepalived_password: 'opnfv_secret'
+    ## Billing
+    # collectd_backend_carbon_host: ${_param:openstack_billing_address}
+    # collectd_backend_carbon_port: 2023
+  linux:
+    _support:
+      sensu:
+        enabled: false
+    network:
+      host:
+        mon01:
+          address: ${_param:stacklight_monitor_node01_address}
+          names:
+            - ${_param:stacklight_monitor_node01_hostname}
+            - ${_param:stacklight_monitor_node01_hostname}.${_param:cluster_domain}
+        mon02:
+          address: ${_param:stacklight_monitor_node02_address}
+          names:
+            - ${_param:stacklight_monitor_node02_hostname}
+            - ${_param:stacklight_monitor_node02_hostname}.${_param:cluster_domain}
+        mon03:
+          address: ${_param:stacklight_monitor_node03_address}
+          names:
+            - ${_param:stacklight_monitor_node03_hostname}
+            - ${_param:stacklight_monitor_node03_hostname}.${_param:cluster_domain}
+        mon:
+          address: ${_param:stacklight_monitor_address}
+          names:
+            - ${_param:stacklight_monitor_hostname}
+            - ${_param:stacklight_monitor_hostname}.${_param:cluster_domain}
+        log01:
+          address: ${_param:stacklight_log_node01_address}
+          names:
+            - ${_param:stacklight_log_node01_hostname}
+            - ${_param:stacklight_log_node01_hostname}.${_param:cluster_domain}
+        log02:
+          address: ${_param:stacklight_log_node02_address}
+          names:
+            - ${_param:stacklight_log_node02_hostname}
+            - ${_param:stacklight_log_node02_hostname}.${_param:cluster_domain}
+        log03:
+          address: ${_param:stacklight_log_node03_address}
+          names:
+            - ${_param:stacklight_log_node03_hostname}
+            - ${_param:stacklight_log_node03_hostname}.${_param:cluster_domain}
+        log:
+          address: ${_param:stacklight_log_address}
+          names:
+            - ${_param:stacklight_log_hostname}
+            - ${_param:stacklight_log_hostname}.${_param:cluster_domain}
+        mtr01:
+          address: ${_param:stacklight_telemetry_node01_address}
+          names:
+            - ${_param:stacklight_telemetry_node01_hostname}
+            - ${_param:stacklight_telemetry_node01_hostname}.${_param:cluster_domain}
+        mtr02:
+          address: ${_param:stacklight_telemetry_node02_address}
+          names:
+            - ${_param:stacklight_telemetry_node02_hostname}
+            - ${_param:stacklight_telemetry_node02_hostname}.${_param:cluster_domain}
+        mtr03:
+          address: ${_param:stacklight_telemetry_node03_address}
+          names:
+            - ${_param:stacklight_telemetry_node03_hostname}
+            - ${_param:stacklight_telemetry_node03_hostname}.${_param:cluster_domain}
+        mtr:
+          address: ${_param:stacklight_telemetry_address}
+          names:
+            - ${_param:stacklight_telemetry_hostname}
+            - ${_param:stacklight_telemetry_hostname}.${_param:cluster_domain}
+  heka:
+    server:
+      extra_fields:
+        region: ${_param:openstack_region}
+  apache:
+    _support:
+      sensu:
+        enabled: false
+  cinder:
+    _support:
+      sensu:
+        enabled: false
+  glance:
+    _support:
+      sensu:
+        enabled: false
+  glusterfs:
+    _support:
+      sensu:
+        enabled: false
+  haproxy:
+    _support:
+      sensu:
+        enabled: false
+  heat:
+    _support:
+      sensu:
+        enabled: false
+  keepalived:
+    _support:
+      sensu:
+        enabled: false
+  keystone:
+    _support:
+      sensu:
+        enabled: false
+  neutron:
+    _support:
+      sensu:
+        enabled: false
+  nginx:
+    _support:
+      sensu:
+        enabled: false
+  nova:
+    _support:
+      sensu:
+        enabled: false
+  ntp:
+    _support:
+      sensu:
+        enabled: false
+  opencontrail:
+    _support:
+      sensu:
+        enabled: false
+  rabbitmq:
+    _support:
+      sensu:
+        enabled: false
diff --git a/mcp/reclass/classes/cluster/mcp-pike-common-ha/stacklight/log.yml b/mcp/reclass/classes/cluster/mcp-pike-common-ha/stacklight/log.yml
new file mode 100644 (file)
index 0000000..c85662c
--- /dev/null
@@ -0,0 +1,32 @@
+##############################################################################
+# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+classes:
+  - system.linux.system.repo.elasticsearch
+  - system.linux.system.repo.saltstack.xenial
+  - system.elasticsearch.server.cluster
+  - system.haproxy.proxy.listen.elasticsearch
+  - service.haproxy.proxy.single
+  - system.keepalived.cluster.instance.stacklight_log_vip
+parameters:
+  _param:
+    keepalived_stacklight_log_vip_address: ${_param:stacklight_log_address}
+    keepalived_stacklight_log_vip_password: ${_param:stacklight_log_keepalived_password}
+    keepalived_stacklight_log_vip_interface: ${_param:single_nic}
+    cluster_vip_address: ${_param:stacklight_log_address}
+    cluster_local_address: ${_param:single_address}
+    cluster_node01_hostname: ${_param:stacklight_log_node01_hostname}
+    cluster_node01_address: ${_param:stacklight_log_node01_address}
+    cluster_node02_hostname: ${_param:stacklight_log_node02_hostname}
+    cluster_node02_address: ${_param:stacklight_log_node02_address}
+    cluster_node03_hostname: ${_param:stacklight_log_node03_hostname}
+    cluster_node03_address: ${_param:stacklight_log_node03_address}
+  elasticsearch:
+    server:
+      master: true
+      data: true
diff --git a/mcp/reclass/classes/cluster/mcp-pike-common-ha/stacklight/log_curator.yml b/mcp/reclass/classes/cluster/mcp-pike-common-ha/stacklight/log_curator.yml
new file mode 100644 (file)
index 0000000..996d77b
--- /dev/null
@@ -0,0 +1,10 @@
+##############################################################################
+# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+classes:
+  - system.elasticsearch.server.curator
diff --git a/mcp/reclass/classes/cluster/mcp-pike-common-ha/stacklight/monitor.yml b/mcp/reclass/classes/cluster/mcp-pike-common-ha/stacklight/monitor.yml
new file mode 100644 (file)
index 0000000..2b5c865
--- /dev/null
@@ -0,0 +1,100 @@
+##############################################################################
+# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+classes:
+  - system.linux.system.repo.elasticsearch
+  - system.linux.system.repo.grafana
+  - system.linux.system.repo.saltstack.xenial
+  - system.collectd.remote_client.cluster
+  - system.heka.remote_collector.cluster
+  # - system.heka.remote_collector.input.amqp
+  - system.heka.remote_collector.output.sensu
+  - system.heka.aggregator.cluster
+  - system.heka.aggregator.output.sensu
+  - system.kibana.server.single
+  - system.grafana.server.single
+  - system.grafana.client.single
+  - system.nagios.server.cluster
+  - system.sensu.server.cluster
+  - system.sensu.client.unsubscribe.collectd
+  - system.haproxy.proxy.listen.stacklight.elasticsearch
+  - system.haproxy.proxy.listen.stacklight.kibana
+  - system.haproxy.proxy.listen.stacklight.grafana
+  - system.haproxy.proxy.listen.stacklight.sensu
+  - service.haproxy.proxy.single
+  - system.keepalived.cluster.instance.stacklight_monitor_vip
+  - system.collectd.client.output.heka
+  - system.heka.log_collector.single
+  - system.heka.log_collector.output.sensu
+  - system.heka.metric_collector.single
+  - system.heka.metric_collector.output.sensu
+  - system.sensu.client.stacklight
+  - service.grafana.collector
+parameters:
+  _param:
+    collectd_remote_collector_host: ${_param:stacklight_monitor_address}
+    keepalived_stacklight_monitor_vip_address: ${_param:stacklight_monitor_address}
+    keepalived_stacklight_monitor_vip_password: ${_param:stacklight_monitor_keepalived_password}
+    keepalived_stacklight_monitor_vip_interface: ${_param:single_nic}
+    cluster_redis_port: 6379
+    cluster_sensu_port: 4567
+    sensu_dashboard_password: 'opnfv_secret'
+    cluster_uchiwa_port: 3001
+    cluster_vip_address: ${_param:stacklight_monitor_address}
+    cluster_local_address: ${_param:single_address}
+    cluster_node01_hostname: ${_param:stacklight_monitor_node01_hostname}
+    cluster_node01_address: ${_param:stacklight_monitor_node01_address}
+    cluster_node02_hostname: ${_param:stacklight_monitor_node02_hostname}
+    cluster_node02_address: ${_param:stacklight_monitor_node02_address}
+    cluster_node03_hostname: ${_param:stacklight_monitor_node03_hostname}
+    cluster_node03_address: ${_param:stacklight_monitor_node03_address}
+  heka:
+    aggregator:
+      sensu_notification_handler: 'stdout'
+      sensu_noop_handler: 'pipe'
+  sensu:
+    server:
+      enabled: true
+      database:
+        engine: redis
+        host: ${_param:stacklight_monitor_address}
+        port: ${_param:cluster_redis_port}
+      message_queue:
+        engine: rabbitmq
+        host: ${_param:stacklight_monitor_address}
+        port: ${_param:rabbitmq_monitor_port}
+        user: monitor
+        password: ${_param:rabbitmq_monitor_password}
+        virtual_host: '/monitor'
+      bind:
+        address: ${_param:single_address}
+        port: ${_param:cluster_sensu_port}
+      handler:
+        default:
+          enabled: true
+          set:
+            - pipe
+        pipe:
+          enabled: true
+          command: 'cat /dev/null'
+        stdout:
+          enabled: true
+    client:
+      use_shortname: true
+    dashboard:
+      enabled: true
+      backend:
+        sensu:
+          host: ${_param:single_address}
+          port: ${_param:cluster_sensu_port}
+      bind:
+        address: ${_param:single_address}
+        port: ${_param:cluster_uchiwa_port}
+      admin:
+        username: admin
+        password: ${_param:sensu_dashboard_password}
diff --git a/mcp/reclass/classes/cluster/mcp-pike-common-ha/stacklight/proxy.yml b/mcp/reclass/classes/cluster/mcp-pike-common-ha/stacklight/proxy.yml
new file mode 100644 (file)
index 0000000..18579f6
--- /dev/null
@@ -0,0 +1,20 @@
+##############################################################################
+# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+classes:
+  - system.nginx.server.proxy.grafana_web
+  - system.nginx.server.proxy.kibana_web
+  - system.nginx.server.proxy.nagios_web
+  - system.salt.minion.cert.proxy
+parameters:
+# _param:
+#   nginx_proxy_ssl:
+#     enabled: true
+#     authority: mk_lab_ca
+#     engine: salt
+#     mode: secure
diff --git a/mcp/reclass/classes/cluster/mcp-pike-common-ha/stacklight/telemetry.yml b/mcp/reclass/classes/cluster/mcp-pike-common-ha/stacklight/telemetry.yml
new file mode 100644 (file)
index 0000000..eb06349
--- /dev/null
@@ -0,0 +1,35 @@
+##############################################################################
+# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+classes:
+  - system.linux.system.repo.influxdb
+  - system.linux.system.repo.saltstack.xenial
+  - system.influxdb.server.single
+  - system.influxdb.database.ceilometer
+  - system.influxdb.database.stacklight
+  - system.haproxy.proxy.listen.stacklight.influxdb
+  - service.haproxy.proxy.single
+  - system.keepalived.cluster.instance.stacklight_telemetry_vip
+parameters:
+  _param:
+    keepalived_stacklight_telemetry_vip_address: ${_param:stacklight_telemetry_address}
+    keepalived_stacklight_telemetry_vip_password: ${_param:stacklight_telemetry_keepalived_password}
+    keepalived_stacklight_telemetry_vip_interface: ${_param:single_nic}
+    cluster_vip_address: ${_param:stacklight_telemetry_address}
+    cluster_local_address: ${_param:single_address}
+    cluster_node01_hostname: ${_param:stacklight_telemetry_node01_hostname}
+    cluster_node01_address: ${_param:stacklight_telemetry_node01_address}
+    cluster_node02_hostname: ${_param:stacklight_telemetry_node02_hostname}
+    cluster_node02_address: ${_param:stacklight_telemetry_node02_address}
+    cluster_node03_hostname: ${_param:stacklight_telemetry_node03_hostname}
+    cluster_node03_address: ${_param:stacklight_telemetry_node03_address}
+  linux:
+    system:
+      package:
+        apt-transport-https:
+          version: latest
diff --git a/mcp/reclass/classes/cluster/mcp-pike-ovs-ha/stacklight/log.yml b/mcp/reclass/classes/cluster/mcp-pike-ovs-ha/stacklight/log.yml
new file mode 100644 (file)
index 0000000..9fc90b2
--- /dev/null
@@ -0,0 +1,13 @@
+##############################################################################
+# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+classes:
+  # FIXME: some of these should be included only when VCP is used, see dbs/mdb/etc
+  - cluster.mcp-pike-common-ha.openstack_interface_vcp_biport
+  - cluster.mcp-pike-common-ha.stacklight.log
+  - cluster.mcp-pike-ovs-ha.infra
diff --git a/mcp/reclass/classes/cluster/mcp-pike-ovs-ha/stacklight/monitor.yml b/mcp/reclass/classes/cluster/mcp-pike-ovs-ha/stacklight/monitor.yml
new file mode 100644 (file)
index 0000000..bb94995
--- /dev/null
@@ -0,0 +1,12 @@
+##############################################################################
+# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+classes:
+  - cluster.mcp-pike-common-ha.openstack_interface_vcp_biport
+  - cluster.mcp-pike-common-ha.stacklight.monitor
+  - cluster.mcp-pike-ovs-ha.infra
diff --git a/mcp/reclass/classes/cluster/mcp-pike-ovs-ha/stacklight/proxy.yml b/mcp/reclass/classes/cluster/mcp-pike-ovs-ha/stacklight/proxy.yml
new file mode 100644 (file)
index 0000000..229fd3e
--- /dev/null
@@ -0,0 +1,11 @@
+##############################################################################
+# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+classes:
+  - cluster.mcp-pike-common-ha.stacklight.proxy
+  - cluster.mcp-pike-ovs-ha.infra
diff --git a/mcp/reclass/classes/cluster/mcp-pike-ovs-ha/stacklight/telemetry.yml b/mcp/reclass/classes/cluster/mcp-pike-ovs-ha/stacklight/telemetry.yml
new file mode 100644 (file)
index 0000000..c7a0391
--- /dev/null
@@ -0,0 +1,12 @@
+##############################################################################
+# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+classes:
+  - cluster.mcp-pike-common-ha.openstack_interface_vcp_biport
+  - cluster.mcp-pike-common-ha.stacklight.telemetry
+  - cluster.mcp-pike-ovs-ha.infra
index 20d466f..68efbbb 100644 (file)
@@ -548,12 +548,14 @@ function do_templates() {
         -j "${PHAROS_INSTALLER_ADAPTER}" > "${image_dir}/pod_config.yml"; then
       notify_e "[ERROR] Could not convert PDF+IDF to reclass model input!"
     fi
+    printenv | \
+      awk '/^(SALT|MCP|MAAS).*=/ { gsub(/=/,": "); print }' >> "${LOCAL_PDF}"
     template_dirs="${scenario_dir}"
     template_err_str='Could not convert j2 scenario definitions!'
   else
     # Expand reclass and virsh network templates based on PDF + IDF
     printenv | \
-      awk '/^(SALT|MCP|MAAS|CLUSTER).*=/ { gsub(/=/,": "); print }' >> "${LOCAL_PDF}"
+      awk '/^(CLUSTER).*=/ { gsub(/=/,": "); print }' >> "${LOCAL_PDF}"
     template_dirs="${RECLASS_CLUSTER_DIR} virsh_net ./*j2"
     template_err_str='Could not convert PDF to network definitions!'
   fi