Add ceph in queens

Change-Id: I1572dc86e71db6b803c00ad72f79012c018ca3c0
diff --git a/tcp_tests/templates/cookied-cicd-queens-dvr-sl/cookiecutter-context-queens-dvr-sl.yaml b/tcp_tests/templates/cookied-cicd-queens-dvr-sl/cookiecutter-context-queens-dvr-sl.yaml
index 0634833..c7465d2 100644
--- a/tcp_tests/templates/cookied-cicd-queens-dvr-sl/cookiecutter-context-queens-dvr-sl.yaml
+++ b/tcp_tests/templates/cookied-cicd-queens-dvr-sl/cookiecutter-context-queens-dvr-sl.yaml
@@ -1,7 +1,6 @@
 default_context:
   auditd_enabled: 'False'
   bmk_enabled: 'False'
-  ceph_enabled: 'False'
   cicd_control_node01_address: 10.167.4.91
   cicd_control_node01_hostname: cid01
   cicd_control_node02_address: 10.167.4.92
@@ -42,6 +41,41 @@
   cicd_public_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC/rgCcVsS645AcuWYySZpn4eH/yEn5V8Wkn8zNbXBbNjKGKzvcDyvE0VYn8jX8slKwUjypTQOnGMWNL0sxNMVeEM8+m7OBEvB9W6wSa5B1eM6JPfgAizTtDjDWeW8nb7+XvzyJ7UAR+d7B316tQc6zxa389Pc44z/SKRjsSJu9gXgvUtvEZEpidSRjsbd5qX1dxCmxPMAVFegrdZp9sIUEWx/MRY6HHVP62fVLBrE9gkO3U4EHWzvt6cW0HBuZt3SbUXW59JeZ1Z5rbEXf7lxpLq2mz+HCEKg5IlRBvv50riuLyiCrZgiF8Sm2sw/VH6dWoRjvo/fVpr9hLDjM69xD
   cluster_domain: cookied-cicd-queens-dvr-sl.local
   cluster_name: cookied-cicd-queens-dvr-sl
+  ceph_cluster_network: 10.167.4.0/24
+  ceph_enabled: 'True'
+  ceph_hyper_converged: 'False'
+  ceph_mon_node01_address: 10.167.4.96
+  ceph_mon_node01_hostname: cmn01
+  ceph_mon_node02_address: 10.167.4.97
+  ceph_mon_node02_hostname: cmn02
+  ceph_mon_node03_address: 10.167.4.98
+  ceph_mon_node03_hostname: cmn03
+  ceph_osd_backend: bluestore
+  ceph_osd_block_db_size: '10'
+  ceph_osd_bond_mode: active-backup
+  ceph_osd_count: '3'
+  ceph_osd_data_disks: /dev/vdb
+  ceph_osd_journal_or_block_db_disks: /dev/vdc
+  ceph_osd_node_count: '3'
+  ceph_osd_journal_size: '10'
+  ceph_osd_primary_first_nic: eth1
+  ceph_osd_primary_second_nic: eth2
+  ceph_osd_rack01_backend_subnet: 10.167.4
+  ceph_osd_rack01_hostname: osd
+  ceph_osd_rack01_single_subnet: 10.167.4
+  ceph_osd_single_address_ranges: 10.167.4.37-10.167.4.39
+  ceph_osd_deploy_address_ranges: 10.167.5.37-10.167.5.39
+  ceph_osd_backend_address_ranges: 10.167.4.37-10.167.4.39
+  ceph_public_network: 10.167.4.0/24
+  ceph_rgw_address: 10.167.4.75
+  ceph_rgw_hostname: rgw
+  ceph_rgw_node01_address: 10.167.4.76
+  ceph_rgw_node01_hostname: rgw01
+  ceph_rgw_node02_address: 10.167.4.77
+  ceph_rgw_node02_hostname: rgw02
+  ceph_rgw_node03_address: 10.167.4.78
+  ceph_rgw_node03_hostname: rgw03
+  ceph_version: luminous
   compute_bond_mode: active-backup
   compute_primary_first_nic: eth1
   compute_primary_second_nic: eth2
diff --git a/tcp_tests/templates/cookied-cicd-queens-dvr-sl/environment_context.yaml b/tcp_tests/templates/cookied-cicd-queens-dvr-sl/environment_context.yaml
index 1a294c0..6398208 100644
--- a/tcp_tests/templates/cookied-cicd-queens-dvr-sl/environment_context.yaml
+++ b/tcp_tests/templates/cookied-cicd-queens-dvr-sl/environment_context.yaml
@@ -295,3 +295,80 @@
           role: bond0_ab_ovs_vxlan_mesh
         ens6:
           role: bond1_ab_ovs_floating
+
+    osd<<count>>:
+      reclass_storage_name: ceph_osd_rack01
+      roles:
+      - ceph_osd
+      - linux_system_codename_xenial
+      interfaces:
+        ens3:
+          role: single_dhcp
+        ens4:
+          role: single_ctl
+
+    cmn01:
+      reclass_storage_name: ceph_mon_node01
+      roles:
+      - ceph_mon
+      - linux_system_codename_xenial
+      interfaces:
+        ens3:
+          role: single_dhcp
+        ens4:
+          role: single_ctl
+
+    cmn02:
+      reclass_storage_name: ceph_mon_node02
+      roles:
+      - ceph_mon
+      - linux_system_codename_xenial
+      interfaces:
+        ens3:
+          role: single_dhcp
+        ens4:
+          role: single_ctl
+
+    cmn03:
+      reclass_storage_name: ceph_mon_node03
+      roles:
+      - ceph_mon
+      - linux_system_codename_xenial
+      interfaces:
+        ens3:
+          role: single_dhcp
+        ens4:
+          role: single_ctl
+
+    rgw01:
+      reclass_storage_name: ceph_rgw_node01
+      roles:
+      - ceph_rgw
+      - linux_system_codename_xenial
+      interfaces:
+        ens3:
+          role: single_dhcp
+        ens4:
+          role: single_ctl
+
+    rgw02:
+      reclass_storage_name: ceph_rgw_node02
+      roles:
+      - ceph_rgw
+      - linux_system_codename_xenial
+      interfaces:
+        ens3:
+          role: single_dhcp
+        ens4:
+          role: single_ctl
+
+    rgw03:
+      reclass_storage_name: ceph_rgw_node03
+      roles:
+      - ceph_rgw
+      - linux_system_codename_xenial
+      interfaces:
+        ens3:
+          role: single_dhcp
+        ens4:
+          role: single_ctl
diff --git a/tcp_tests/templates/cookied-cicd-queens-dvr-sl/underlay.yaml b/tcp_tests/templates/cookied-cicd-queens-dvr-sl/underlay.yaml
index f82d245..1dd31a2 100644
--- a/tcp_tests/templates/cookied-cicd-queens-dvr-sl/underlay.yaml
+++ b/tcp_tests/templates/cookied-cicd-queens-dvr-sl/underlay.yaml
@@ -37,6 +37,16 @@
 {% set HOSTNAME_KMN01 = os_env('HOSTNAME_KMN01', 'kmn01') %}
 {% set HOSTNAME_KMN02 = os_env('HOSTNAME_KMN02', 'kmn02') %}
 {% set HOSTNAME_KMN03 = os_env('HOSTNAME_KMN03', 'kmn03') %}
+{% set HOSTNAME_CMN01 = os_env('HOSTNAME_CMN01', 'cmn01') %}
+{% set HOSTNAME_CMN02 = os_env('HOSTNAME_CMN02', 'cmn02') %}
+{% set HOSTNAME_CMN03 = os_env('HOSTNAME_CMN03', 'cmn03') %}
+{% set HOSTNAME_RGW01 = os_env('HOSTNAME_RGW01', 'rgw01') %}
+{% set HOSTNAME_RGW02 = os_env('HOSTNAME_RGW02', 'rgw02') %}
+{% set HOSTNAME_RGW03 = os_env('HOSTNAME_RGW03', 'rgw03') %}
+{% set HOSTNAME_OSD01 = os_env('HOSTNAME_OSD01', 'osd001') %}
+{% set HOSTNAME_OSD02 = os_env('HOSTNAME_OSD02', 'osd002') %}
+{% set HOSTNAME_OSD03 = os_env('HOSTNAME_OSD03', 'osd003') %}
+
 
 template:
   devops_settings:
@@ -75,6 +85,15 @@
             default_{{ HOSTNAME_GTW02 }}: +111
             default_{{ HOSTNAME_GTW03 }}: +112
             default_{{ HOSTNAME_PRX01 }}: +121
+            default_{{ HOSTNAME_OSD01 }}: +37
+            default_{{ HOSTNAME_OSD02 }}: +38
+            default_{{ HOSTNAME_OSD03 }}: +39
+            default_{{ HOSTNAME_CMN01 }}: +96
+            default_{{ HOSTNAME_CMN02 }}: +97
+            default_{{ HOSTNAME_CMN03 }}: +98
+            default_{{ HOSTNAME_RGW01 }}: +76
+            default_{{ HOSTNAME_RGW02 }}: +77
+            default_{{ HOSTNAME_RGW03 }}: +78
           ip_ranges:
             dhcp: [+90, -10]
 
@@ -110,6 +129,15 @@
             default_{{ HOSTNAME_GTW02 }}: +111
             default_{{ HOSTNAME_GTW03 }}: +112
             default_{{ HOSTNAME_PRX01 }}: +121
+            default_{{ HOSTNAME_OSD01 }}: +37
+            default_{{ HOSTNAME_OSD02 }}: +38
+            default_{{ HOSTNAME_OSD03 }}: +39
+            default_{{ HOSTNAME_CMN01 }}: +96
+            default_{{ HOSTNAME_CMN02 }}: +97
+            default_{{ HOSTNAME_CMN03 }}: +98
+            default_{{ HOSTNAME_RGW01 }}: +76
+            default_{{ HOSTNAME_RGW02 }}: +77
+            default_{{ HOSTNAME_RGW03 }}: +78
           ip_ranges:
             dhcp: [+90, -10]
 
@@ -141,6 +169,15 @@
             default_{{ HOSTNAME_GTW02 }}: +111
             default_{{ HOSTNAME_GTW03 }}: +112
             default_{{ HOSTNAME_PRX01 }}: +121
+            default_{{ HOSTNAME_OSD01 }}: +37
+            default_{{ HOSTNAME_OSD02 }}: +38
+            default_{{ HOSTNAME_OSD03 }}: +39
+            default_{{ HOSTNAME_CMN01 }}: +96
+            default_{{ HOSTNAME_CMN02 }}: +97
+            default_{{ HOSTNAME_CMN03 }}: +98
+            default_{{ HOSTNAME_RGW01 }}: +76
+            default_{{ HOSTNAME_RGW02 }}: +77
+            default_{{ HOSTNAME_RGW03 }}: +78
           ip_ranges:
             dhcp: [+10, -10]
 
@@ -172,6 +209,15 @@
             default_{{ HOSTNAME_GTW02 }}: +111
             default_{{ HOSTNAME_GTW03 }}: +112
             default_{{ HOSTNAME_PRX01 }}: +121
+            default_{{ HOSTNAME_OSD01 }}: +37
+            default_{{ HOSTNAME_OSD02 }}: +38
+            default_{{ HOSTNAME_OSD03 }}: +39
+            default_{{ HOSTNAME_CMN01 }}: +96
+            default_{{ HOSTNAME_CMN02 }}: +97
+            default_{{ HOSTNAME_CMN03 }}: +98
+            default_{{ HOSTNAME_RGW01 }}: +76
+            default_{{ HOSTNAME_RGW02 }}: +77
+            default_{{ HOSTNAME_RGW03 }}: +78
           ip_ranges:
             dhcp: [+180, +220]
 
@@ -948,3 +994,255 @@
 
               interfaces: *interfaces
               network_config: *network_config
+
+          - name: {{ HOSTNAME_CMN01 }}
+            role: salt_minion
+            params:
+              vcpu: !os_env SLAVE_NODE_CPU, 2
+              memory: !os_env SLAVE_NODE_MEMORY, 2048
+              boot:
+                - hd
+              cloud_init_volume_name: iso
+              cloud_init_iface_up: ens3
+              volumes:
+                - name: system
+                  capacity: !os_env NODE_VOLUME_SIZE, 150
+                  backing_store: cloudimage1604
+                  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_swp
+
+              interfaces: *interfaces
+              network_config: *network_config
+
+          - name: {{ HOSTNAME_CMN02 }}
+            role: salt_minion
+            params:
+              vcpu: !os_env SLAVE_NODE_CPU, 2
+              memory: !os_env SLAVE_NODE_MEMORY, 2048
+              boot:
+                - hd
+              cloud_init_volume_name: iso
+              cloud_init_iface_up: ens3
+              volumes:
+                - name: system
+                  capacity: !os_env NODE_VOLUME_SIZE, 150
+                  backing_store: cloudimage1604
+                  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_swp
+
+              interfaces: *interfaces
+              network_config: *network_config
+
+          - name: {{ HOSTNAME_CMN03 }}
+            role: salt_minion
+            params:
+              vcpu: !os_env SLAVE_NODE_CPU, 2
+              memory: !os_env SLAVE_NODE_MEMORY, 2048
+              boot:
+                - hd
+              cloud_init_volume_name: iso
+              cloud_init_iface_up: ens3
+              volumes:
+                - name: system
+                  capacity: !os_env NODE_VOLUME_SIZE, 150
+                  backing_store: cloudimage1604
+                  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_swp
+
+              interfaces: *interfaces
+              network_config: *network_config
+
+          - name: {{ HOSTNAME_OSD01 }}
+            role: salt_minion
+            params:
+              vcpu: !os_env SLAVE_NODE_CPU, 2
+              memory: !os_env SLAVE_NODE_MEMORY, 2048
+              boot:
+                - hd
+              cloud_init_volume_name: iso
+              cloud_init_iface_up: ens3
+              volumes:
+                - name: system
+                  capacity: !os_env NODE_VOLUME_SIZE, 150
+                  backing_store: cloudimage1604
+                  format: qcow2
+                - name: ceph_osd
+                  capacity: 50
+                  format: qcow2
+                - name: ceph_journal
+                  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_swp
+
+              interfaces: *interfaces
+              network_config: *network_config
+
+          - name: {{ HOSTNAME_OSD02 }}
+            role: salt_minion
+            params:
+              vcpu: !os_env SLAVE_NODE_CPU, 2
+              memory: !os_env SLAVE_NODE_MEMORY, 2048
+              boot:
+                - hd
+              cloud_init_volume_name: iso
+              cloud_init_iface_up: ens3
+              volumes:
+                - name: system
+                  capacity: !os_env NODE_VOLUME_SIZE, 150
+                  backing_store: cloudimage1604
+                  format: qcow2
+                - name: ceph_osd
+                  capacity: 50
+                  format: qcow2
+                - name: ceph_journal
+                  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_swp
+
+              interfaces: *interfaces
+              network_config: *network_config
+
+          - name: {{ HOSTNAME_OSD03 }}
+            role: salt_minion
+            params:
+              vcpu: !os_env SLAVE_NODE_CPU, 2
+              memory: !os_env SLAVE_NODE_MEMORY, 2048
+              boot:
+                - hd
+              cloud_init_volume_name: iso
+              cloud_init_iface_up: ens3
+              volumes:
+                - name: system
+                  capacity: !os_env NODE_VOLUME_SIZE, 150
+                  backing_store: cloudimage1604
+                  format: qcow2
+                - name: ceph_osd
+                  capacity: 50
+                  format: qcow2
+                - name: ceph_journal
+                  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_swp
+
+              interfaces: *interfaces
+              network_config: *network_config
+
+          - name: {{ HOSTNAME_RGW01 }}
+            role: salt_minion
+            params:
+              vcpu: !os_env SLAVE_NODE_CPU, 2
+              memory: !os_env SLAVE_NODE_MEMORY, 2048
+              boot:
+                - hd
+              cloud_init_volume_name: iso
+              cloud_init_iface_up: ens3
+              volumes:
+                - name: system
+                  capacity: !os_env NODE_VOLUME_SIZE, 150
+                  backing_store: cloudimage1604
+                  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_swp
+
+              interfaces: *interfaces
+              network_config: *network_config
+
+          - name: {{ HOSTNAME_RGW02 }}
+            role: salt_minion
+            params:
+              vcpu: !os_env SLAVE_NODE_CPU, 2
+              memory: !os_env SLAVE_NODE_MEMORY, 2048
+              boot:
+                - hd
+              cloud_init_volume_name: iso
+              cloud_init_iface_up: ens3
+              volumes:
+                - name: system
+                  capacity: !os_env NODE_VOLUME_SIZE, 150
+                  backing_store: cloudimage1604
+                  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_swp
+
+              interfaces: *interfaces
+              network_config: *network_config
+
+          - name: {{ HOSTNAME_RGW03 }}
+            role: salt_minion
+            params:
+              vcpu: !os_env SLAVE_NODE_CPU, 2
+              memory: !os_env SLAVE_NODE_MEMORY, 2048
+              boot:
+                - hd
+              cloud_init_volume_name: iso
+              cloud_init_iface_up: ens3
+              volumes:
+                - name: system
+                  capacity: !os_env NODE_VOLUME_SIZE, 150
+                  backing_store: cloudimage1604
+                  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_swp
+
+              interfaces: *interfaces
+              network_config: *network_config
diff --git a/tcp_tests/templates/cookied-model-generator/salt_cookied-cicd-queens-dvr-sl.yaml b/tcp_tests/templates/cookied-model-generator/salt_cookied-cicd-queens-dvr-sl.yaml
index 1bda65e..2eb94c1 100644
--- a/tcp_tests/templates/cookied-model-generator/salt_cookied-cicd-queens-dvr-sl.yaml
+++ b/tcp_tests/templates/cookied-model-generator/salt_cookied-cicd-queens-dvr-sl.yaml
@@ -47,4 +47,12 @@
   retry: {count: 1, delay: 5}
   skip_fail: false
 
+- description: Temporary workaround !! Fix or debug
+  cmd: |
+    sed -i 's/pg_num: 128/pg_num: 4/g' /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/ceph/setup.yml;
+    sed -i 's/pgp_num: 128/pgp_num: 4/g' /srv/salt/reclass/classes/cluster/{{ SHARED.CLUSTER_NAME }}/ceph/setup.yml;
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: true
+
 {{ SHARED.MACRO_GENERATE_INVENTORY(RERUN_SALTMASTER_STATE=true) }}