Modifying new cookied model for baremetal

Removing openstack_telemetry (mdb) nodes due to this merge
https://github.com/Mirantis/mk2x-cookiecutter-reclass-model/commit/6191e302eecaf62451415ec2eeea992b28d11f71
Hack virouter
reboot cmp
change cookiecutter-contex to another file (with dpdk)
Change stacklight VIP determining
Move cinder lvm to computes
Add workarounds for cinder backend

Change-Id: I9bfe68a91723563bbd1507d6468b8f4b9efe2861
diff --git a/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/common-services.yaml b/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/common-services.yaml
index 0c3ef93..5a4fe25 100644
--- a/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/common-services.yaml
+++ b/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/common-services.yaml
@@ -1,4 +1,56 @@
 {% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import HOSTNAME_CFG01 with context %}
+{% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import HOSTNAME_KVM01 with context %}
+{% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import HOSTNAME_KVM02 with context %}
+{% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import HOSTNAME_KVM03 with context %}
+
+
+- description: (REMOVE asap) Hack KVMs of Hash sum mismatch
+  cmd: |
+    rm -rf /var/lib/apt/lists/*;
+    apt-get clean;
+    apt-get update;
+  node_name: {{ HOSTNAME_KVM01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: true
+
+- description: (REMOVE asap) Hack KVMs of Hash sum mismatch
+  cmd: |
+    rm -rf /var/lib/apt/lists/*;
+    apt-get clean;
+    apt-get update;
+  node_name: {{ HOSTNAME_KVM02 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: true
+
+- description: (REMOVE asap) Hack KVMs of Hash sum mismatch
+  cmd: |
+    rm -rf /var/lib/apt/lists/*;
+    apt-get clean;
+    apt-get update;
+  node_name: {{ HOSTNAME_KVM03 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: true
+
+- description: Install glusterfs
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
+    -C 'I@glusterfs:server' state.sls glusterfs.server.service
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
+- description: Setup glusterfs on primary controller
+  cmd: sleep 30; salt --hard-crash --state-output=mixed --state-verbose=False
+    -C 'I@glusterfs:server' state.sls glusterfs.server.setup -b 1
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 2, delay: 30}
+  skip_fail: false
+
+- description: Check the gluster status
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
+    -C 'I@glusterfs:server' cmd.run 'gluster peer status; gluster volume status' -b 1
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
 
 # Install support services
 - description: Install keepalived on ctl01
@@ -24,28 +76,6 @@
   retry: {count: 1, delay: 5}
   skip_fail: false
 
-
-- description: Install glusterfs
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-    -C 'I@glusterfs:server' state.sls glusterfs.server.service
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 5}
-  skip_fail: false
-
-- description: Setup glusterfs on primary controller
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-    -C 'I@glusterfs:server' state.sls glusterfs.server.setup -b 1
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 2, delay: 5}
-  skip_fail: false
-
-- description: Check the gluster status
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-    -C 'I@glusterfs:server' cmd.run 'gluster peer status; gluster volume status' -b 1
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 5}
-  skip_fail: false
-
 - description: Install RabbitMQ on ctl01
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
     -C 'I@rabbitmq:server and *01*' state.sls rabbitmq
diff --git a/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/lab04-physical-inventory.yaml b/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/lab04-physical-inventory.yaml
index 8234156..21b0703 100644
--- a/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/lab04-physical-inventory.yaml
+++ b/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/lab04-physical-inventory.yaml
@@ -1,4 +1,12 @@
 nodes:

+    cfg01.cookied-bm-mcp-ocata-contrail.local:

+      reclass_storage_name: infra_config_node01

+      roles:

+      - infra_config

+      - linux_system_codename_xenial

+      interfaces:

+        ens3:

+          role: single_dhcp

     # Physical nodes

 

     kvm01.cookied-bm-mcp-ocata-contrail.local:

@@ -37,34 +45,46 @@
     cmp001.cookied-bm-mcp-ocata-contrail.local:

       reclass_storage_name: openstack_compute_node01

       roles:

-      - openstack_compute

+      - openstack_compute_dpdk

+      - features_lvm_backend

       - linux_system_codename_xenial

       interfaces:

         enp2s0f1:

-          role: parametrized_interface

+          role: single_mgm

           deploy_address: 172.16.49.72

-        enp2s0f0:

-          role: parametrized_interface

-          single_address: 10.167.4.72

         enp5s0f0:

-          role: parametrized_interface

+          role: bond2_contrail_dpdk_prv

+          dpdk_pci: "'0000:05:00.0'"

+          dpdk_mac: '90:e2:ba:19:c2:18'

+        enp5s0f1:

+          role: bond0_ab_ctl_contrail

           tenant_address: 192.168.0.101

+          single_address: 10.167.8.101

+        # enp5s0f1:

+        #   role: single_vlan_ctl

+        #   single_address: 10.167.8.101

 

     cmp002.cookied-bm-mcp-ocata-contrail.local:

       reclass_storage_name: openstack_compute_node02

       roles:

-      - openstack_compute

+      - openstack_compute_dpdk

+      - features_lvm_backend

       - linux_system_codename_xenial

       interfaces:

         enp2s0f1:

-          role: parametrized_interface

+          role: single_mgm

           deploy_address: 172.16.49.74

-        enp2s0f0:

-          role: parametrized_interface

-          single_address: 10.167.4.74

         enp5s0f0:

-          role: parametrized_interface

-          tenant_address: 192.168.0.102

+          role: bond2_contrail_dpdk_prv

+          tenant_address: 192.168.0.101

+          dpdk_pci: "'0000:05:00.0'"

+          dpdk_mac: '00:1b:21:87:21:98'

+        enp5s0f1:

+          role: bond0_ab_ctl_contrail

+          single_address: 10.167.8.102

+        # enp5s0f1:

+        #   role: single_vlan_ctl

+        #   single_address: 10.167.8.102

 

 #    gtw01.cookied-bm-mcp-ocata-contrail.local:

 #      reclass_storage_name: openstack_gateway_node01

diff --git a/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/openstack.yaml b/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/openstack.yaml
index ffcf909..c0066d6 100644
--- a/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/openstack.yaml
+++ b/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/openstack.yaml
@@ -1,12 +1,9 @@
 {% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import HOSTNAME_CFG01 with context %}
-{% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import HOSTNAME_CTL01 with context %}
-{% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import HOSTNAME_CTL02 with context %}
-{% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import HOSTNAME_CTL03 with context %}
 {% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import HOSTNAME_GTW01 with context %}
 {% from 'shared-salt.yaml' import IPV4_NET_EXTERNAL_PREFIX with context %}
 {% from 'shared-salt.yaml' import IPV4_NET_TENANT_PREFIX with context %}
-{% set PATTERN = os_env('PATTERN', 'smoke') %}
-
+{% set PATTERN = os_env('PATTERN', 'false') %}
+{% set RUN_TEMPEST = os_env('RUN_TEMPEST', 'false') %}
 # Install OpenStack control services
 
 - description: Install glance on all controllers
@@ -93,6 +90,13 @@
   retry: {count: 1, delay: 5}
   skip_fail: false
 
+- description: Install cinder volume
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
+    -C 'I@cinder:volume' state.sls cinder
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
 - description: Check cinder list
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
     -C 'I@keystone:server' cmd.run '. /root/keystonerc; cinder list'
@@ -123,6 +127,13 @@
   retry: {count: 3, delay: 5}
   skip_fail: false
 
+- description: Configure contrail
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
+    -C 'I@opencontrail:collector' state.sls opencontrail.collector
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
 - description: Install contrail on all nodes still skipping client
   cmd: salt --hard-crash --state-output=mixed --state-verbose=Falsa
     -C 'I@opencontrail:control' state.sls opencontrail exclude=opencontrail.client
@@ -130,56 +141,34 @@
   retry: {count: 2, delay: 5}
   skip_fail: false
 
-- description: Install contrail and do client part as well
+- description: Check contrail status
+  cmd: sleep 30; salt --hard-crash --state-output=mixed --state-verbose=False
+    -C 'I@opencontrail:control' cmd.run contrail-status
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
+- description: Install contrail and do client part as well (count and delay for waiting for collector connection)
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
     -C 'I@opencontrail:control' state.sls opencontrail
   node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 5}
+  retry: {count: 5, delay: 60}
   skip_fail: false
 
 - description: Configure contrail
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
     -C 'I@opencontrail:database:id:1' state.sls opencontrail.client
   node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 5}
+  retry: {count: 2, delay: 5}
   skip_fail: false
 
 - description: Check contrail status
-  cmd: sleep 15; salt --hard-crash --state-output=mixed --state-verbose=False
+  cmd: sleep 30; salt --hard-crash --state-output=mixed --state-verbose=False
     -C 'I@opencontrail:control' cmd.run contrail-status
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 5}
   skip_fail: false
 
-#- description: Install neutron on gtw node
-#  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-#    -C 'I@neutron:gateway' state.sls neutron
-#  node_name: {{ HOSTNAME_CFG01 }}
-#  retry: {count: 1, delay: 5}
-#  skip_fail: false
-
-# isntall designate
-- description: Install powerdns
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-    -C 'ctl*' state.sls powerdns
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 5}
-  skip_fail: false
-
-- description: Install designate
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-    -C 'I@designate:server' state.sls designate -b 1
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 5, delay: 10}
-  skip_fail: false
-
-#- description: Check neutron agent-list
-#  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-#    -C 'I@keystone:server' cmd.run '. /root/keystonerc; neutron agent-list'
-#  node_name: {{ HOSTNAME_CFG01 }}
-#  retry: {count: 1, delay: 5}
-#  skip_fail: false
-
 - description: Install heat service
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
     -C 'I@heat:server' state.sls heat -b 1
@@ -248,19 +237,19 @@
   retry: {count: 1, delay: 30}
   skip_fail: false
 
-- description: Create net04_external
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
-    '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
+#- description: Create net04_external
+#  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
+#    '. /root/keystonercv3; neutron net-create net04_ext --router:external True --provider:physical_network physnet1 --provider:network_type flat'
+#  node_name: {{ HOSTNAME_CFG01 }}
+#  retry: {count: 1, delay: 30}
+#  skip_fail: false
 
-- description: Create subnet_external
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
-    '. /root/keystonercv3; neutron subnet-create net04_ext {{ IPV4_NET_EXTERNAL_PREFIX }}.0/24 --name net04_ext__subnet --disable-dhcp --allocation-pool start={{ IPV4_NET_EXTERNAL_PREFIX }}.150,end={{ IPV4_NET_EXTERNAL_PREFIX }}.180 --gateway {{ IPV4_NET_EXTERNAL_PREFIX }}.1'
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
+#- description: Create subnet_external
+#  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
+#    '. /root/keystonercv3; neutron subnet-create net04_ext {{ IPV4_NET_EXTERNAL_PREFIX }}.0/24 --name net04_ext__subnet --disable-dhcp --allocation-pool start={{ IPV4_NET_EXTERNAL_PREFIX }}.150,end={{ IPV4_NET_EXTERNAL_PREFIX }}.180 --gateway {{ IPV4_NET_EXTERNAL_PREFIX }}.1'
+#  node_name: {{ HOSTNAME_CFG01 }}
+#  retry: {count: 1, delay: 30}
+#  skip_fail: false
 
 - description: Create net04
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
@@ -283,12 +272,12 @@
   retry: {count: 1, delay: 30}
   skip_fail: false
 
-- description: Set geteway
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
-    '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
+#- description: Set geteway
+#  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
+#    '. /root/keystonercv3; neutron router-gateway-set net04_router01 net04_ext'
+#  node_name: {{ HOSTNAME_CFG01 }}
+#  retry: {count: 1, delay: 30}
+#  skip_fail: false
 
 - description:  Add interface
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl01*' cmd.run
@@ -318,127 +307,108 @@
   retry: {count: 1, delay: 30}
   skip_fail: false
 
-- description: Temp workaround of  PROD-13167
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run
-    'apt-get install python-pymysql -y'
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
-
-# Configure cinder-volume salt-call PROD-13167
-- description: Set disks 01
-  cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
-  node_name: {{ HOSTNAME_CTL01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
-
-- description: Set disks 02
-  cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
-  node_name: {{ HOSTNAME_CTL02 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
-
-- description: Set disks 03
-  cmd: salt-call cmd.run 'echo -e "nn\np\n\n\n\nw" | fdisk /dev/vdb'
-  node_name: {{ HOSTNAME_CTL03 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
-
-- description: Create partitions 01
-  cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
-  node_name: {{ HOSTNAME_CTL01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
-
-- description: Create partitions 02
-  cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
-  node_name: {{ HOSTNAME_CTL02 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
-
-- description: Create partitions 03
-  cmd: salt-call cmd.run 'pvcreate /dev/vdb1'
-  node_name: {{ HOSTNAME_CTL03 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
-
-- description: create volume_group
-  cmd: salt "ctl*" cmd.run 'vgcreate cinder-volumes /dev/vdb1'
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
-
-- description: Install cinder-volume
-  cmd: salt 'ctl*' cmd.run 'apt-get install cinder-volume -y'
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
-
-- description: Install crudini
-  cmd: salt "ctl*" cmd.run 'apt-get install crudini -y'
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
-
-- description: Temporary WR set enabled backends value 01
-  cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
-  node_name: {{ HOSTNAME_CTL01 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
-
-- description: Temporary WR set enabled backends value 02
-  cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
-  node_name: {{ HOSTNAME_CTL02 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
-
-- description: Temporary WR set enabled backends value 03
-  cmd: salt-call cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
-  node_name: {{ HOSTNAME_CTL03 }}
-  retry: {count: 1, delay: 30}
-  skip_fail: false
-
-#- description: Install docker.io on gtw
-#  cmd: salt-call cmd.run 'apt-get install docker.io -y'
-#  node_name: {{ HOSTNAME_GTW01 }}
+#- description: Install lvm2 packages
+#  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' cmd.run
+#    'apt-get install python-pymysql lvm2 -y'
+#  node_name: {{ HOSTNAME_CFG01 }}
 #  retry: {count: 1, delay: 30}
 #  skip_fail: false
 
-- description: create rc file on cfg
-  cmd: scp ctl01:/root/keystonercv3 /root
+#- description: Install crudini
+#  cmd: salt -C "cmp*" cmd.run 'apt-get install crudini -y'
+#  node_name: {{ HOSTNAME_CFG01 }}
+#  retry: {count: 1, delay: 30}
+#  skip_fail: true
+
+#- description: Temporary WR set enabled backends value
+#  cmd: salt "cmp*" cmd.run 'crudini --verbose --set /etc/cinder/cinder.conf DEFAULT enabled_backends lvm'
+#  node_name: {{ HOSTNAME_CFG01 }}
+#  retry: {count: 1, delay: 30}
+#  skip_fail: false
+
+#- description: Start cinder-volume service
+#  cmd: salt "cmp*" cmd.run '/etc/init.d/cinder-volume stop; /etc/init.d/cinder-volume start;'
+#  node_name: {{ HOSTNAME_CFG01 }}
+#  retry: {count: 1, delay: 10}
+#  skip_fail: true
+
+- description: Install docker.io on ctl
+  cmd: salt "ctl01*" cmd.run 'apt-get install docker.io -y'
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 30}
   skip_fail: false
 
+#- description: create rc file on cfg
+#  cmd: scp ctl01:/root/keystonercv3 /root
+#  node_name: {{ HOSTNAME_CFG01 }}
+#  retry: {count: 1, delay: 30}
+#  skip_fail: false
+
 #- description: Copy rc file
 #  cmd: scp /root/keystonercv3 gtw01:/root
 #  node_name: {{ HOSTNAME_CFG01 }}
 #  retry: {count: 1, delay: 30}
 #  skip_fail: false
 
-#- description: Run tests
-#  cmd: |
-#    if [[ {{ PATTERN }} == "false" ]]; then
-#        docker run --rm --net=host  -e TEMPEST_CONF=lvm_mcp.conf  -e SKIP_LIST=mcp_skip.list  -e SOURCE_FILE=keystonercv3 -v /etc/ssl/certs/:/etc/ssl/certs/ -v /root/:/home/rally docker-sandbox.sandbox.mirantis.net/rally-tempest/rally-tempest:with_designate  >> image.output
-#    else
-#        docker run --rm --net=host  -e TEMPEST_CONF=lvm_mcp.conf  -e SKIP_LIST=mcp_skip.list  -e SOURCE_FILE=keystonercv3 -v /etc/ssl/certs/:/etc/ssl/certs/ -e CUSTOM='--pattern {{ PATTERN }}' -v /root/:/home/rally docker-sandbox.sandbox.mirantis.net/rally-tempest/rally-tempest:with_designate  >> image.output
-#    fi
-#  node_name: {{ HOSTNAME_GTW01 }}
-#  retry: {count: 1, delay: 5}
-#  skip_fail: false
+- description: Hack resolv.conf on VCP nodes for internal services access
+  cmd: |
+    salt --hard-crash --state-output=mixed --state-verbose=False -C '* and not kvm* and not cmp* and not gtw* and not cfg*' cmd.run "echo 'nameserver 172.18.208.44' > /etc/resolv.conf;"
+    salt --hard-crash --state-output=mixed --state-verbose=False -C '* and not kvm* and not cmp* and not gtw* and not cfg*' cmd.run "echo 'nameserver 8.8.8.8' >> /etc/resolv.conf;"
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
 
-#- description: Download xml results
-#  download:
-#    remote_path: /root
-#    remote_filename: "report_*.xml"
-#    local_path: {{ os_env('PWD') }}
-#  node_name: {{ HOSTNAME_GTW01 }}
-#  skip_fail: true
+
+- description: Hack vrouter (Delete default moun point)
+  cmd: salt "cmp*" cmd.run "sed -i 's/exit 0//g' /etc/rc.local; echo 'umount /dev/hugepages; service supervisor-vrouter restart' >> /etc/rc.local; echo 'exit 0' >> /etc/rc.local"
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 30}
+  skip_fail: true
+
+- description: Temporary WR for correct pci in vrouter.conf
+  cmd: salt  "cmp*" cmd.run "sed -i 's/physical\_interface\_address\=.*/physical\_interface\_address=0000\:05\:00\.0/g' /etc/contrail/contrail-vrouter-agent.conf"
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 30}
+  skip_fail: true
+
+- description: Remove crashes files from /var/crashes/ while vrouter was crashed
+  cmd: salt  "cmp*" cmd.run "rm -rf /var/crashes/*"
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 30}
+  skip_fail: true
+
+- description: Reboot computes
+  cmd: salt --timeout=600  "cmp*" system.reboot
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 30}
+  skip_fail: true
+
+{%- if RUN_TEMPEST %}
+- description: Run tests
+  cmd: |
+    if [[ {{ PATTERN }} == "false" ]]; then
+        salt "ctl01*" cmd.run "docker run --rm --net=host  -e TEMPEST_CONF=lvm_mcp.conf  -e SKIP_LIST=mcp_skip.list  -e SOURCE_FILE=keystonercv3 -v /etc/ssl/certs/:/etc/ssl/certs/ -v /root/:/home/rally sandriichenko/rally_tempest_docker:mcp1.1_ocata  >> image.output"
+    else
+        salt "ctl01*" cmd.run "docker run --rm --net=host  -e TEMPEST_CONF=lvm_mcp.conf  -e SKIP_LIST=mcp_skip.list  -e SOURCE_FILE=keystonercv3 -v /etc/ssl/certs/:/etc/ssl/certs/ -e CUSTOM='--pattern {{ PATTERN }}' -v /root/:/home/rally sandriichenko/rally_tempest_docker:mcp1.1_ocata  >> image.output"
+    fi
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
+- description: Download xml and html results
+  cmd: |
+    d=$(date +%Y-%m-%d)
+    ctl01_ip=`salt --out=newline_values_only 'ctl01*' grains.get ip4_interfaces:ens2`;
+    scp root@$ctl01_ip:/root/report*.xml /root/report_$d.xml;
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: true
+{%- endif %}
 
 #- description: Download html results
 #  download:
 #    remote_path: /root
 #    remote_filename: "report_*.html"
 #    local_path: {{ os_env('PWD') }}
-#  node_name: {{ HOSTNAME_GTW01 }}
+#  node_name: {{ HOSTNAME_CFG01 }}
 #  skip_fail: true
diff --git a/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/salt-context-cookiecutter-contrail-dpdk.yaml b/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/salt-context-cookiecutter-contrail-dpdk.yaml
new file mode 100644
index 0000000..769ded7
--- /dev/null
+++ b/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/salt-context-cookiecutter-contrail-dpdk.yaml
@@ -0,0 +1,161 @@
+default_context:

+  cicd_enabled: 'False'

+  cluster_domain: cookied-bm-mcp-ocata-contrail.local

+  cluster_name: deployment_name

+  compute_bond_mode: active-backup

+  compute_primary_first_nic: enp5s0f0

+  compute_primary_second_nic: enp5s0f1

+  context_seed: WCQ00jbWQE6qxjDdhHsS7SNGExTJ9HVanC9LXyJHF2IIe0Qj6vtaXFP5FSwEK6jm

+  control_network_netmask: 255.255.255.0

+  control_network_subnet: 10.167.8.0/24

+  control_vlan: '2422'

+  cookiecutter_template_branch: master

+  cookiecutter_template_credentials: gerrit

+  cookiecutter_template_url: ssh://mcp-jenkins@gerrit.mcp.mirantis.net:29418/mk/cookiecutter-templates.git

+  deploy_network_gateway: 172.16.49.126

+  deploy_network_netmask: 255.255.255.192

+  deploy_network_subnet: 172.16.49.64/26

+  deployment_type: physical

+  dns_server01: 8.8.8.8

+  dns_server02: 8.8.4.4

+  email_address: sgudz@mirantis.com

+  infra_bond_mode: active-backup

+  infra_deploy_nic: eth0

+  infra_kvm01_control_address: 10.167.8.241

+  infra_kvm01_deploy_address: 172.16.49.67

+  infra_kvm01_hostname: kvm01

+  infra_kvm02_control_address: 10.167.8.242

+  infra_kvm02_deploy_address: 172.16.49.68

+  infra_kvm02_hostname: kvm02

+  infra_kvm03_control_address: 10.167.8.243

+  infra_kvm03_deploy_address: 172.16.49.69

+  infra_kvm03_hostname: kvm03

+  infra_kvm_vip_address: 10.167.8.240

+  infra_primary_first_nic: eth2

+  infra_primary_second_nic: eth3

+  kubernetes_enabled: 'False'

+  local_repositories: 'False'

+  maas_deploy_address: 10.167.8.91

+  maas_hostname: cfg01

+  opencontrail_analytics_address: 10.167.8.30

+  opencontrail_analytics_hostname: nal

+  opencontrail_analytics_node01_address: 10.167.8.31

+  opencontrail_analytics_node01_hostname: nal01

+  opencontrail_analytics_node02_address: 10.167.8.32

+  opencontrail_analytics_node02_hostname: nal02

+  opencontrail_analytics_node03_address: 10.167.8.33

+  opencontrail_analytics_node03_hostname: nal03

+  opencontrail_compute_iface_mask: '24'

+  opencontrail_control_address: 10.167.8.20

+  opencontrail_control_hostname: ntw

+  opencontrail_control_node01_address: 10.167.8.21

+  opencontrail_control_node01_hostname: ntw01

+  opencontrail_control_node02_address: 10.167.8.22

+  opencontrail_control_node02_hostname: ntw02

+  opencontrail_control_node03_address: 10.167.8.23

+  opencontrail_control_node03_hostname: ntw03

+  opencontrail_enabled: 'True'

+  opencontrail_router01_address: 10.167.8.100

+  opencontrail_router01_hostname: rtr01

+  opencontrail_router02_address: 10.167.8.101

+  opencontrail_router02_hostname: rtr02

+  openstack_benchmark_node01_address: 10.167.8.95

+  openstack_benchmark_node01_hostname: bmk01

+  openstack_compute_count: '1'

+  openstack_compute_rack01_hostname: cmpt

+  openstack_compute_rack01_single_subnet: 10.167.8

+  openstack_compute_rack01_tenant_subnet: 192.168.0

+

+  openstack_compute_node01_hostname: cmp001

+  openstack_compute_node02_hostname: cmp002

+  openstack_compute_node01_address: 10.167.8.101

+  openstack_compute_node02_address: 10.167.8.102

+  openstack_compute_node01_single_address: 10.167.8.101

+  openstack_compute_node02_single_address: 10.167.8.102

+  openstack_compute_node01_deploy_address: 172.16.49.72

+  openstack_compute_node02_deploy_address: 172.16.49.74

+

+  openstack_control_address: 10.167.8.10

+  openstack_control_hostname: ctl

+  openstack_control_node01_address: 10.167.8.11

+  openstack_control_node01_hostname: ctl01

+  openstack_control_node02_address: 10.167.8.12

+  openstack_control_node02_hostname: ctl02

+  openstack_control_node03_address: 10.167.8.13

+  openstack_control_node03_hostname: ctl03

+  openstack_database_address: 10.167.8.50

+  openstack_database_hostname: dbs

+  openstack_database_node01_address: 10.167.8.51

+  openstack_database_node01_hostname: dbs01

+  openstack_database_node02_address: 10.167.8.52

+  openstack_database_node02_hostname: dbs02

+  openstack_database_node03_address: 10.167.8.53

+  openstack_database_node03_hostname: dbs03

+  openstack_enabled: 'True'

+  openstack_message_queue_address: 10.167.8.40

+  openstack_message_queue_hostname: msg

+  openstack_message_queue_node01_address: 10.167.8.41

+  openstack_message_queue_node01_hostname: msg01

+  openstack_message_queue_node02_address: 10.167.8.42

+  openstack_message_queue_node02_hostname: msg02

+  openstack_message_queue_node03_address: 10.167.8.43

+  openstack_message_queue_node03_hostname: msg03

+  openstack_network_engine: opencontrail

+  openstack_nfv_sriov_enabled: 'False'

+  openstack_nova_compute_nfv_req_enabled: 'False'

+  openstack_proxy_address: 10.167.8.80

+  openstack_proxy_hostname: prx

+  openstack_proxy_node01_address: 10.167.8.81

+  openstack_proxy_node01_hostname: prx01

+  openstack_proxy_node02_address: 10.167.8.82

+  openstack_proxy_node02_hostname: prx02

+  openstack_version: ocata

+  oss_enabled: 'False'

+  oss_notification_app_id: '24'

+  oss_notification_sender_password: password

+  oss_notification_smtp_port: '587'

+  oss_notification_webhook_login_id: '13'

+  platform: openstack_enabled

+  public_host: ${_param:openstack_proxy_address}

+  publication_method: email

+  reclass_repository: https://github.com/Mirantis/mk-lab-salt-model.git

+  salt_master_address: 10.167.8.66

+  salt_master_hostname: cfg01

+  salt_master_management_address: 172.16.49.66

+  shared_reclass_url: ssh://mcp-jenkins@gerrit.mcp.mirantis.net:29418/salt-models/reclass-system.git

+  stacklight_enabled: 'True'

+  stacklight_log_address: 10.167.8.60

+  stacklight_log_hostname: log

+  stacklight_log_node01_address: 10.167.8.61

+  stacklight_log_node01_hostname: log01

+  stacklight_log_node02_address: 10.167.8.62

+  stacklight_log_node02_hostname: log02

+  stacklight_log_node03_address: 10.167.8.63

+  stacklight_log_node03_hostname: log03

+  stacklight_monitor_address: 10.167.8.70

+  stacklight_monitor_hostname: mon

+  stacklight_monitor_node01_address: 10.167.8.71

+  stacklight_monitor_node01_hostname: mon01

+  stacklight_monitor_node02_address: 10.167.8.72

+  stacklight_monitor_node02_hostname: mon02

+  stacklight_monitor_node03_address: 10.167.8.73

+  stacklight_monitor_node03_hostname: mon03

+  stacklight_notification_address: alerts@localhost

+  stacklight_notification_smtp_host: 127.0.0.1

+  stacklight_telemetry_address: 10.167.8.85

+  stacklight_telemetry_hostname: mtr

+  stacklight_telemetry_node01_address: 10.167.8.86

+  stacklight_telemetry_node01_hostname: mtr01

+  stacklight_telemetry_node02_address: 10.167.8.87

+  stacklight_telemetry_node02_hostname: mtr02

+  stacklight_telemetry_node03_address: 10.167.8.88

+  stacklight_telemetry_node03_hostname: mtr03

+  stacklight_version: '2'

+  tenant_network_gateway: ''

+  tenant_network_netmask: 255.255.255.0

+  tenant_network_subnet: 192.168.0.0/24

+  tenant_vlan: '2423'

+  upstream_proxy_enabled: 'False'

+  openstack_nfv_dpdk_enabled: 'True'

+  openstack_nova_compute_hugepages_count: 40

+  opencontrail_compute_iface: 'enp5s0f0'

diff --git a/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/salt-context-cookiecutter-contrail.yaml b/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/salt-context-cookiecutter-contrail.yaml
index 4eecd23..f791c23 100644
--- a/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/salt-context-cookiecutter-contrail.yaml
+++ b/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/salt-context-cookiecutter-contrail.yaml
@@ -7,7 +7,7 @@
   compute_primary_second_nic: enp5s0f1

   context_seed: WCQ00jbWQE6qxjDdhHsS7SNGExTJ9HVanC9LXyJHF2IIe0Qj6vtaXFP5FSwEK6jm

   control_network_netmask: 255.255.255.0

-  control_network_subnet: 10.167.4.0/24

+  control_network_subnet: 10.167.8.0/24

   control_vlan: '2422'

   cookiecutter_template_branch: master

   cookiecutter_template_credentials: gerrit

@@ -21,94 +21,95 @@
   email_address: sgudz@mirantis.com

   infra_bond_mode: active-backup

   infra_deploy_nic: eth0

-  infra_kvm01_control_address: 10.167.4.241

+  infra_kvm01_control_address: 10.167.8.241

   infra_kvm01_deploy_address: 172.16.49.67

   infra_kvm01_hostname: kvm01

-  infra_kvm02_control_address: 10.167.4.242

+  infra_kvm02_control_address: 10.167.8.242

   infra_kvm02_deploy_address: 172.16.49.68

   infra_kvm02_hostname: kvm02

-  infra_kvm03_control_address: 10.167.4.243

+  infra_kvm03_control_address: 10.167.8.243

   infra_kvm03_deploy_address: 172.16.49.69

   infra_kvm03_hostname: kvm03

-  infra_kvm_vip_address: 10.167.4.240

+  infra_kvm_vip_address: 10.167.8.240

   infra_primary_first_nic: eth2

   infra_primary_second_nic: eth3

   kubernetes_enabled: 'False'

   local_repositories: 'False'

-  maas_deploy_address: 10.167.4.91

+  maas_deploy_address: 10.167.8.91

   maas_hostname: cfg01

-  opencontrail_analytics_address: 10.167.4.30

+  opencontrail_analytics_address: 10.167.8.30

   opencontrail_analytics_hostname: nal

-  opencontrail_analytics_node01_address: 10.167.4.31

+  opencontrail_analytics_node01_address: 10.167.8.31

   opencontrail_analytics_node01_hostname: nal01

-  opencontrail_analytics_node02_address: 10.167.4.32

+  opencontrail_analytics_node02_address: 10.167.8.32

   opencontrail_analytics_node02_hostname: nal02

-  opencontrail_analytics_node03_address: 10.167.4.33

+  opencontrail_analytics_node03_address: 10.167.8.33

   opencontrail_analytics_node03_hostname: nal03

   opencontrail_compute_iface_mask: '24'

-  opencontrail_control_address: 10.167.4.20

+  opencontrail_control_address: 10.167.8.20

   opencontrail_control_hostname: ntw

-  opencontrail_control_node01_address: 10.167.4.21

+  opencontrail_control_node01_address: 10.167.8.21

   opencontrail_control_node01_hostname: ntw01

-  opencontrail_control_node02_address: 10.167.4.22

+  opencontrail_control_node02_address: 10.167.8.22

   opencontrail_control_node02_hostname: ntw02

-  opencontrail_control_node03_address: 10.167.4.23

+  opencontrail_control_node03_address: 10.167.8.23

   opencontrail_control_node03_hostname: ntw03

   opencontrail_enabled: 'True'

-  opencontrail_router01_address: 10.167.4.100

+  opencontrail_router01_address: 10.167.8.100

   opencontrail_router01_hostname: rtr01

-  opencontrail_router02_address: 10.167.4.101

+  opencontrail_router02_address: 10.167.8.101

   opencontrail_router02_hostname: rtr02

-  openstack_benchmark_node01_address: 10.167.4.95

+

+  openstack_benchmark_node01_address: 10.167.8.95

   openstack_benchmark_node01_hostname: bmk01

   openstack_compute_count: '1'

   openstack_compute_rack01_hostname: cmpt

-  openstack_compute_rack01_single_subnet: 10.167.4

+  openstack_compute_rack01_single_subnet: 10.167.8

   openstack_compute_rack01_tenant_subnet: 192.168.0

 

   openstack_compute_node01_hostname: cmp001

   openstack_compute_node02_hostname: cmp002

-  openstack_compute_node01_address: 10.167.4.72

-  openstack_compute_node02_address: 10.167.4.74

-  openstack_compute_node01_single_address: 10.167.4.72

-  openstack_compute_node02_single_address: 10.167.4.74

+  openstack_compute_node01_address: 10.167.8.101

+  openstack_compute_node02_address: 10.167.8.102

+  openstack_compute_node01_single_address: 10.167.8.101

+  openstack_compute_node02_single_address: 10.167.8.102

   openstack_compute_node01_deploy_address: 172.16.49.72

   openstack_compute_node02_deploy_address: 172.16.49.74

 

-  openstack_control_address: 10.167.4.10

+  openstack_control_address: 10.167.8.10

   openstack_control_hostname: ctl

-  openstack_control_node01_address: 10.167.4.11

+  openstack_control_node01_address: 10.167.8.11

   openstack_control_node01_hostname: ctl01

-  openstack_control_node02_address: 10.167.4.12

+  openstack_control_node02_address: 10.167.8.12

   openstack_control_node02_hostname: ctl02

-  openstack_control_node03_address: 10.167.4.13

+  openstack_control_node03_address: 10.167.8.13

   openstack_control_node03_hostname: ctl03

-  openstack_database_address: 10.167.4.50

+  openstack_database_address: 10.167.8.50

   openstack_database_hostname: dbs

-  openstack_database_node01_address: 10.167.4.51

+  openstack_database_node01_address: 10.167.8.51

   openstack_database_node01_hostname: dbs01

-  openstack_database_node02_address: 10.167.4.52

+  openstack_database_node02_address: 10.167.8.52

   openstack_database_node02_hostname: dbs02

-  openstack_database_node03_address: 10.167.4.53

+  openstack_database_node03_address: 10.167.8.53

   openstack_database_node03_hostname: dbs03

   openstack_enabled: 'True'

-  openstack_message_queue_address: 10.167.4.40

+  openstack_message_queue_address: 10.167.8.40

   openstack_message_queue_hostname: msg

-  openstack_message_queue_node01_address: 10.167.4.41

+  openstack_message_queue_node01_address: 10.167.8.41

   openstack_message_queue_node01_hostname: msg01

-  openstack_message_queue_node02_address: 10.167.4.42

+  openstack_message_queue_node02_address: 10.167.8.42

   openstack_message_queue_node02_hostname: msg02

-  openstack_message_queue_node03_address: 10.167.4.43

+  openstack_message_queue_node03_address: 10.167.8.43

   openstack_message_queue_node03_hostname: msg03

   openstack_network_engine: opencontrail

-  openstack_nfv_dpdk_enabled: 'False'

+  openstack_nfv_dpdk_enabled: 'True'

   openstack_nfv_sriov_enabled: 'False'

   openstack_nova_compute_nfv_req_enabled: 'False'

-  openstack_proxy_address: 10.167.4.80

+  openstack_proxy_address: 10.167.8.80

   openstack_proxy_hostname: prx

-  openstack_proxy_node01_address: 10.167.4.81

+  openstack_proxy_node01_address: 10.167.8.81

   openstack_proxy_node01_hostname: prx01

-  openstack_proxy_node02_address: 10.167.4.82

+  openstack_proxy_node02_address: 10.167.8.82

   openstack_proxy_node02_hostname: prx02

   openstack_version: ocata

   oss_enabled: 'False'

@@ -120,42 +121,41 @@
   public_host: ${_param:openstack_proxy_address}

   publication_method: email

   reclass_repository: https://github.com/Mirantis/mk-lab-salt-model.git

-  salt_api_password: BIDWhCG4zuArfGwwKDuh3q32jdTLrWS1

-  salt_api_password_hash: $6$bGHqshet$Rf1A7.SWK.8VattpFelJ8yC4OHdnXCZdIIRsMLtoOb1ZDDO7meEEpqTWJY4xpQbXaXwO0aLjVDcF34ucfuxpb1

-  salt_master_address: 10.167.4.66

+  salt_master_address: 10.167.8.66

   salt_master_hostname: cfg01

   salt_master_management_address: 172.16.49.66

   shared_reclass_url: ssh://mcp-jenkins@gerrit.mcp.mirantis.net:29418/salt-models/reclass-system.git

   stacklight_enabled: 'True'

-  stacklight_log_address: 10.167.4.60

+  stacklight_log_address: 10.167.8.60

   stacklight_log_hostname: log

-  stacklight_log_node01_address: 10.167.4.61

+  stacklight_log_node01_address: 10.167.8.61

   stacklight_log_node01_hostname: log01

-  stacklight_log_node02_address: 10.167.4.62

+  stacklight_log_node02_address: 10.167.8.62

   stacklight_log_node02_hostname: log02

-  stacklight_log_node03_address: 10.167.4.63

+  stacklight_log_node03_address: 10.167.8.63

   stacklight_log_node03_hostname: log03

-  stacklight_monitor_address: 10.167.4.70

+  stacklight_monitor_address: 10.167.8.70

   stacklight_monitor_hostname: mon

-  stacklight_monitor_node01_address: 10.167.4.71

+  stacklight_monitor_node01_address: 10.167.8.71

   stacklight_monitor_node01_hostname: mon01

-  stacklight_monitor_node02_address: 10.167.4.72

+  stacklight_monitor_node02_address: 10.167.8.72

   stacklight_monitor_node02_hostname: mon02

-  stacklight_monitor_node03_address: 10.167.4.73

+  stacklight_monitor_node03_address: 10.167.8.73

   stacklight_monitor_node03_hostname: mon03

   stacklight_notification_address: alerts@localhost

   stacklight_notification_smtp_host: 127.0.0.1

-  stacklight_telemetry_address: 10.167.4.85

+  stacklight_telemetry_address: 10.167.8.85

   stacklight_telemetry_hostname: mtr

-  stacklight_telemetry_node01_address: 10.167.4.86

+  stacklight_telemetry_node01_address: 10.167.8.86

   stacklight_telemetry_node01_hostname: mtr01

-  stacklight_telemetry_node02_address: 10.167.4.87

+  stacklight_telemetry_node02_address: 10.167.8.87

   stacklight_telemetry_node02_hostname: mtr02

-  stacklight_telemetry_node03_address: 10.167.4.88

+  stacklight_telemetry_node03_address: 10.167.8.88

   stacklight_telemetry_node03_hostname: mtr03

   stacklight_version: '2'

-  tenant_network_gateway: 192.168.0.1

+  tenant_network_gateway: ''

   tenant_network_netmask: 255.255.255.0

   tenant_network_subnet: 192.168.0.0/24

   tenant_vlan: '2423'

   upstream_proxy_enabled: 'False'

+  openstack_nova_compute_hugepages_count: 40

diff --git a/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/salt-context-environment.yaml b/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/salt-context-environment.yaml
index 53417f2..98eaa56 100644
--- a/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/salt-context-environment.yaml
+++ b/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/salt-context-environment.yaml
@@ -181,7 +181,6 @@
         eth1:

           role: single_ctl

 

-

     mtr01.cookied-bm-mcp-ocata-contrail.local:

       reclass_storage_name: stacklight_telemetry_node01

       roles:

@@ -235,3 +234,12 @@
       interfaces:

         ens3:

           role: single_ctl

+

+    bmk01.cookied-bm-mcp-ocata-contrail.local:

+      reclass_storage_name: openstack_benchmark_node01

+      roles:

+      - openstack_benchmark

+      - linux_system_codename_xenial

+      interfaces:

+        ens3:

+          role: single_ctl

diff --git a/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/salt.yaml b/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/salt.yaml
index 3c8f025..4051882 100644
--- a/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/salt.yaml
+++ b/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/salt.yaml
@@ -1,6 +1,9 @@
 {% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import HOSTNAME_CFG01 with context %}
 {% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import LAB_CONFIG_NAME with context %}
 {% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import DOMAIN_NAME with context %}
+{% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import HOSTNAME_KVM01 with context %}
+{% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import HOSTNAME_KVM02 with context %}
+{% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import HOSTNAME_KVM03 with context %}
 
 {% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.net/salt-models/mcp-virtual-lab') %}
 # Other salt model repository parameters see in shared-salt.yaml
@@ -8,7 +11,7 @@
 # Name of the context file (without extension, that is fixed .yaml) used to render the Environment model
 {% set ENVIRONMENT_MODEL_INVENTORY_NAME = os_env('ENVIRONMENT_MODEL_INVENTORY_NAME','physical-cookied-bm-mcp-ocata-contrail') %}
 # Path to the context files used to render Cluster and Environment models
-{%- set CLUSTER_CONTEXT_NAME = 'salt-context-cookiecutter-contrail.yaml' %}
+{%- set CLUSTER_CONTEXT_NAME = 'salt-context-cookiecutter-contrail-dpdk.yaml' %}
 {%- set ENVIRONMENT_CONTEXT_NAMES = ['salt-context-environment.yaml','lab04-physical-inventory.yaml'] %}
 {%- set CONTROL_VLAN = os_env('CONTROL_VLAN', '2422') %}
 {%- set TENANT_VLAN = os_env('TENANT_VLAN', '2423') %}
@@ -16,16 +19,72 @@
 
 {% import 'shared-salt.yaml' as SHARED with context %}
 
+- description: (REMOVE asap) Hack KVMs of Hash sum mismatch
+  cmd: |
+    rm -rf /var/lib/apt/lists/*;
+    apt-get clean;
+    apt-get update;
+  node_name: {{ HOSTNAME_KVM01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: true
+
+- description: (REMOVE asap) Hack KVMs of Hash sum mismatch
+  cmd: |
+    rm -rf /var/lib/apt/lists/*;
+    apt-get clean;
+    apt-get update;
+  node_name: {{ HOSTNAME_KVM02 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: true
+
+- description: (REMOVE asap) Hack KVMs of Hash sum mismatch
+  cmd: |
+    rm -rf /var/lib/apt/lists/*;
+    apt-get clean;
+    apt-get update;
+  node_name: {{ HOSTNAME_KVM03 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: true
+
+
 {{ SHARED.MACRO_INSTALL_SALT_MASTER() }}
 
 {{ SHARED.MACRO_GENERATE_COOKIECUTTER_MODEL(CONTROL_VLAN=CONTROL_VLAN, TENANT_VLAN=TENANT_VLAN) }}
 
+- description: Temporary WR for cinder backend defined by default in reclass.system
+  cmd: |
+    sed -i 's/backend\:\ {}//g' /srv/salt/reclass/classes/system/cinder/control/cluster.yml;
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
+
 {{ SHARED.MACRO_GENERATE_AND_ENABLE_ENVIRONMENT_MODEL() }}
 
 {{ SHARED.MACRO_CONFIGURE_RECLASS(FORMULA_SERVICES='"linux" "reclass" "salt" "openssh" "ntp" "git" "nginx" "collectd" "sensu" "heka" "sphinx" "keystone" "mysql" "grafana" "haproxy" "rsyslog" "horizon" "prometheus" "telegraf" "elasticsearch" "powerdns" "glusterfs" "xtrabackup" "maas"') }}
 
+- description: "Workaround for haproxy without listen"
+  cmd: |
+    set -e;
+    git clone https://gerrit.mcp.mirantis.net/salt-formulas/haproxy;
+    cd haproxy/;
+    git fetch https://gerrit.mcp.mirantis.net/salt-formulas/haproxy refs/changes/39/11339/1 && git checkout FETCH_HEAD;
+    cp haproxy/files/haproxy.cfg /srv/salt/env/prd/haproxy/files/;
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 10}
+  skip_fail: true
+
 {{ SHARED.MACRO_INSTALL_SALT_MINIONS() }}
 
+- description: (REMOVE asap) Hack CFG of Hash sum mismatch
+  cmd: |
+    rm -rf /var/lib/apt/lists/*;
+    apt-get clean;
+    apt-get update;
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: true
+
 {{ SHARED.MACRO_RUN_SALT_MASTER_UNDERLAY_STATES() }}
 
 - description: "Workaround for rack01 compute generator"
@@ -36,8 +95,8 @@
     # Add openstack_compute_node definition from system
     reclass-tools add-key 'classes' 'system.reclass.storage.system.openstack_compute_multi' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/config.yml --merge;
     # Set ipaddresses
-#    salt-call reclass.cluster_meta_set openstack_compute_node01_single_address 10.167.4.72 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/init.yml;
-#    salt-call reclass.cluster_meta_set openstack_compute_node02_single_address 10.167.4.74 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/init.yml;
+#    salt-call reclass.cluster_meta_set openstack_compute_node01_single_address 10.167.8.101 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/init.yml;
+#    salt-call reclass.cluster_meta_set openstack_compute_node02_single_address 10.167.8.102 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/init.yml;
 #    salt-call reclass.cluster_meta_set openstack_compute_node01_deploy_address 172.16.49.72 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/init.yml;
 #    salt-call reclass.cluster_meta_set openstack_compute_node02_deploy_address 172.16.49.74 /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/infra/init.yml;
 
@@ -56,24 +115,33 @@
     # Add tenant and single addresses for computes
     salt-call reclass.cluster_meta_set deploy_address 172.16.49.72 /srv/salt/reclass/nodes/_generated/cmp001.cookied-bm-mcp-ocata-contrail.local.yml
     salt-call reclass.cluster_meta_set tenant_address 192.168.0.101 /srv/salt/reclass/nodes/_generated/cmp001.cookied-bm-mcp-ocata-contrail.local.yml
-    salt-call reclass.cluster_meta_set single_address 10.167.4.72 /srv/salt/reclass/nodes/_generated/cmp001.cookied-bm-mcp-ocata-contrail.local.yml
+    salt-call reclass.cluster_meta_set single_address 10.167.8.101 /srv/salt/reclass/nodes/_generated/cmp001.cookied-bm-mcp-ocata-contrail.local.yml
 
     salt-call reclass.cluster_meta_set deploy_address 172.16.49.74 /srv/salt/reclass/nodes/_generated/cmp002.cookied-bm-mcp-ocata-contrail.local.yml
     salt-call reclass.cluster_meta_set tenant_address 192.168.0.102 /srv/salt/reclass/nodes/_generated/cmp002.cookied-bm-mcp-ocata-contrail.local.yml
-    salt-call reclass.cluster_meta_set single_address 10.167.4.74 /srv/salt/reclass/nodes/_generated/cmp002.cookied-bm-mcp-ocata-contrail.local.yml
+    salt-call reclass.cluster_meta_set single_address 10.167.8.102 /srv/salt/reclass/nodes/_generated/cmp002.cookied-bm-mcp-ocata-contrail.local.yml
 
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 10}
   skip_fail: false
 
-- description: "Workaround for PROD-15087"
+
+- description: Temporary workaround for removing cinder-volume from CTL nodes
   cmd: |
-    set -e;
-    reclass-tools add-key 'classes' 'system.linux.system.repo.mcp.openstack' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/stacklight/telemetry.yml --merge;
+    sed -i 's/\-\ system\.cinder\.volume\.single//g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml;
+    sed -i 's/\-\ system\.cinder\.volume\.notification\.messagingv2//g' /srv/salt/reclass/classes/cluster/{{ LAB_CONFIG_NAME }}/openstack/control.yml;
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: true
+
+- description: Temporary WR (Remove ASAP) for downgrade packages
+  cmd: |
+    salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@linux:system' state.sls linux.system.repo;
+    salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@linux:system' cmd.run "apt-get update"
+    salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@linux:system' cmd.run "apt-get install -y --allow-downgrades vlan";
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 10}
-  skip_fail: false
-
+  skip_fail: true
 
 {{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }}
 
@@ -105,6 +173,14 @@
 # Configure all running salt minion nodes
 #########################################
 
+- description: Hack resolv.conf on VCP nodes for internal services access
+  cmd: |
+    salt --hard-crash --state-output=mixed --state-verbose=False -C '* and not kvm* and not cmp* and not gtw* and not cfg*' cmd.run "echo 'nameserver 172.18.208.44' > /etc/resolv.conf;"
+    salt --hard-crash --state-output=mixed --state-verbose=False -C '* and not kvm* and not cmp* and not gtw* and not cfg*' cmd.run "echo 'nameserver 8.8.8.8' >> /etc/resolv.conf;"
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
 - description: Refresh pillars on all minions
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False '*' saltutil.refresh_pillar
   node_name: {{ HOSTNAME_CFG01 }}
@@ -123,22 +199,20 @@
   retry: {count: 1, delay: 5}
   skip_fail: false
 
+- description: Temporary WR (Remove ASAP) for downgrade packages
+  cmd: |
+    salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@linux:system' state.sls linux.system.repo;
+    salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@linux:system' cmd.run "apt-get update"
+    salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@linux:system' cmd.run "apt-get install -y --allow-downgrades vlan";
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 10}
+  skip_fail: true
+
 {{ SHARED.MACRO_BOOTSTRAP_ALL_MINIONS() }}
 
-#- description: Hack gtw node
-#  cmd: salt 'gtw*' cmd.run "ip addr del {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.110/24 dev ens4; ip addr flush dev ens4";
-#  node_name: {{ HOSTNAME_CFG01 }}
-#  retry: {count: 1, delay: 10}
-#  skip_fail: false
-
-#- description: Hack cmp01 node
-#  cmd: salt 'cmp01*' cmd.run "ip addr del {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.105/24 dev ens4; ip addr flush dev ens4";
-#  node_name: {{ HOSTNAME_CFG01 }}
-#  retry: {count: 1, delay: 10}
-#  skip_fail: false
-
-#- description: Hack cmp02 node
-#  cmd: salt 'cmp02*' cmd.run "ip addr del {{ SHARED.IPV4_NET_CONTROL_PREFIX }}.106/24 dev ens4; ip addr flush dev ens4";
-#  node_name: {{ HOSTNAME_CFG01 }}
-#  retry: {count: 1, delay: 10}
-#  skip_fail: false
+- description: (REMOVE asap) Hack VCPs of Hash sum mismatch
+  cmd: |
+    salt --hard-crash --state-output=mixed --state-verbose=False -C '* and not kvm* and not cmp* and not gtw* and not cfg*' cmd.run "rm -rf /var/lib/apt/lists/*; apt-get clean; apt-get update -y;"
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: true
diff --git a/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/sl.yaml b/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/sl.yaml
index 10d0d9c..9e14bf2 100644
--- a/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/sl.yaml
+++ b/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/sl.yaml
@@ -1,6 +1,6 @@
 {% from 'cookied-bm-mcp-ocata-contrail/underlay.yaml' import HOSTNAME_CFG01 with context %}
 
-# Install docker swarm
+# Install docker swarm.
 - description: Install keepalived on mon nodes
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
     -C 'mon*' state.sls keepalived
@@ -142,39 +142,27 @@
   retry: {count: 1, delay: 10}
   skip_fail: false
 
-# Change environment configuration before deploy
-- description: Set SL docker images deploy parameters
-  cmd: |
-  {% for sl_opt, value in config.sl_deploy.items() %}
-    {% if value|string() %}
-    salt-call reclass.cluster_meta_set {{ sl_opt }} {{ value }};
-    {% endif %}
-  {% endfor %}
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 1}
-  skip_fail: false
-
 # Configure the services running in Docker Swarm
 - description: Install prometheus alertmanager
   cmd: salt -C 'I@docker:swarm' state.sls prometheus,heka.remote_collector -b 1
   node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 10}
+  retry: {count: 2, delay: 10}
   skip_fail: false
 
 - description: run docker state
   cmd: salt -C 'I@docker:swarm:role:master' state.sls docker
   node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 10}
+  retry: {count: 2, delay: 120}
   skip_fail: false
 
 - description: docker ps
-  cmd: salt -C 'I@docker:swarm' dockerng.ps
+  cmd: sleep 120; salt -C 'I@docker:swarm' dockerng.ps
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 10}
   skip_fail: false
 
 - description: Configure Grafana dashboards and datasources
-  cmd: sleep 30;  salt -C 'I@grafana:client' state.sls grafana.client
+  cmd: sleep 60;  salt -C 'I@grafana:client' state.sls grafana.client
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 2, delay: 10}
   skip_fail: false
diff --git a/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/underlay--user-data1604.yaml b/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/underlay--user-data1604.yaml
index a362d86..6ac6dd5 100644
--- a/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/underlay--user-data1604.yaml
+++ b/tcp_tests/templates/cookied-bm-mcp-ocata-contrail/underlay--user-data1604.yaml
@@ -52,6 +52,8 @@
    ############## TCP Cloud cfg01 node ##################

    #- sleep 120

    - echo "Preparing base OS"

+   - echo "nameserver 172.18.208.44" > /etc/resolv.conf;

+   - echo "nameserver 8.8.8.8" >> /etc/resolv.conf;

    - which wget >/dev/null || (apt-get update; apt-get install -y wget)

 

    - echo "deb [arch=amd64] http://apt.mirantis.com/xenial {{ REPOSITORY_SUITE }} salt extra" > /etc/apt/sources.list.d/mcp_salt.list;

diff --git a/tcp_tests/templates/shared-salt.yaml b/tcp_tests/templates/shared-salt.yaml
index efd894b..87d56ee 100644
--- a/tcp_tests/templates/shared-salt.yaml
+++ b/tcp_tests/templates/shared-salt.yaml
@@ -9,6 +9,7 @@
 {% set SALT_MODELS_SYSTEM_COMMIT = os_env('SALT_MODELS_SYSTEM_COMMIT','') %}
 {% set SALT_MODELS_SYSTEM_REF_CHANGE = os_env('SALT_MODELS_SYSTEM_REF_CHANGE','') %}
 {% set COOKIECUTTER_REF_CHANGE = os_env('COOKIECUTTER_REF_CHANGE','') %}
+{% set ENVIRONMENT_TEMPLATE_REF_CHANGE = os_env('ENVIRONMENT_TEMPLATE_REF_CHANGE','') %}
 
 {% set REPOSITORY_SUITE = os_env('REPOSITORY_SUITE', 'testing') %}
 
@@ -80,7 +81,6 @@
   skip_fail: false
 {%- endmacro %}
 
-
 {%- macro MACRO_CLONE_RECLASS_MODELS(IS_CONTRAIL_LAB=false) %}
 {############################################################}
 {# Creates a 'cluster' model from cookiecutter-templates and 'environment' model from uploaded template #}
@@ -205,10 +205,6 @@
     sed -i 's/tenant_vlan:.*/tenant_vlan: {{ TENANT_VLAN }}/g' {{ CLUSTER_CONTEXT_PATH }}
     {%- endif %}
 
-    # Temporary workaround (with hardcoded address .90 -> .15) of bug https://mirantis.jira.com/browse/PROD-14377
-    # sed -i 's/salt_master_address:.*/salt_master_address: {{ IPV4_NET_CONTROL_PREFIX }}.15/g' {{ CLUSTER_CONTEXT_PATH }}
-    # sed -i 's/salt_master_management_address:.*/salt_master_management_address: {{ IPV4_NET_ADMIN_PREFIX }}.15/g' {{ CLUSTER_CONTEXT_PATH }}
-
     # Replace firstly to an intermediate value to avoid intersection between
     # already replaced and replacing networks.
     # For example, if generated IPV4_NET_ADMIN_PREFIX=10.16.0 , then there is a risk of replacing twice:
@@ -278,7 +274,7 @@
 {%- macro MACRO_GENERATE_AND_ENABLE_ENVIRONMENT_MODEL() %}
 {########################################################}
 
-- description: "[EXPERIMENTAL] Clone 'environment-template' repository to {{ HOSTNAME_CFG01 }}"
+- description: "[EXPERIMENTAL] Clone 'environment-template' repository to {{ HOSTNAME_CFG01 }}."
   cmd: |
     set -e;
     mkdir -p /tmp/environment/;
@@ -286,6 +282,18 @@
   node_name: {{ HOSTNAME_CFG01 }}
   skip_fail: false
 
+{%- if ENVIRONMENT_TEMPLATE_REF_CHANGE != '' %}
+- description: Fetch changes for environment templates
+  cmd: |
+    set -e;
+    pushd /tmp/environment/environment_template &&
+    git fetch https://github.com/Mirantis/environment-template {{ ENVIRONMENT_TEMPLATE_REF_CHANGE }} &&
+    git checkout FETCH_HEAD &&
+    popd
+  node_name: {{ HOSTNAME_CFG01 }}
+  skip_fail: false
+{%- endif %}
+
 {%- for ENVIRONMENT_CONTEXT_NAME in ENVIRONMENT_CONTEXT_NAMES %}
 - description: "[EXPERIMENTAL] Upload environment inventory to {{ HOSTNAME_CFG01 }}"
   upload: