Merge "Add telemetry to ceph models"
diff --git a/tcp_tests/templates/cookied-mcp-pike-dvr-ceph/cookiecutter-context-dvr-ceph.yaml b/tcp_tests/templates/cookied-mcp-pike-dvr-ceph/cookiecutter-context-dvr-ceph.yaml
index 7df1f81..22e4442 100644
--- a/tcp_tests/templates/cookied-mcp-pike-dvr-ceph/cookiecutter-context-dvr-ceph.yaml
+++ b/tcp_tests/templates/cookied-mcp-pike-dvr-ceph/cookiecutter-context-dvr-ceph.yaml
@@ -92,7 +92,7 @@
   gainsight_service_enabled: 'False'
   gateway_primary_first_nic: eth1
   gateway_primary_second_nic: eth2
-  gnocchi_aggregation_storage: file
+  gnocchi_aggregation_storage: ceph
   infra_bond_mode: active-backup
   infra_deploy_nic: eth0
   infra_kvm01_control_address: 10.167.4.11
@@ -209,9 +209,17 @@
   tenant_network_gateway: 10.167.6.1
   tenant_network_netmask: 255.255.255.0
   tenant_network_subnet: 10.167.6.0/24
-  tenant_telemetry_enabled: 'False'
+  tenant_telemetry_enabled: 'True'
   tenant_vlan: '20'
   upstream_proxy_enabled: 'False'
   use_default_network_scheme: 'True'
   version: proposed
   vnf_onboarding_enabled: 'False'
+  openstack_telemetry_address: 172.16.10.83
+  openstack_telemetry_hostname: mdb
+  openstack_telemetry_node01_address: 172.16.10.84
+  openstack_telemetry_node01_hostname: mdb01
+  openstack_telemetry_node02_address: 172.16.10.85
+  openstack_telemetry_node02_hostname: mdb02
+  openstack_telemetry_node03_address: 172.16.10.86
+  openstack_telemetry_node03_hostname: mdb03
\ No newline at end of file
diff --git a/tcp_tests/templates/cookied-mcp-pike-dvr-ceph/openstack.yaml b/tcp_tests/templates/cookied-mcp-pike-dvr-ceph/openstack.yaml
index 758a86d..8531cc3 100644
--- a/tcp_tests/templates/cookied-mcp-pike-dvr-ceph/openstack.yaml
+++ b/tcp_tests/templates/cookied-mcp-pike-dvr-ceph/openstack.yaml
@@ -31,6 +31,16 @@
 
 {{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }}
 
+{{ SHARED_OPENSTACK.MACRO_INSTALL_REDIS() }}
+
+{{ SHARED_OPENSTACK.MACRO_INSTALL_GNOCCHI() }}
+
+{{ SHARED_OPENSTACK.MACRO_INSTALL_PANKO() }}
+
+{{ SHARED_OPENSTACK.MACRO_INSTALL_CEILOMETER() }}
+
+{{ SHARED_OPENSTACK.MACRO_INSTALL_AODH() }}
+
 {{ SHARED_OPENSTACK.MACRO_INSTALL_HORIZON() }}
 
-{{ SHARED_OPENSTACK.MACRO_INSTALL_COMPUTE() }}
\ No newline at end of file
+{{ SHARED_OPENSTACK.MACRO_INSTALL_COMPUTE(CELL_MAPPING=true) }}
\ No newline at end of file
diff --git a/tcp_tests/templates/cookied-mcp-pike-dvr-ceph/underlay.yaml b/tcp_tests/templates/cookied-mcp-pike-dvr-ceph/underlay.yaml
index a140743..b36f8be 100644
--- a/tcp_tests/templates/cookied-mcp-pike-dvr-ceph/underlay.yaml
+++ b/tcp_tests/templates/cookied-mcp-pike-dvr-ceph/underlay.yaml
@@ -29,6 +29,9 @@
 {% set HOSTNAME_OSD02 = os_env('HOSTNAME_OSD02', 'osd2.' + DOMAIN_NAME) %}
 {% set HOSTNAME_GTW01 = os_env('HOSTNAME_GTW01', 'gtw01.' + DOMAIN_NAME) %}
 {% set HOSTNAME_PRX01 = os_env('HOSTNAME_PRX01', 'prx01.' + DOMAIN_NAME) %}
+{% set HOSTNAME_MDB01 = os_env('HOSTNAME_MDB01', 'mdb01.' + DOMAIN_NAME) %}
+{% set HOSTNAME_MDB02 = os_env('HOSTNAME_MDB02', 'mdb02.' + DOMAIN_NAME) %}
+{% set HOSTNAME_MDB03 = os_env('HOSTNAME_MDB03', 'mdb03.' + DOMAIN_NAME) %}
 
 template:
   devops_settings:
@@ -57,6 +60,9 @@
             default_{{ HOSTNAME_RGW03 }}: +78
             default_{{ HOSTNAME_GTW01 }}: +110
             default_{{ HOSTNAME_PRX01 }}: +121
+            default_{{ HOSTNAME_MDB01 }}: +84
+            default_{{ HOSTNAME_MDB02 }}: +85
+            default_{{ HOSTNAME_MDB03 }}: +86
           ip_ranges:
             dhcp: [+70, -10]
 
@@ -82,6 +88,9 @@
             default_{{ HOSTNAME_RGW03 }}: +78
             default_{{ HOSTNAME_GTW01 }}: +110
             default_{{ HOSTNAME_PRX01 }}: +121
+            default_{{ HOSTNAME_MDB01 }}: +84
+            default_{{ HOSTNAME_MDB02 }}: +85
+            default_{{ HOSTNAME_MDB03 }}: +86
           ip_ranges:
             dhcp: [+70, -10]
 
@@ -107,6 +116,9 @@
             default_{{ HOSTNAME_RGW03 }}: +78
             default_{{ HOSTNAME_GTW01 }}: +110
             default_{{ HOSTNAME_PRX01 }}: +121
+            default_{{ HOSTNAME_MDB01 }}: +84
+            default_{{ HOSTNAME_MDB02 }}: +85
+            default_{{ HOSTNAME_MDB03 }}: +86
           ip_ranges:
             dhcp: [+10, -10]
 
@@ -132,6 +144,9 @@
             default_{{ HOSTNAME_RGW03 }}: +78
             default_{{ HOSTNAME_GTW01 }}: +110
             default_{{ HOSTNAME_PRX01 }}: +121
+            default_{{ HOSTNAME_MDB01 }}: +84
+            default_{{ HOSTNAME_MDB02 }}: +85
+            default_{{ HOSTNAME_MDB03 }}: +86
           ip_ranges:
             dhcp: [+130, +230]
 
@@ -316,6 +331,93 @@
               interfaces: *interfaces
               network_config: *network_config
 
+          - name: {{ HOSTNAME_MDB01 }}
+            role: salt_minion
+            params:
+              vcpu: !os_env SLAVE_NODE_CPU, 2
+              memory: !os_env SLAVE_NODE_MEMORY, 8192
+              boot:
+                - hd
+              cloud_init_volume_name: iso
+              cloud_init_iface_up: ens3
+              volumes:
+                - name: system
+                  capacity: !os_env NODE_VOLUME_SIZE, 150
+                  backing_store: mcp_ubuntu_1604_image
+                  format: qcow2
+                - name: cinder
+                  capacity: 50
+                  format: qcow2
+                - name: iso  # Volume with name 'iso' will be used
+                             # for store image with cloud-init metadata.
+                  capacity: 1
+                  format: raw
+                  device: cdrom
+                  bus: ide
+                  cloudinit_meta_data: *cloudinit_meta_data
+                  cloudinit_user_data: *cloudinit_user_data_1604
+
+              interfaces: *interfaces
+              network_config: *network_config
+
+          - name: {{ HOSTNAME_MDB02 }}
+            role: salt_minion
+            params:
+              vcpu: !os_env SLAVE_NODE_CPU, 2
+              memory: !os_env SLAVE_NODE_MEMORY, 8192
+              boot:
+                - hd
+              cloud_init_volume_name: iso
+              cloud_init_iface_up: ens3
+              volumes:
+                - name: system
+                  capacity: !os_env NODE_VOLUME_SIZE, 150
+                  backing_store: mcp_ubuntu_1604_image
+                  format: qcow2
+                - name: cinder
+                  capacity: 50
+                  format: qcow2
+                - name: iso  # Volume with name 'iso' will be used
+                             # for store image with cloud-init metadata.
+                  capacity: 1
+                  format: raw
+                  device: cdrom
+                  bus: ide
+                  cloudinit_meta_data: *cloudinit_meta_data
+                  cloudinit_user_data: *cloudinit_user_data_1604
+
+              interfaces: *interfaces
+              network_config: *network_config
+
+          - name: {{ HOSTNAME_MDB03 }}
+            role: salt_minion
+            params:
+              vcpu: !os_env SLAVE_NODE_CPU, 2
+              memory: !os_env SLAVE_NODE_MEMORY, 8192
+              boot:
+                - hd
+              cloud_init_volume_name: iso
+              cloud_init_iface_up: ens3
+              volumes:
+                - name: system
+                  capacity: !os_env NODE_VOLUME_SIZE, 150
+                  backing_store: mcp_ubuntu_1604_image
+                  format: qcow2
+                - name: cinder
+                  capacity: 50
+                  format: qcow2
+                - name: iso  # Volume with name 'iso' will be used
+                             # for store image with cloud-init metadata.
+                  capacity: 1
+                  format: raw
+                  device: cdrom
+                  bus: ide
+                  cloudinit_meta_data: *cloudinit_meta_data
+                  cloudinit_user_data: *cloudinit_user_data_1604
+
+              interfaces: *interfaces
+              network_config: *network_config
+
           - name: {{ HOSTNAME_CMN01 }}
             role: salt_minion
             params:
diff --git a/tcp_tests/templates/cookied-mcp-pike-dvr-ceph/vcp-context-environment.yaml b/tcp_tests/templates/cookied-mcp-pike-dvr-ceph/vcp-context-environment.yaml
index 74a1465..c89ec89 100644
--- a/tcp_tests/templates/cookied-mcp-pike-dvr-ceph/vcp-context-environment.yaml
+++ b/tcp_tests/templates/cookied-mcp-pike-dvr-ceph/vcp-context-environment.yaml
@@ -169,4 +169,37 @@
         ens3:
           role: single_dhcp
         ens4:
-          role: single_ctl
\ No newline at end of file
+          role: single_ctl
+
+    mdb01.cookied-mcp-pike-dvr-ceph.local:
+      reclass_storage_name: openstack_telemetry_node01
+      roles:
+      - linux_system_codename_xenial
+      - openstack_telemetry
+      interfaces:
+        ens3:
+          role: single_dhcp
+        ens4:
+          role: single_ctl
+
+    mdb02.cookied-mcp-pike-dvr-ceph.local:
+      reclass_storage_name: openstack_telemetry_node02
+      roles:
+      - linux_system_codename_xenial
+      - openstack_telemetry
+      interfaces:
+        ens3:
+          role: single_dhcp
+        ens4:
+          role: single_ctl
+
+    mdb03.cookied-mcp-pike-dvr-ceph.local:
+      reclass_storage_name: openstack_telemetry_node03
+      roles:
+      - linux_system_codename_xenial
+      - openstack_telemetry
+      interfaces:
+        ens3:
+          role: single_dhcp
+        ens4:
+          role: single_ctl
diff --git a/tcp_tests/templates/cookied-mcp-queens-dvr-ceph/cookiecutter-context-dvr-ceph.yaml b/tcp_tests/templates/cookied-mcp-queens-dvr-ceph/cookiecutter-context-dvr-ceph.yaml
index 39099ee..bfcc3fd 100644
--- a/tcp_tests/templates/cookied-mcp-queens-dvr-ceph/cookiecutter-context-dvr-ceph.yaml
+++ b/tcp_tests/templates/cookied-mcp-queens-dvr-ceph/cookiecutter-context-dvr-ceph.yaml
@@ -227,5 +227,13 @@
   openstack_mysql_x509_enabled: 'False'
   rabbitmq_ssl_enabled: 'False'
   openstack_rabbitmq_x509_enabled: 'False'
-  tenant_telemetry_enabled: 'False'
-  gnocchi_aggregation_storage: file
+  tenant_telemetry_enabled: 'True'
+  gnocchi_aggregation_storage: ceph
+  openstack_telemetry_address: 172.16.10.83
+  openstack_telemetry_hostname: mdb
+  openstack_telemetry_node01_address: 172.16.10.84
+  openstack_telemetry_node01_hostname: mdb01
+  openstack_telemetry_node02_address: 172.16.10.85
+  openstack_telemetry_node02_hostname: mdb02
+  openstack_telemetry_node03_address: 172.16.10.86
+  openstack_telemetry_node03_hostname: mdb03
\ No newline at end of file
diff --git a/tcp_tests/templates/cookied-mcp-queens-dvr-ceph/openstack.yaml b/tcp_tests/templates/cookied-mcp-queens-dvr-ceph/openstack.yaml
index 5d19c16..636187b 100644
--- a/tcp_tests/templates/cookied-mcp-queens-dvr-ceph/openstack.yaml
+++ b/tcp_tests/templates/cookied-mcp-queens-dvr-ceph/openstack.yaml
@@ -31,6 +31,16 @@
 
 {{ SHARED_OPENSTACK.MACRO_INSTALL_HEAT() }}
 
+{{ SHARED_OPENSTACK.MACRO_INSTALL_REDIS() }}
+
+{{ SHARED_OPENSTACK.MACRO_INSTALL_GNOCCHI() }}
+
+{{ SHARED_OPENSTACK.MACRO_INSTALL_PANKO() }}
+
+{{ SHARED_OPENSTACK.MACRO_INSTALL_CEILOMETER() }}
+
+{{ SHARED_OPENSTACK.MACRO_INSTALL_AODH() }}
+
 {{ SHARED_OPENSTACK.MACRO_INSTALL_HORIZON() }}
 
 {{ SHARED_OPENSTACK.MACRO_INSTALL_COMPUTE(CELL_MAPPING=true) }}
\ No newline at end of file
diff --git a/tcp_tests/templates/cookied-mcp-queens-dvr-ceph/underlay.yaml b/tcp_tests/templates/cookied-mcp-queens-dvr-ceph/underlay.yaml
index 727758e..fe31142 100644
--- a/tcp_tests/templates/cookied-mcp-queens-dvr-ceph/underlay.yaml
+++ b/tcp_tests/templates/cookied-mcp-queens-dvr-ceph/underlay.yaml
@@ -29,6 +29,9 @@
 {% set HOSTNAME_OSD02 = os_env('HOSTNAME_OSD02', 'osd2.' + DOMAIN_NAME) %}
 {% set HOSTNAME_GTW01 = os_env('HOSTNAME_GTW01', 'gtw01.' + DOMAIN_NAME) %}
 {% set HOSTNAME_PRX01 = os_env('HOSTNAME_PRX01', 'prx01.' + DOMAIN_NAME) %}
+{% set HOSTNAME_MDB01 = os_env('HOSTNAME_MDB01', 'mdb01.' + DOMAIN_NAME) %}
+{% set HOSTNAME_MDB02 = os_env('HOSTNAME_MDB02', 'mdb02.' + DOMAIN_NAME) %}
+{% set HOSTNAME_MDB03 = os_env('HOSTNAME_MDB03', 'mdb03.' + DOMAIN_NAME) %}
 
 template:
   devops_settings:
@@ -57,6 +60,9 @@
             default_{{ HOSTNAME_RGW03 }}: +78
             default_{{ HOSTNAME_GTW01 }}: +110
             default_{{ HOSTNAME_PRX01 }}: +121
+            default_{{ HOSTNAME_MDB01 }}: +84
+            default_{{ HOSTNAME_MDB02 }}: +85
+            default_{{ HOSTNAME_MDB03 }}: +86
           ip_ranges:
             dhcp: [+70, -10]
 
@@ -82,6 +88,9 @@
             default_{{ HOSTNAME_RGW03 }}: +78
             default_{{ HOSTNAME_GTW01 }}: +110
             default_{{ HOSTNAME_PRX01 }}: +121
+            default_{{ HOSTNAME_MDB01 }}: +84
+            default_{{ HOSTNAME_MDB02 }}: +85
+            default_{{ HOSTNAME_MDB03 }}: +86
           ip_ranges:
             dhcp: [+70, -10]
 
@@ -107,6 +116,9 @@
             default_{{ HOSTNAME_RGW03 }}: +78
             default_{{ HOSTNAME_GTW01 }}: +110
             default_{{ HOSTNAME_PRX01 }}: +121
+            default_{{ HOSTNAME_MDB01 }}: +84
+            default_{{ HOSTNAME_MDB02 }}: +85
+            default_{{ HOSTNAME_MDB03 }}: +86
           ip_ranges:
             dhcp: [+10, -10]
 
@@ -132,6 +144,9 @@
             default_{{ HOSTNAME_RGW03 }}: +78
             default_{{ HOSTNAME_GTW01 }}: +110
             default_{{ HOSTNAME_PRX01 }}: +121
+            default_{{ HOSTNAME_MDB01 }}: +84
+            default_{{ HOSTNAME_MDB02 }}: +85
+            default_{{ HOSTNAME_MDB03 }}: +86
           ip_ranges:
             dhcp: [+130, +230]
 
@@ -313,6 +328,8 @@
                   cloudinit_meta_data: *cloudinit_meta_data
                   cloudinit_user_data: *cloudinit_user_data_1604
 
+
+
               interfaces: *interfaces
               network_config: *network_config
 
@@ -342,6 +359,93 @@
               interfaces: *interfaces
               network_config: *network_config
 
+          - name: {{ HOSTNAME_MDB01 }}
+            role: salt_minion
+            params:
+              vcpu: !os_env SLAVE_NODE_CPU, 2
+              memory: !os_env SLAVE_NODE_MEMORY, 8192
+              boot:
+                - hd
+              cloud_init_volume_name: iso
+              cloud_init_iface_up: ens3
+              volumes:
+                - name: system
+                  capacity: !os_env NODE_VOLUME_SIZE, 150
+                  backing_store: mcp_ubuntu_1604_image
+                  format: qcow2
+                - name: cinder
+                  capacity: 50
+                  format: qcow2
+                - name: iso  # Volume with name 'iso' will be used
+                             # for store image with cloud-init metadata.
+                  capacity: 1
+                  format: raw
+                  device: cdrom
+                  bus: ide
+                  cloudinit_meta_data: *cloudinit_meta_data
+                  cloudinit_user_data: *cloudinit_user_data_1604
+
+              interfaces: *interfaces
+              network_config: *network_config
+
+          - name: {{ HOSTNAME_MDB02 }}
+            role: salt_minion
+            params:
+              vcpu: !os_env SLAVE_NODE_CPU, 2
+              memory: !os_env SLAVE_NODE_MEMORY, 8192
+              boot:
+                - hd
+              cloud_init_volume_name: iso
+              cloud_init_iface_up: ens3
+              volumes:
+                - name: system
+                  capacity: !os_env NODE_VOLUME_SIZE, 150
+                  backing_store: mcp_ubuntu_1604_image
+                  format: qcow2
+                - name: cinder
+                  capacity: 50
+                  format: qcow2
+                - name: iso  # Volume with name 'iso' will be used
+                             # for store image with cloud-init metadata.
+                  capacity: 1
+                  format: raw
+                  device: cdrom
+                  bus: ide
+                  cloudinit_meta_data: *cloudinit_meta_data
+                  cloudinit_user_data: *cloudinit_user_data_1604
+
+              interfaces: *interfaces
+              network_config: *network_config
+
+          - name: {{ HOSTNAME_MDB03 }}
+            role: salt_minion
+            params:
+              vcpu: !os_env SLAVE_NODE_CPU, 2
+              memory: !os_env SLAVE_NODE_MEMORY, 8192
+              boot:
+                - hd
+              cloud_init_volume_name: iso
+              cloud_init_iface_up: ens3
+              volumes:
+                - name: system
+                  capacity: !os_env NODE_VOLUME_SIZE, 150
+                  backing_store: mcp_ubuntu_1604_image
+                  format: qcow2
+                - name: cinder
+                  capacity: 50
+                  format: qcow2
+                - name: iso  # Volume with name 'iso' will be used
+                             # for store image with cloud-init metadata.
+                  capacity: 1
+                  format: raw
+                  device: cdrom
+                  bus: ide
+                  cloudinit_meta_data: *cloudinit_meta_data
+                  cloudinit_user_data: *cloudinit_user_data_1604
+
+              interfaces: *interfaces
+              network_config: *network_config
+
           - name: {{ HOSTNAME_CMN02 }}
             role: salt_minion
             params:
diff --git a/tcp_tests/templates/cookied-mcp-queens-dvr-ceph/vcp-context-environment.yaml b/tcp_tests/templates/cookied-mcp-queens-dvr-ceph/vcp-context-environment.yaml
index f279b44..28831da 100644
--- a/tcp_tests/templates/cookied-mcp-queens-dvr-ceph/vcp-context-environment.yaml
+++ b/tcp_tests/templates/cookied-mcp-queens-dvr-ceph/vcp-context-environment.yaml
@@ -169,4 +169,38 @@
         ens3:
           role: single_dhcp
         ens4:
-          role: single_ctl
\ No newline at end of file
+          role: single_ctl
+
+
+    mdb01.cookied-mcp-queens-dvr-ceph.local:
+      reclass_storage_name: openstack_telemetry_node01
+      roles:
+      - linux_system_codename_xenial
+      - openstack_telemetry
+      interfaces:
+        ens3:
+          role: single_dhcp
+        ens4:
+          role: single_ctl
+
+    mdb02.cookied-mcp-queens-dvr-ceph.local:
+      reclass_storage_name: openstack_telemetry_node02
+      roles:
+      - linux_system_codename_xenial
+      - openstack_telemetry
+      interfaces:
+        ens3:
+          role: single_dhcp
+        ens4:
+          role: single_ctl
+
+    mdb03.cookied-mcp-queens-dvr-ceph.local:
+      reclass_storage_name: openstack_telemetry_node03
+      roles:
+      - linux_system_codename_xenial
+      - openstack_telemetry
+      interfaces:
+        ens3:
+          role: single_dhcp
+        ens4:
+          role: single_ctl
diff --git a/tcp_tests/templates/shared-ceph.yaml b/tcp_tests/templates/shared-ceph.yaml
index 267e407..ab13cb2 100644
--- a/tcp_tests/templates/shared-ceph.yaml
+++ b/tcp_tests/templates/shared-ceph.yaml
@@ -111,14 +111,14 @@
 {%- endmacro %}
 
 {%- macro CONNECT_CEPH_TO_SERVICES() %}
-- description: Connect ceph to glance
+- description: Setup keyring for glance
   cmd: |
     salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@glance:server' state.sls ceph.common,ceph.setup.keyring;
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 2, delay: 5}
   skip_fail: false
 
-- description: Connect ceph to cinder and nova
+- description: Setup keyring for cinder and nova
   cmd: |
     salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@cinder:controller' state.sls ceph.common,ceph.setup.keyring;
     salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@nova:compute' state.sls ceph.common,ceph.setup.keyring;
@@ -126,4 +126,13 @@
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 2, delay: 5}
   skip_fail: false
+
+- description: Setup keyring for gnocchi
+  cmd: |
+    if salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@gnocchi:server' match.pillar 'ceph:common' ; then
+      salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@ceph:common and I@gnocchi:server' state.sls ceph.common,ceph.setup.keyring
+    fi
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
 {%- endmacro %}