Use dynamic IP networks for mcp-ocata-ovs/dvr models
diff --git a/tcp_tests/templates/common-services/virtual-mcp-ocata-dvr-common-services.yaml b/tcp_tests/templates/common-services/virtual-mcp-ocata-dvr-common-services.yaml
index 319bffb..40c038c 100644
--- a/tcp_tests/templates/common-services/virtual-mcp-ocata-dvr-common-services.yaml
+++ b/tcp_tests/templates/common-services/virtual-mcp-ocata-dvr-common-services.yaml
@@ -1,4 +1,4 @@
-{% from 'virtual-mcp-ocata-dvr.jinja' import HOSTNAME_CFG01 with context %}
+{% from 'underlay/virtual-mcp-ocata-dvr.yaml' import HOSTNAME_CFG01 with context %}
 
 # Install support services
 - description: Install keepalived on ctl01
@@ -16,8 +16,10 @@
   skip_fail: true
 
 - description: Check the VIP
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-    -C 'I@keepalived:cluster' cmd.run 'ip a | grep 172.16.10.2' | grep -B1 172.16.10.2
+  cmd: |
+    OPENSTACK_CONTROL_ADDRESS=`salt-call --out=newline_values_only pillar.get _param:openstack_control_address`;
+    echo "_param:openstack_control_address (vip): ${OPENSTACK_CONTROL_ADDRESS}";
+    salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@keepalived:cluster' cmd.run "ip a | grep ${OPENSTACK_CONTROL_ADDRESS}" | grep -B1 ${OPENSTACK_CONTROL_ADDRESS}
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 5}
   skip_fail: false
diff --git a/tcp_tests/templates/common-services/virtual-mcp-ocata-ovs-common-services.yaml b/tcp_tests/templates/common-services/virtual-mcp-ocata-ovs-common-services.yaml
index 4d8b13c..b8e7001 100644
--- a/tcp_tests/templates/common-services/virtual-mcp-ocata-ovs-common-services.yaml
+++ b/tcp_tests/templates/common-services/virtual-mcp-ocata-ovs-common-services.yaml
@@ -1,4 +1,4 @@
-{% from 'virtual-mcp-ocata-ovs.jinja' import HOSTNAME_CFG01 with context %}
+{% from 'underlay/virtual-mcp-ocata-ovs.yaml' import HOSTNAME_CFG01 with context %}
 
 # Install support services
 - description: Install keepalived on ctl01
@@ -16,8 +16,10 @@
   skip_fail: true
 
 - description: Check the VIP
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-    -C 'I@keepalived:cluster' cmd.run 'ip a | grep 172.16.10.2' | grep -B1 172.16.10.2
+  cmd: |
+    OPENSTACK_CONTROL_ADDRESS=`salt-call --out=newline_values_only pillar.get _param:openstack_control_address`;
+    echo "_param:openstack_control_address (vip): ${OPENSTACK_CONTROL_ADDRESS}";
+    salt --hard-crash --state-output=mixed --state-verbose=False -C 'I@keepalived:cluster' cmd.run "ip a | grep ${OPENSTACK_CONTROL_ADDRESS}" | grep -B1 ${OPENSTACK_CONTROL_ADDRESS}
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 5}
   skip_fail: false
diff --git a/tcp_tests/templates/openstack/virtual-mcp-ocata-dvr-openstack.yaml b/tcp_tests/templates/openstack/virtual-mcp-ocata-dvr-openstack.yaml
index 304264c..cc4fcea 100644
--- a/tcp_tests/templates/openstack/virtual-mcp-ocata-dvr-openstack.yaml
+++ b/tcp_tests/templates/openstack/virtual-mcp-ocata-dvr-openstack.yaml
@@ -1,8 +1,15 @@
-{% from 'virtual-mcp-ocata-dvr.jinja' import HOSTNAME_CFG01 with context %}
+{% from 'underlay/virtual-mcp-ocata-dvr.yaml' import HOSTNAME_CFG01 with context %}
 
 # Install OpenStack control services
 
-- description: Install keystone service
+- description: Install glance on all controllers
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
+     -C 'I@glance:server' state.sls glance -b 1
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
+- description: Install keystone service (note that different fernet keys are created on different nodes)
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
     -C 'I@keystone:server' state.sls keystone.server -b 1
   node_name: {{ HOSTNAME_CFG01 }}
@@ -21,6 +28,20 @@
   retry: {count: 1, delay: 15}
   skip_fail: false
 
+- description: Mount glusterfs.client volumes (resuires created 'keystone' and 'glusterfs' system users)
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
+    -C 'I@glance:server' state.sls glusterfs.client
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
+- description: Update fernet keys for keystone server on the mounted glusterfs volume
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
+    -C 'I@keystone:server' state.sls keystone.server -b 1
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
 - description: Populate keystone services/tenants/admins
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
     -C 'I@keystone:client' state.sls keystone.client
@@ -35,28 +56,6 @@
   retry: {count: 1, delay: 5}
   skip_fail: false
 
-
-- description: Install glance on all controllers
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-     -C 'I@glance:server' state.sls glance -b 1
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 5}
-  skip_fail: false
-
-- description: Configure glusterfs.client on all controllers
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-    -C 'I@glance:server' state.sls glusterfs.client
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 5}
-  skip_fail: false
-
-- description: Update fernet tokens for keystone server
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-    -C 'I@keystone:server' state.sls keystone.server -b 1
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 5}
-  skip_fail: false
-
 - description: Check glance image-list
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
     -C 'I@keystone:server' cmd.run '. /root/keystonerc; glance image-list'
@@ -69,7 +68,7 @@
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
     -C 'I@nova:controller' state.sls nova -b 1
   node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 2, delay: 15}
+  retry: {count: 2, delay: 5}
   skip_fail: false
 
 - description: Check nova service-list
diff --git a/tcp_tests/templates/openstack/virtual-mcp-ocata-ovs-openstack.yaml b/tcp_tests/templates/openstack/virtual-mcp-ocata-ovs-openstack.yaml
index 1cdb614..5546b87 100644
--- a/tcp_tests/templates/openstack/virtual-mcp-ocata-ovs-openstack.yaml
+++ b/tcp_tests/templates/openstack/virtual-mcp-ocata-ovs-openstack.yaml
@@ -1,8 +1,15 @@
-{% from 'virtual-mcp-ocata-ovs.jinja' import HOSTNAME_CFG01 with context %}
+{% from 'underlay/virtual-mcp-ocata-ovs.yaml' import HOSTNAME_CFG01 with context %}
 
 # Install OpenStack control services
 
-- description: Install keystone service
+- description: Install glance on all controllers
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
+     -C 'I@glance:server' state.sls glance -b 1
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
+- description: Install keystone service (note that different fernet keys are created on different nodes)
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
     -C 'I@keystone:server' state.sls keystone.server -b 1
   node_name: {{ HOSTNAME_CFG01 }}
@@ -21,6 +28,20 @@
   retry: {count: 1, delay: 15}
   skip_fail: false
 
+- description: Mount glusterfs.client volumes (resuires created 'keystone' and 'glusterfs' system users)
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
+    -C 'I@glance:server' state.sls glusterfs.client
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
+- description: Update fernet keys for keystone server on the mounted glusterfs volume
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
+    -C 'I@keystone:server' state.sls keystone.server -b 1
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
 - description: Populate keystone services/tenants/admins
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
     -C 'I@keystone:client' state.sls keystone.client
@@ -35,28 +56,6 @@
   retry: {count: 1, delay: 5}
   skip_fail: false
 
-
-- description: Install glance on all controllers
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-     -C 'I@glance:server' state.sls glance -b 1
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 5}
-  skip_fail: false
-
-- description: Configure glusterfs.client on all controllers
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-    -C 'I@glance:server' state.sls glusterfs.client
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 5}
-  skip_fail: false
-
-- description: Update fernet tokens for keystone server
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False
-    -C 'I@keystone:server' state.sls keystone.server -b 1
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 5}
-  skip_fail: false
-
 - description: Check glance image-list
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
     -C 'I@keystone:server' cmd.run '. /root/keystonerc; glance image-list'
@@ -69,7 +68,7 @@
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
     -C 'I@nova:controller' state.sls nova -b 1
   node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 2, delay: 15}
+  retry: {count: 2, delay: 5}
   skip_fail: false
 
 - description: Check nova service-list
diff --git a/tcp_tests/templates/openstack/virtual-mcp11-dvr-openstack.yaml b/tcp_tests/templates/openstack/virtual-mcp11-dvr-openstack.yaml
index f14c9b5..554dd46 100644
--- a/tcp_tests/templates/openstack/virtual-mcp11-dvr-openstack.yaml
+++ b/tcp_tests/templates/openstack/virtual-mcp11-dvr-openstack.yaml
@@ -68,7 +68,7 @@
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
     -C 'I@nova:controller' state.sls nova -b 1
   node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 5}
+  retry: {count: 2, delay: 5}
   skip_fail: false
 
 - description: Check nova service-list
diff --git a/tcp_tests/templates/openstack/virtual-mcp11-ovs-dpdk-openstack.yaml b/tcp_tests/templates/openstack/virtual-mcp11-ovs-dpdk-openstack.yaml
index f228752..cc19c57 100644
--- a/tcp_tests/templates/openstack/virtual-mcp11-ovs-dpdk-openstack.yaml
+++ b/tcp_tests/templates/openstack/virtual-mcp11-ovs-dpdk-openstack.yaml
@@ -68,7 +68,7 @@
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
     -C 'I@nova:controller' state.sls nova -b 1
   node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 5}
+  retry: {count: 2, delay: 5}
   skip_fail: false
 
 - description: Check nova service-list
diff --git a/tcp_tests/templates/openstack/virtual-mcp11-ovs-openstack.yaml b/tcp_tests/templates/openstack/virtual-mcp11-ovs-openstack.yaml
index 1285e02..c8c3a3f 100644
--- a/tcp_tests/templates/openstack/virtual-mcp11-ovs-openstack.yaml
+++ b/tcp_tests/templates/openstack/virtual-mcp11-ovs-openstack.yaml
@@ -68,7 +68,7 @@
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
     -C 'I@nova:controller' state.sls nova -b 1
   node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 5}
+  retry: {count: 2, delay: 5}
   skip_fail: false
 
 - description: Check nova service-list
diff --git a/tcp_tests/templates/salt/virtual-mcp-ocata-dvr-salt.yaml b/tcp_tests/templates/salt/virtual-mcp-ocata-dvr-salt.yaml
index e6f7a4a..528c04f 100644
--- a/tcp_tests/templates/salt/virtual-mcp-ocata-dvr-salt.yaml
+++ b/tcp_tests/templates/salt/virtual-mcp-ocata-dvr-salt.yaml
@@ -1,40 +1,58 @@
-{% from 'virtual-mcp-ocata-dvr.jinja' import HOSTNAME_CFG01 with context %}
+{% from 'underlay/virtual-mcp-ocata-dvr.yaml' import HOSTNAME_CFG01 with context %}
+
+{% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.net/salt-models/mcp-virtual-lab') %}
+{% set SALT_MODELS_COMMIT = os_env('SALT_MODELS_COMMIT','master') %}
+
+# Address pools for reclass cluster model are taken in the following order:
+# 1. environment variables,
+# 2. config.underlay.address_pools based on fuel-devops address pools
+#    (see generated '.ini' file after underlay is created),
+# 3. defaults
+{% set address_pools = config.underlay.address_pools %}
+{% set IPV4_NET_ADMIN = os_env('IPV4_NET_ADMIN', address_pools.get('admin-pool01', '192.168.10.0/24')) %}
+{% set IPV4_NET_CONTROL = os_env('IPV4_NET_CONTROL', address_pools.get('private-pool01', '172.16.10.0/24')) %}
+{% set IPV4_NET_TENANT = os_env('IPV4_NET_TENANT', address_pools.get('tenant-pool01', '10.1.0.0/24')) %}
+{% set IPV4_NET_EXTERNAL = os_env('IPV4_NET_EXTERNAL', address_pools.get('external-pool01', '10.16.0.0/24')) %}
+
+{% set IPV4_NET_ADMIN_PREFIX = '.'.join(IPV4_NET_ADMIN.split('.')[0:3]) %}
+{% set IPV4_NET_CONTROL_PREFIX = '.'.join(IPV4_NET_CONTROL.split('.')[0:3]) %}
+{% set IPV4_NET_TENANT_PREFIX = '.'.join(IPV4_NET_TENANT.split('.')[0:3]) %}
+{% set IPV4_NET_EXTERNAL_PREFIX = '.'.join(IPV4_NET_EXTERNAL.split('.')[0:3]) %}
 
 # Install salt to the config node
 
+#- description: (moved to cloud-init config) Configure repository on the cfg01 node
+#  cmd:
+#    echo "172.18.248.114    jenkins.mcp.mirantis.net  gerrit.mcp.mirantis.net" >> /etc/hosts;
+#    echo "185.135.196.10    apt-mk.mirantis.com" >> /etc/hosts;
+#    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-mk.mirantis.com/xenial nightly salt extra" > /etc/apt/sources.list.d/mcp_salt.list;
+#    wget -O - http://apt-mk.mirantis.com/public.gpg | apt-key add -;
+#    echo "deb http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2016.3 xenial main" > /etc/apt/sources.list.d/saltstack.list;
+#    wget -O - https://repo.saltstack.com/apt/ubuntu/16.04/amd64/2016.3/SALTSTACK-GPG-KEY.pub | apt-key add -;
+#  node_name: {{ HOSTNAME_CFG01 }}
+#  retry: {count: 1, delay: 1}
+#  skip_fail: false
 
-- description: Configure repository on the cfg01 node
-  cmd:
-    echo "172.18.248.114    jenkins.mcp.mirantis.net  gerrit.mcp.mirantis.net" >> /etc/hosts;
-    echo "185.135.196.10    apt-mk.mirantis.com" >> /etc/hosts;
-    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-mk.mirantis.com/xenial nightly salt extra" > /etc/apt/sources.list.d/mcp_salt.list;
-    wget -O - http://apt-mk.mirantis.com/public.gpg | apt-key add -;
-    echo "deb http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2016.3 xenial main" > /etc/apt/sources.list.d/saltstack.list;
-    wget -O - https://repo.saltstack.com/apt/ubuntu/16.04/amd64/2016.3/SALTSTACK-GPG-KEY.pub | apt-key add -;
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 1}
-  skip_fail: false
-
-- description: Update packages on cfg01
-  cmd: apt-get clean; apt-get update
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 1}
-  skip_fail: false
+#- description: Update packages on cfg01
+#  cmd: apt-get clean; eatmydata apt-get update
+#  node_name: {{ HOSTNAME_CFG01 }}
+#  retry: {count: 1, delay: 1}
+#  skip_fail: false
 
 - description: Installing salt master on cfg01
-  cmd:  apt-get install -y reclass git; apt-get install -y salt-master
+  cmd:  eatmydata apt-get install -y reclass git salt-master
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 1}
   skip_fail: false
 
-- description: Install common packages on cfg01
-  cmd: apt-get install -y python-pip wget curl tmux byobu iputils-ping traceroute htop tree
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 1}
-  skip_fail: false
+#- description: (moved to cloud-init config) Install common packages on cfg01
+#  cmd: eatmydata apt-get install -y python-pip wget curl tmux byobu iputils-ping traceroute htop tree
+#  node_name: {{ HOSTNAME_CFG01 }}
+#  retry: {count: 1, delay: 1}
+#  skip_fail: false
 
 - description: Configure salt-master on cfg01
   cmd: |
@@ -74,8 +92,37 @@
 - description: Clone reclass models with submodules
   cmd: |
     ssh-keyscan -H github.com >> ~/.ssh/known_hosts;
-    git clone -b master --recurse-submodules https://gerrit.mcp.mirantis.net/salt-models/mcp-virtual-lab /srv/salt/reclass;
+    git clone -b {{ SALT_MODELS_COMMIT }} --recurse-submodules {{ SALT_MODELS_REPOSITORY }} /srv/salt/reclass;
+
     mkdir -p /srv/salt/reclass/classes/service;
+
+    # 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:
+    # 192.168.10 -> 10.16.0 (generated network for admin)
+    # 10.16.0 -> <external network>
+    # So let's replace constant networks to the keywords, and then keywords to the desired networks.
+    find /srv/salt/reclass/ -type f -exec sed -i 's/192\.168\.10\./==IPV4_NET_ADMIN_PREFIX==/g' {} +
+    find /srv/salt/reclass/ -type f -exec sed -i 's/172\.16\.10\./==IPV4_NET_CONTROL_PREFIX==/g' {} +
+    find /srv/salt/reclass/ -type f -exec sed -i 's/10\.1\.0\./==IPV4_NET_TENANT_PREFIX==/g' {} +
+    find /srv/salt/reclass/ -type f -exec sed -i 's/10\.16\.0\./==IPV4_NET_EXTERNAL_PREFIX==/g' {} +
+
+    find /srv/salt/reclass/ -type f -exec sed -i 's/==IPV4_NET_ADMIN_PREFIX==/{{ IPV4_NET_ADMIN_PREFIX }}./g' {} +
+    find /srv/salt/reclass/ -type f -exec sed -i 's/==IPV4_NET_CONTROL_PREFIX==/{{ IPV4_NET_CONTROL_PREFIX }}./g' {} +
+    find /srv/salt/reclass/ -type f -exec sed -i 's/==IPV4_NET_TENANT_PREFIX==/{{ IPV4_NET_TENANT_PREFIX }}./g' {} +
+    find /srv/salt/reclass/ -type f -exec sed -i 's/==IPV4_NET_EXTERNAL_PREFIX==/{{ IPV4_NET_EXTERNAL_PREFIX }}./g' {} +
+
+    # Disable checkouting the model from remote repository
+    cat << 'EOF' >> /srv/salt/reclass/nodes/{{ HOSTNAME_CFG01 }}.yml
+    # local storage
+      reclass:
+        storage:
+          data_source:
+            engine: local
+    EOF
+
+    # Show the changes to the console
+    cd /srv/salt/reclass/; git diff
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 1}
   skip_fail: false
@@ -92,7 +139,7 @@
     [ ! -d /srv/salt/reclass/classes/service ] && mkdir -p /srv/salt/reclass/classes/service;
     declare -a formula_services=("linux" "reclass" "salt" "openssh" "ntp" "git" "nginx" "collectd" "sensu" "heka" "sphinx" "keystone" "mysql" "grafana" "haproxy" "rsyslog" "horizon");
     echo -e "\nInstalling all required salt formulas\n";
-    apt-get install -y "${formula_services[@]/#/salt-formula-}";
+    eatmydata apt-get install -y "${formula_services[@]/#/salt-formula-}";
     for formula_service in "${formula_services[@]}"; do
       echo -e "\nLink service metadata for formula ${formula_service} ...\n";
       [ ! -L "/srv/salt/reclass/classes/service/${formula_service}" ] && ln -s ${FORMULA_PATH}/reclass/service/${formula_service} /srv/salt/reclass/classes/service/${formula_service};
@@ -111,17 +158,37 @@
   retry: {count: 1, delay: 1}
   skip_fail: false
 
-- description: Configure salt-minion on cfg01
+- description: Restart salt-master service
+  cmd: |
+     systemctl restart salt-master;
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
+{% for ssh in config.underlay.ssh %}
+- description: Configure salt-minion on {{ ssh['node_name'] }}
   cmd: |
     [ ! -d /etc/salt/minion.d ] && mkdir -p /etc/salt/minion.d;
     cat << "EOF" >> /etc/salt/minion.d/minion.conf
-    id: {{ HOSTNAME_CFG01 }}
-    master: 127.0.0.1
+    id: {{ ssh['node_name'] }}
+    master: {{ config.salt.salt_master_host }}
     EOF
-    apt-get install -y salt-minion;
-  node_name: {{ HOSTNAME_CFG01 }}
+    eatmydata apt-get install -y salt-minion;
+    echo "Check for system info and metadata availability ...";
+    salt-call --no-color grains.items;
+    salt-call --no-color pillar.items;
+  node_name: {{ ssh['node_name'] }}
   retry: {count: 1, delay: 1}
   skip_fail: false
+{% endfor %}
+
+
+- description: Accept salt keys from all the nodes
+  cmd: salt-key -A -y
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: true
+
 
 - description: Configure salt adoptors on cfg01
   cmd: |
@@ -131,16 +198,6 @@
   retry: {count: 1, delay: 1}
   skip_fail: false
 
-- description: Restart services
-  cmd: |
-     systemctl restart salt-master;
-     systemctl restart salt-minion;
-     echo "Showing system info and metadata ...";
-     salt-call --no-color grains.items;
-     salt-call --no-color pillar.data;
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 5}
-  skip_fail: false
 
 # Prepare salt services and nodes settings
 - description: Run 'linux' formula on cfg01
@@ -150,6 +207,7 @@
   retry: {count: 1, delay: 5}
   skip_fail: false
 
+
 - description: Run 'openssh' formula on cfg01
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
     -C 'I@salt:master' state.sls openssh;
@@ -160,6 +218,7 @@
   retry: {count: 3, delay: 5}
   skip_fail: false
 
+
 - description: '*Workaround* of the bug https://mirantis.jira.com/browse/PROD-7962'
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
     '*' cmd.run "echo '    StrictHostKeyChecking no' >> /root/.ssh/config"
@@ -167,29 +226,25 @@
   retry: {count: 1, delay: 1}
   skip_fail: false
 
-- description: Run 'reclass' formula on cfg01
-  cmd: timeout 120 salt --hard-crash --state-output=mixed --state-verbose=False
-    -C 'I@salt:master' reclass;
-    salt-call --no-color state.sls salt.master;
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 5}
-  skip_fail: true
+#- description: (duplicate of the next two steps) Run 'reclass' formula on cfg01
+#  cmd: timeout 120 salt --hard-crash --state-output=mixed --state-verbose=False
+#    -C 'I@salt:master' state.sls reclass;
+#    salt-call --hard-crash --state-output=mixed --state-verbose=False state.sls salt.master;
+#  node_name: {{ HOSTNAME_CFG01 }}
+#  retry: {count: 1, delay: 5}
+#  skip_fail: true
 
 
 - description: Run 'salt' formula on cfg01
   cmd: timeout 120 salt --hard-crash --state-output=mixed --state-verbose=False
     -C 'I@salt:master' state.sls salt.master.service;
-    salt-call --no-color state.sls salt.master,salt.api,salt.minion.ca;
+    salt-call --hard-crash --state-output=mixed --state-verbose=False
+        state.sls salt.master,salt.api,salt.minion.ca;
     systemctl restart salt-minion;
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 5}
   skip_fail: true
 
-- description: Accept salt keys from all the nodes
-  cmd: salt-key -A -y
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 5}
-  skip_fail: false
 
 - description: Generate inventory for all the nodes to the /srv/salt/reclass/nodes/_generated
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
@@ -219,64 +274,25 @@
 
 # Bootstrap all nodes
 
-- description: Configure linux on controllers
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' state.sls
-    linux
+- description: Configure linux on other nodes
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C '* and not
+    cfg01*' state.sls linux
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 5}
   skip_fail: false
 
-- description: Configure linux on proxy
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'prx*' state.sls
-    linux
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 5}
-  skip_fail: false
-
-- description: Configure linux on gtw
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'gtw*' state.sls
-    linux
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 3, delay: 20}
-  skip_fail: false
-
-- description: Configure linux on cmp
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.sls
-    linux
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 3, delay: 20}
-  skip_fail: false
-
 - description: Configure openssh on all nodes
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C '* and not
-    cfg*' state.sls openssh;salt --hard-crash --state-output=mixed --state-verbose=False
+    cfg01*' state.sls openssh;salt --hard-crash --state-output=mixed --state-verbose=False
     -C '* and not cfg*' cmd.run "sed -i 's/PasswordAuthentication no/PasswordAuthentication
     yes/' /etc/ssh/sshd_config && service ssh restart"
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 5}
   skip_fail: false
 
-- description: Configure salt.minion on ctl
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' state.sls salt.minion
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 3, delay: 5}
-  skip_fail: false
-
-- description: Configure salt.minion on prx
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'prx*' state.sls salt.minion
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 3, delay: 5}
-  skip_fail: false
-
-
-- description: Configure salt.minion on gtw
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'gtw*' state.sls salt.minion
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 3, delay: 5}
-  skip_fail: false
-
-- description: Configure salt.minion on cmp
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.sls salt.minion
+- description: Configure salt.minion on other nodes
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C '* and not
+    cfg01*' state.sls salt.minion
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 3, delay: 5}
   skip_fail: false
@@ -299,21 +315,20 @@
   retry: {count: 1, delay: 10}
   skip_fail: false
 
-#- description: Hack gtw node
-#  cmd: salt 'gtw*' cmd.run "ip addr del 172.16.10.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 172.16.10.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 172.16.10.106/24 dev ens4; ip addr flush dev ens4";
-#  node_name: {{ HOSTNAME_CFG01 }}
-#  retry: {count: 1, delay: 10}
-#  skip_fail: false
-#
+- description: Hack gtw node
+  cmd: salt 'gtw*' cmd.run "ip addr del {{ 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 {{ 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 {{ 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
diff --git a/tcp_tests/templates/salt/virtual-mcp-ocata-ovs-salt.yaml b/tcp_tests/templates/salt/virtual-mcp-ocata-ovs-salt.yaml
index a1cafcc..e3a7180 100644
--- a/tcp_tests/templates/salt/virtual-mcp-ocata-ovs-salt.yaml
+++ b/tcp_tests/templates/salt/virtual-mcp-ocata-ovs-salt.yaml
@@ -1,40 +1,58 @@
-{% from 'virtual-mcp-ocata-ovs.jinja' import HOSTNAME_CFG01 with context %}
+{% from 'underlay/virtual-mcp-ocata-ovs.yaml' import HOSTNAME_CFG01 with context %}
+
+{% set SALT_MODELS_REPOSITORY = os_env('SALT_MODELS_REPOSITORY','https://gerrit.mcp.mirantis.net/salt-models/mcp-virtual-lab') %}
+{% set SALT_MODELS_COMMIT = os_env('SALT_MODELS_COMMIT','master') %}
+
+# Address pools for reclass cluster model are taken in the following order:
+# 1. environment variables,
+# 2. config.underlay.address_pools based on fuel-devops address pools
+#    (see generated '.ini' file after underlay is created),
+# 3. defaults
+{% set address_pools = config.underlay.address_pools %}
+{% set IPV4_NET_ADMIN = os_env('IPV4_NET_ADMIN', address_pools.get('admin-pool01', '192.168.10.0/24')) %}
+{% set IPV4_NET_CONTROL = os_env('IPV4_NET_CONTROL', address_pools.get('private-pool01', '172.16.10.0/24')) %}
+{% set IPV4_NET_TENANT = os_env('IPV4_NET_TENANT', address_pools.get('tenant-pool01', '10.1.0.0/24')) %}
+{% set IPV4_NET_EXTERNAL = os_env('IPV4_NET_EXTERNAL', address_pools.get('external-pool01', '10.16.0.0/24')) %}
+
+{% set IPV4_NET_ADMIN_PREFIX = '.'.join(IPV4_NET_ADMIN.split('.')[0:3]) %}
+{% set IPV4_NET_CONTROL_PREFIX = '.'.join(IPV4_NET_CONTROL.split('.')[0:3]) %}
+{% set IPV4_NET_TENANT_PREFIX = '.'.join(IPV4_NET_TENANT.split('.')[0:3]) %}
+{% set IPV4_NET_EXTERNAL_PREFIX = '.'.join(IPV4_NET_EXTERNAL.split('.')[0:3]) %}
 
 # Install salt to the config node
 
+#- description: (moved to cloud-init config) Configure repository on the cfg01 node
+#  cmd:
+#    echo "172.18.248.114    jenkins.mcp.mirantis.net  gerrit.mcp.mirantis.net" >> /etc/hosts;
+#    echo "185.135.196.10    apt-mk.mirantis.com" >> /etc/hosts;
+#    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-mk.mirantis.com/xenial nightly salt extra" > /etc/apt/sources.list.d/mcp_salt.list;
+#    wget -O - http://apt-mk.mirantis.com/public.gpg | apt-key add -;
+#    echo "deb http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2016.3 xenial main" > /etc/apt/sources.list.d/saltstack.list;
+#    wget -O - https://repo.saltstack.com/apt/ubuntu/16.04/amd64/2016.3/SALTSTACK-GPG-KEY.pub | apt-key add -;
+#  node_name: {{ HOSTNAME_CFG01 }}
+#  retry: {count: 1, delay: 1}
+#  skip_fail: false
 
-- description: Configure repository on the cfg01 node
-  cmd:
-    echo "172.18.248.114    jenkins.mcp.mirantis.net  gerrit.mcp.mirantis.net" >> /etc/hosts;
-    echo "185.135.196.10    apt-mk.mirantis.com" >> /etc/hosts;
-    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-mk.mirantis.com/xenial nightly salt extra" > /etc/apt/sources.list.d/mcp_salt.list;
-    wget -O - http://apt-mk.mirantis.com/public.gpg | apt-key add -;
-    echo "deb http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2016.3 xenial main" > /etc/apt/sources.list.d/saltstack.list;
-    wget -O - https://repo.saltstack.com/apt/ubuntu/16.04/amd64/2016.3/SALTSTACK-GPG-KEY.pub | apt-key add -;
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 1}
-  skip_fail: false
-
-- description: Update packages on cfg01
-  cmd: apt-get clean; apt-get update
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 1}
-  skip_fail: false
+#- description: Update packages on cfg01
+#  cmd: apt-get clean; eatmydata apt-get update
+#  node_name: {{ HOSTNAME_CFG01 }}
+#  retry: {count: 1, delay: 1}
+#  skip_fail: false
 
 - description: Installing salt master on cfg01
-  cmd:  apt-get install -y reclass git; apt-get install -y salt-master
+  cmd:  eatmydata apt-get install -y reclass git salt-master
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 1}
   skip_fail: false
 
-- description: Install common packages on cfg01
-  cmd: apt-get install -y python-pip wget curl tmux byobu iputils-ping traceroute htop tree
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 1}
-  skip_fail: false
+#- description: (moved to cloud-init config) Install common packages on cfg01
+#  cmd: eatmydata apt-get install -y python-pip wget curl tmux byobu iputils-ping traceroute htop tree
+#  node_name: {{ HOSTNAME_CFG01 }}
+#  retry: {count: 1, delay: 1}
+#  skip_fail: false
 
 - description: Configure salt-master on cfg01
   cmd: |
@@ -74,8 +92,37 @@
 - description: Clone reclass models with submodules
   cmd: |
     ssh-keyscan -H github.com >> ~/.ssh/known_hosts;
-    git clone -b master --recurse-submodules https://gerrit.mcp.mirantis.net/salt-models/mcp-virtual-lab /srv/salt/reclass;
+    git clone -b {{ SALT_MODELS_COMMIT }} --recurse-submodules {{ SALT_MODELS_REPOSITORY }} /srv/salt/reclass;
+
     mkdir -p /srv/salt/reclass/classes/service;
+
+    # 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:
+    # 192.168.10 -> 10.16.0 (generated network for admin)
+    # 10.16.0 -> <external network>
+    # So let's replace constant networks to the keywords, and then keywords to the desired networks.
+    find /srv/salt/reclass/ -type f -exec sed -i 's/192\.168\.10\./==IPV4_NET_ADMIN_PREFIX==/g' {} +
+    find /srv/salt/reclass/ -type f -exec sed -i 's/172\.16\.10\./==IPV4_NET_CONTROL_PREFIX==/g' {} +
+    find /srv/salt/reclass/ -type f -exec sed -i 's/10\.1\.0\./==IPV4_NET_TENANT_PREFIX==/g' {} +
+    find /srv/salt/reclass/ -type f -exec sed -i 's/10\.16\.0\./==IPV4_NET_EXTERNAL_PREFIX==/g' {} +
+
+    find /srv/salt/reclass/ -type f -exec sed -i 's/==IPV4_NET_ADMIN_PREFIX==/{{ IPV4_NET_ADMIN_PREFIX }}./g' {} +
+    find /srv/salt/reclass/ -type f -exec sed -i 's/==IPV4_NET_CONTROL_PREFIX==/{{ IPV4_NET_CONTROL_PREFIX }}./g' {} +
+    find /srv/salt/reclass/ -type f -exec sed -i 's/==IPV4_NET_TENANT_PREFIX==/{{ IPV4_NET_TENANT_PREFIX }}./g' {} +
+    find /srv/salt/reclass/ -type f -exec sed -i 's/==IPV4_NET_EXTERNAL_PREFIX==/{{ IPV4_NET_EXTERNAL_PREFIX }}./g' {} +
+
+    # Disable checkouting the model from remote repository
+    cat << 'EOF' >> /srv/salt/reclass/nodes/{{ HOSTNAME_CFG01 }}.yml
+    # local storage
+      reclass:
+        storage:
+          data_source:
+            engine: local
+    EOF
+
+    # Show the changes to the console
+    cd /srv/salt/reclass/; git diff
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 1}
   skip_fail: false
@@ -92,7 +139,7 @@
     [ ! -d /srv/salt/reclass/classes/service ] && mkdir -p /srv/salt/reclass/classes/service;
     declare -a formula_services=("linux" "reclass" "salt" "openssh" "ntp" "git" "nginx" "collectd" "sensu" "heka" "sphinx" "keystone" "mysql" "grafana" "haproxy" "rsyslog" "horizon");
     echo -e "\nInstalling all required salt formulas\n";
-    apt-get install -y "${formula_services[@]/#/salt-formula-}";
+    eatmydata apt-get install -y "${formula_services[@]/#/salt-formula-}";
     for formula_service in "${formula_services[@]}"; do
       echo -e "\nLink service metadata for formula ${formula_service} ...\n";
       [ ! -L "/srv/salt/reclass/classes/service/${formula_service}" ] && ln -s ${FORMULA_PATH}/reclass/service/${formula_service} /srv/salt/reclass/classes/service/${formula_service};
@@ -111,17 +158,37 @@
   retry: {count: 1, delay: 1}
   skip_fail: false
 
-- description: Configure salt-minion on cfg01
+- description: Restart salt-master service
+  cmd: |
+     systemctl restart salt-master;
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: false
+
+{% for ssh in config.underlay.ssh %}
+- description: Configure salt-minion on {{ ssh['node_name'] }}
   cmd: |
     [ ! -d /etc/salt/minion.d ] && mkdir -p /etc/salt/minion.d;
     cat << "EOF" >> /etc/salt/minion.d/minion.conf
-    id: {{ HOSTNAME_CFG01 }}
-    master: 127.0.0.1
+    id: {{ ssh['node_name'] }}
+    master: {{ config.salt.salt_master_host }}
     EOF
-    apt-get install -y salt-minion;
-  node_name: {{ HOSTNAME_CFG01 }}
+    eatmydata apt-get install -y salt-minion;
+    echo "Check for system info and metadata availability ...";
+    salt-call --no-color grains.items;
+    salt-call --no-color pillar.items;
+  node_name: {{ ssh['node_name'] }}
   retry: {count: 1, delay: 1}
   skip_fail: false
+{% endfor %}
+
+
+- description: Accept salt keys from all the nodes
+  cmd: salt-key -A -y
+  node_name: {{ HOSTNAME_CFG01 }}
+  retry: {count: 1, delay: 5}
+  skip_fail: true
+
 
 - description: Configure salt adoptors on cfg01
   cmd: |
@@ -131,16 +198,6 @@
   retry: {count: 1, delay: 1}
   skip_fail: false
 
-- description: Restart services
-  cmd: |
-     systemctl restart salt-master;
-     systemctl restart salt-minion;
-     echo "Showing system info and metadata ...";
-     salt-call --no-color grains.items;
-     salt-call --no-color pillar.data;
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 5}
-  skip_fail: false
 
 # Prepare salt services and nodes settings
 - description: Run 'linux' formula on cfg01
@@ -150,6 +207,7 @@
   retry: {count: 1, delay: 5}
   skip_fail: false
 
+
 - description: Run 'openssh' formula on cfg01
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
     -C 'I@salt:master' state.sls openssh;
@@ -160,6 +218,7 @@
   retry: {count: 3, delay: 5}
   skip_fail: false
 
+
 - description: '*Workaround* of the bug https://mirantis.jira.com/browse/PROD-7962'
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
     '*' cmd.run "echo '    StrictHostKeyChecking no' >> /root/.ssh/config"
@@ -167,29 +226,25 @@
   retry: {count: 1, delay: 1}
   skip_fail: false
 
-- description: Run 'reclass' formula on cfg01
-  cmd: timeout 120 salt --hard-crash --state-output=mixed --state-verbose=False
-    -C 'I@salt:master' reclass;
-    salt-call --no-color state.sls salt.master;
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 5}
-  skip_fail: true
+#- description: (duplicate of the next two steps) Run 'reclass' formula on cfg01
+#  cmd: timeout 120 salt --hard-crash --state-output=mixed --state-verbose=False
+#    -C 'I@salt:master' state.sls reclass;
+#    salt-call --hard-crash --state-output=mixed --state-verbose=False state.sls salt.master;
+#  node_name: {{ HOSTNAME_CFG01 }}
+#  retry: {count: 1, delay: 5}
+#  skip_fail: true
 
 
 - description: Run 'salt' formula on cfg01
   cmd: timeout 120 salt --hard-crash --state-output=mixed --state-verbose=False
     -C 'I@salt:master' state.sls salt.master.service;
-    salt-call --no-color state.sls salt.master,salt.api,salt.minion.ca;
+    salt-call --hard-crash --state-output=mixed --state-verbose=False
+        state.sls salt.master,salt.api,salt.minion.ca;
     systemctl restart salt-minion;
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 5}
   skip_fail: true
 
-- description: Accept salt keys from all the nodes
-  cmd: salt-key -A -y
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 5}
-  skip_fail: false
 
 - description: Generate inventory for all the nodes to the /srv/salt/reclass/nodes/_generated
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False
@@ -219,64 +274,25 @@
 
 # Bootstrap all nodes
 
-- description: Configure linux on controllers
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' state.sls
-    linux
+- description: Configure linux on other nodes
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C '* and not
+    cfg01*' state.sls linux
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 5}
   skip_fail: false
 
-- description: Configure linux on proxy
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'prx*' state.sls
-    linux
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 1, delay: 5}
-  skip_fail: false
-
-- description: Configure linux on gtw
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'gtw*' state.sls
-    linux
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 3, delay: 20}
-  skip_fail: false
-
-- description: Configure linux on cmp
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.sls
-    linux
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 3, delay: 20}
-  skip_fail: false
-
 - description: Configure openssh on all nodes
   cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C '* and not
-    cfg*' state.sls openssh;salt --hard-crash --state-output=mixed --state-verbose=False
+    cfg01*' state.sls openssh;salt --hard-crash --state-output=mixed --state-verbose=False
     -C '* and not cfg*' cmd.run "sed -i 's/PasswordAuthentication no/PasswordAuthentication
     yes/' /etc/ssh/sshd_config && service ssh restart"
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 1, delay: 5}
   skip_fail: false
 
-- description: Configure salt.minion on ctl
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'ctl*' state.sls salt.minion
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 3, delay: 5}
-  skip_fail: false
-
-- description: Configure salt.minion on prx
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'prx*' state.sls salt.minion
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 3, delay: 5}
-  skip_fail: false
-
-
-- description: Configure salt.minion on gtw
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'gtw*' state.sls salt.minion
-  node_name: {{ HOSTNAME_CFG01 }}
-  retry: {count: 3, delay: 5}
-  skip_fail: false
-
-- description: Configure salt.minion on cmp
-  cmd: salt --hard-crash --state-output=mixed --state-verbose=False 'cmp*' state.sls salt.minion
+- description: Configure salt.minion on other nodes
+  cmd: salt --hard-crash --state-output=mixed --state-verbose=False -C '* and not
+    cfg01*' state.sls salt.minion
   node_name: {{ HOSTNAME_CFG01 }}
   retry: {count: 3, delay: 5}
   skip_fail: false
@@ -300,20 +316,19 @@
   skip_fail: false
 
 - description: Hack gtw node
-  cmd: salt 'gtw*' cmd.run "ip addr del 172.16.10.110/24 dev ens4; ip addr flush dev ens4";
+  cmd: salt 'gtw*' cmd.run "ip addr del {{ 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 172.16.10.105/24 dev ens4; ip addr flush dev ens4";
+  cmd: salt 'cmp01*' cmd.run "ip addr del {{ 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 172.16.10.106/24 dev ens4; ip addr flush dev ens4";
+  cmd: salt 'cmp02*' cmd.run "ip addr del {{ 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
-
diff --git a/tcp_tests/templates/underlay/virtual-mcp-ocata-dvr--user-data-cfg01.yaml b/tcp_tests/templates/underlay/virtual-mcp-ocata-dvr--user-data-cfg01.yaml
index 443e50c..45ad5cf 100644
--- a/tcp_tests/templates/underlay/virtual-mcp-ocata-dvr--user-data-cfg01.yaml
+++ b/tcp_tests/templates/underlay/virtual-mcp-ocata-dvr--user-data-cfg01.yaml
@@ -41,6 +41,26 @@
    - swapon /swapfile
    - echo "/swapfile   none    swap    defaults    0   0" >> /etc/fstab
 
+   ############## TCP Cloud cfg01 node ##################
+   #- sleep 120
+   - echo "Preparing base OS"
+
+   - echo "172.18.248.114    jenkins.mcp.mirantis.net  gerrit.mcp.mirantis.net" >> /etc/hosts;
+   - echo "185.135.196.10    apt-mk.mirantis.com" >> /etc/hosts;
+   - 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-mk.mirantis.com/xenial nightly salt extra" > /etc/apt/sources.list.d/mcp_salt.list;
+   - wget -O - http://apt-mk.mirantis.com/public.gpg | apt-key add -;
+   - echo "deb http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2016.3 xenial main" > /etc/apt/sources.list.d/saltstack.list;
+   - wget -O - https://repo.saltstack.com/apt/ubuntu/16.04/amd64/2016.3/SALTSTACK-GPG-KEY.pub | apt-key add -;
+
+   - apt-get clean
+   - apt-get update
+
+   # Install common packages
+   - eatmydata apt-get install -y python-pip git curl tmux byobu iputils-ping traceroute htop tree
+
    ########################################################
    # Node is ready, allow SSH access
    - echo "Allow SSH access ..."
diff --git a/tcp_tests/templates/underlay/virtual-mcp-ocata-dvr--user-data1604.yaml b/tcp_tests/templates/underlay/virtual-mcp-ocata-dvr--user-data1604.yaml
index 1013571..2c3cb6c 100644
--- a/tcp_tests/templates/underlay/virtual-mcp-ocata-dvr--user-data1604.yaml
+++ b/tcp_tests/templates/underlay/virtual-mcp-ocata-dvr--user-data1604.yaml
@@ -43,11 +43,6 @@
    - swapon /swapfile
    - echo "/swapfile   none    swap    defaults   0   0" >> /etc/fstab
 
-   ########################################################
-   # Node is ready, allow SSH access
-   - echo "Allow SSH access ..."
-   - sudo iptables -D INPUT -p tcp --dport 22 -j DROP
-   ########################################################
 
    ############## TCP Cloud cfg01 node ##################
    #- sleep 120
@@ -62,31 +57,16 @@
    - wget -O - https://repo.saltstack.com/apt/ubuntu/16.04/amd64/2016.3/SALTSTACK-GPG-KEY.pub | apt-key add -
 
    - apt-get clean
-   - apt-get update
-   - apt-get -y upgrade
+   - eatmydata apt-get update && apt-get -y upgrade
 
    # Install common packages
-   - apt-get install -y python-pip git
-   - apt-get install -y curl tmux byobu iputils-ping traceroute htop tree
+   - eatmydata apt-get install -y python-pip git curl tmux byobu iputils-ping traceroute htop tree mc
 
-   - apt-get install -y salt-minion
-
-   # To be configured from inventory/fuel-devops by operator or autotests
-   - 'echo "id: {hostname}" >> /etc/salt/minion'
-   - 'echo "master: 192.168.10.100" >> /etc/salt/minion'
-
-   - echo "Restarting minion service with workarounds..."
-   - rm -f /etc/salt/pki/minion/minion_master.pub
-   - service salt-minion restart
-   - sleep 5
-   - rm -f /etc/salt/pki/minion/minion_master.pub
-   - service salt-minion restart
-
-   #- echo "Showing node metadata..."
-   #- salt-call pillar.data
-
-   #- echo "Running complete state ..."
-   #- salt-call state.sls linux,openssh,salt
+   ########################################################
+   # Node is ready, allow SSH access
+   - echo "Allow SSH access ..."
+   - sudo iptables -D INPUT -p tcp --dport 22 -j DROP
+   ########################################################
 
   write_files:
    - path: /etc/network/interfaces
diff --git a/tcp_tests/templates/underlay/virtual-mcp-ocata-dvr.yaml b/tcp_tests/templates/underlay/virtual-mcp-ocata-dvr.yaml
index b549147..254d82f 100644
--- a/tcp_tests/templates/underlay/virtual-mcp-ocata-dvr.yaml
+++ b/tcp_tests/templates/underlay/virtual-mcp-ocata-dvr.yaml
@@ -1,7 +1,13 @@
+{% import 'underlay/virtual-mcp-ocata-dvr--meta-data.yaml' as CLOUDINIT_META_DATA %}
+{% import 'underlay/virtual-mcp-ocata-dvr--user-data-cfg01.yaml' as CLOUDINIT_USER_DATA_CFG01 %}
+{% import 'underlay/virtual-mcp-ocata-dvr--user-data1604.yaml' as CLOUDINIT_USER_DATA_1604 %}
+
 ---
 aliases:
-  default_interface_model:
-    - &interface_model !os_env INTERFACE_MODEL, virtio
+ - &interface_model {{ os_env('INTERFACE_MODEL', 'virtio') }}
+ - &cloudinit_meta_data {{ CLOUDINIT_META_DATA }}
+ - &cloudinit_user_data_cfg01 {{ CLOUDINIT_USER_DATA_CFG01 }}
+ - &cloudinit_user_data_1604 {{ CLOUDINIT_USER_DATA_1604 }}
 
 {% set DOMAIN_NAME = os_env('LAB_CONFIG_NAME', 'virtual-mcp-ocata-dvr') + '.local' %}
 {% set HOSTNAME_CFG01 = os_env('HOSTNAME_CFG01', 'cfg01.' + DOMAIN_NAME) %}
@@ -19,7 +25,7 @@
 
     address_pools:
       private-pool01:
-        net: 172.16.10.0/24:24
+        net: {{ os_env('PRIVATE_ADDRESS_POOL01', '10.60.0.0/16:24') }}
         params:
           ip_reserved:
             gateway: +1
@@ -36,7 +42,7 @@
             dhcp: [+90, -10]
 
       admin-pool01:
-        net: 192.168.10.0/24:24
+        net: {{ os_env('ADMIN_ADDRESS_POOL01', '10.70.0.0/16:24') }}
         params:
           ip_reserved:
             gateway: +1
@@ -53,7 +59,7 @@
             dhcp: [+90, -10]
 
       tenant-pool01:
-        net: 10.1.0.0/24:24
+        net: {{ os_env('TENANT_ADDRESS_POOL01', '10.80.0.0/16:24') }}
         params:
           ip_reserved:
             gateway: +1
@@ -70,7 +76,7 @@
             dhcp: [+10, -10]
 
       external-pool01:
-        net: 10.16.0.0/24:24
+        net: {{ os_env('EXTERNAL_ADDRESS_POOL01', '10.90.0.0/16:24') }}
         params:
           ip_reserved:
             gateway: +1
@@ -154,8 +160,8 @@
                   format: raw
                   device: cdrom
                   bus: ide
-                  cloudinit_meta_data: !include virtual-mcp-ocata-dvr--meta-data.yaml
-                  cloudinit_user_data: !include virtual-mcp-ocata-dvr--user-data-cfg01.yaml
+                  cloudinit_meta_data: *cloudinit_meta_data
+                  cloudinit_user_data: *cloudinit_user_data_cfg01
 
               interfaces:
                 - label: ens3
@@ -195,8 +201,8 @@
                   format: raw
                   device: cdrom
                   bus: ide
-                  cloudinit_meta_data: !include virtual-mcp-ocata-dvr--meta-data.yaml
-                  cloudinit_user_data: !include virtual-mcp-ocata-dvr--user-data1604.yaml
+                  cloudinit_meta_data: *cloudinit_meta_data
+                  cloudinit_user_data: *cloudinit_user_data_1604
 
               interfaces: &interfaces
                 - label: ens3
@@ -236,8 +242,8 @@
                   format: raw
                   device: cdrom
                   bus: ide
-                  cloudinit_meta_data: !include virtual-mcp-ocata-dvr--meta-data.yaml
-                  cloudinit_user_data: !include virtual-mcp-ocata-dvr--user-data1604.yaml
+                  cloudinit_meta_data: *cloudinit_meta_data
+                  cloudinit_user_data: *cloudinit_user_data_1604
 
               interfaces: *interfaces
               network_config: *network_config
@@ -265,8 +271,8 @@
                   format: raw
                   device: cdrom
                   bus: ide
-                  cloudinit_meta_data: !include virtual-mcp-ocata-dvr--meta-data.yaml
-                  cloudinit_user_data: !include virtual-mcp-ocata-dvr--user-data1604.yaml
+                  cloudinit_meta_data: *cloudinit_meta_data
+                  cloudinit_user_data: *cloudinit_user_data_1604
 
               interfaces: *interfaces
               network_config: *network_config
@@ -294,8 +300,8 @@
                   format: raw
                   device: cdrom
                   bus: ide
-                  cloudinit_meta_data: !include virtual-mcp-ocata-dvr--meta-data.yaml
-                  cloudinit_user_data: !include virtual-mcp-ocata-dvr--user-data1604.yaml
+                  cloudinit_meta_data: *cloudinit_meta_data
+                  cloudinit_user_data: *cloudinit_user_data_1604
 
               interfaces: *interfaces
               network_config: *network_config
@@ -321,8 +327,8 @@
                   format: raw
                   device: cdrom
                   bus: ide
-                  cloudinit_meta_data: !include virtual-mcp-ocata-dvr--meta-data.yaml
-                  cloudinit_user_data: !include virtual-mcp-ocata-dvr--user-data1604.yaml
+                  cloudinit_meta_data: *cloudinit_meta_data
+                  cloudinit_user_data: *cloudinit_user_data_1604
 
 
               interfaces: &all_interfaces
@@ -372,8 +378,8 @@
                   format: raw
                   device: cdrom
                   bus: ide
-                  cloudinit_meta_data: !include virtual-mcp-ocata-dvr--meta-data.yaml
-                  cloudinit_user_data: !include virtual-mcp-ocata-dvr--user-data1604.yaml
+                  cloudinit_meta_data: *cloudinit_meta_data
+                  cloudinit_user_data: *cloudinit_user_data_1604
 
               interfaces: *all_interfaces
               network_config: *all_network_config
@@ -398,8 +404,8 @@
                   format: raw
                   device: cdrom
                   bus: ide
-                  cloudinit_meta_data: !include virtual-mcp-ocata-dvr--meta-data.yaml
-                  cloudinit_user_data: !include virtual-mcp-ocata-dvr--user-data1604.yaml
+                  cloudinit_meta_data: *cloudinit_meta_data
+                  cloudinit_user_data: *cloudinit_user_data_1604
 
               interfaces: *all_interfaces
               network_config: *all_network_config
diff --git a/tcp_tests/templates/underlay/virtual-mcp-ocata-ovs--user-data-cfg01.yaml b/tcp_tests/templates/underlay/virtual-mcp-ocata-ovs--user-data-cfg01.yaml
index 443e50c..45ad5cf 100644
--- a/tcp_tests/templates/underlay/virtual-mcp-ocata-ovs--user-data-cfg01.yaml
+++ b/tcp_tests/templates/underlay/virtual-mcp-ocata-ovs--user-data-cfg01.yaml
@@ -41,6 +41,26 @@
    - swapon /swapfile
    - echo "/swapfile   none    swap    defaults    0   0" >> /etc/fstab
 
+   ############## TCP Cloud cfg01 node ##################
+   #- sleep 120
+   - echo "Preparing base OS"
+
+   - echo "172.18.248.114    jenkins.mcp.mirantis.net  gerrit.mcp.mirantis.net" >> /etc/hosts;
+   - echo "185.135.196.10    apt-mk.mirantis.com" >> /etc/hosts;
+   - 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-mk.mirantis.com/xenial nightly salt extra" > /etc/apt/sources.list.d/mcp_salt.list;
+   - wget -O - http://apt-mk.mirantis.com/public.gpg | apt-key add -;
+   - echo "deb http://repo.saltstack.com/apt/ubuntu/16.04/amd64/2016.3 xenial main" > /etc/apt/sources.list.d/saltstack.list;
+   - wget -O - https://repo.saltstack.com/apt/ubuntu/16.04/amd64/2016.3/SALTSTACK-GPG-KEY.pub | apt-key add -;
+
+   - apt-get clean
+   - apt-get update
+
+   # Install common packages
+   - eatmydata apt-get install -y python-pip git curl tmux byobu iputils-ping traceroute htop tree
+
    ########################################################
    # Node is ready, allow SSH access
    - echo "Allow SSH access ..."
diff --git a/tcp_tests/templates/underlay/virtual-mcp-ocata-ovs--user-data1604.yaml b/tcp_tests/templates/underlay/virtual-mcp-ocata-ovs--user-data1604.yaml
index 1013571..2c3cb6c 100644
--- a/tcp_tests/templates/underlay/virtual-mcp-ocata-ovs--user-data1604.yaml
+++ b/tcp_tests/templates/underlay/virtual-mcp-ocata-ovs--user-data1604.yaml
@@ -43,11 +43,6 @@
    - swapon /swapfile
    - echo "/swapfile   none    swap    defaults   0   0" >> /etc/fstab
 
-   ########################################################
-   # Node is ready, allow SSH access
-   - echo "Allow SSH access ..."
-   - sudo iptables -D INPUT -p tcp --dport 22 -j DROP
-   ########################################################
 
    ############## TCP Cloud cfg01 node ##################
    #- sleep 120
@@ -62,31 +57,16 @@
    - wget -O - https://repo.saltstack.com/apt/ubuntu/16.04/amd64/2016.3/SALTSTACK-GPG-KEY.pub | apt-key add -
 
    - apt-get clean
-   - apt-get update
-   - apt-get -y upgrade
+   - eatmydata apt-get update && apt-get -y upgrade
 
    # Install common packages
-   - apt-get install -y python-pip git
-   - apt-get install -y curl tmux byobu iputils-ping traceroute htop tree
+   - eatmydata apt-get install -y python-pip git curl tmux byobu iputils-ping traceroute htop tree mc
 
-   - apt-get install -y salt-minion
-
-   # To be configured from inventory/fuel-devops by operator or autotests
-   - 'echo "id: {hostname}" >> /etc/salt/minion'
-   - 'echo "master: 192.168.10.100" >> /etc/salt/minion'
-
-   - echo "Restarting minion service with workarounds..."
-   - rm -f /etc/salt/pki/minion/minion_master.pub
-   - service salt-minion restart
-   - sleep 5
-   - rm -f /etc/salt/pki/minion/minion_master.pub
-   - service salt-minion restart
-
-   #- echo "Showing node metadata..."
-   #- salt-call pillar.data
-
-   #- echo "Running complete state ..."
-   #- salt-call state.sls linux,openssh,salt
+   ########################################################
+   # Node is ready, allow SSH access
+   - echo "Allow SSH access ..."
+   - sudo iptables -D INPUT -p tcp --dport 22 -j DROP
+   ########################################################
 
   write_files:
    - path: /etc/network/interfaces
diff --git a/tcp_tests/templates/underlay/virtual-mcp-ocata-ovs.yaml b/tcp_tests/templates/underlay/virtual-mcp-ocata-ovs.yaml
index 0a27a36..7967ad9 100644
--- a/tcp_tests/templates/underlay/virtual-mcp-ocata-ovs.yaml
+++ b/tcp_tests/templates/underlay/virtual-mcp-ocata-ovs.yaml
@@ -1,7 +1,13 @@
+{% import 'underlay/virtual-mcp-ocata-ovs--meta-data.yaml' as CLOUDINIT_META_DATA %}
+{% import 'underlay/virtual-mcp-ocata-ovs--user-data-cfg01.yaml' as CLOUDINIT_USER_DATA_CFG01 %}
+{% import 'underlay/virtual-mcp-ocata-ovs--user-data1604.yaml' as CLOUDINIT_USER_DATA_1604 %}
+
 ---
 aliases:
-  default_interface_model:
-    - &interface_model !os_env INTERFACE_MODEL, virtio
+ - &interface_model {{ os_env('INTERFACE_MODEL', 'virtio') }}
+ - &cloudinit_meta_data {{ CLOUDINIT_META_DATA }}
+ - &cloudinit_user_data_cfg01 {{ CLOUDINIT_USER_DATA_CFG01 }}
+ - &cloudinit_user_data_1604 {{ CLOUDINIT_USER_DATA_1604 }}
 
 {% set DOMAIN_NAME = os_env('LAB_CONFIG_NAME', 'virtual-mcp-ocata-ovs') + '.local' %}
 {% set HOSTNAME_CFG01 = os_env('HOSTNAME_CFG01', 'cfg01.' + DOMAIN_NAME) %}
@@ -19,7 +25,7 @@
 
     address_pools:
       private-pool01:
-        net: 172.16.10.0/24:24
+        net: {{ os_env('PRIVATE_ADDRESS_POOL01', '10.60.0.0/16:24') }}
         params:
           ip_reserved:
             gateway: +1
@@ -36,7 +42,7 @@
             dhcp: [+90, -10]
 
       admin-pool01:
-        net: 192.168.10.0/24:24
+        net: {{ os_env('ADMIN_ADDRESS_POOL01', '10.70.0.0/16:24') }}
         params:
           ip_reserved:
             gateway: +1
@@ -53,7 +59,7 @@
             dhcp: [+90, -10]
 
       tenant-pool01:
-        net: 10.1.0.0/24:24
+        net: {{ os_env('TENANT_ADDRESS_POOL01', '10.80.0.0/16:24') }}
         params:
           ip_reserved:
             gateway: +1
@@ -70,7 +76,7 @@
             dhcp: [+10, -10]
 
       external-pool01:
-        net: 10.16.0.0/24:24
+        net: {{ os_env('EXTERNAL_ADDRESS_POOL01', '10.90.0.0/16:24') }}
         params:
           ip_reserved:
             gateway: +1
@@ -154,8 +160,8 @@
                   format: raw
                   device: cdrom
                   bus: ide
-                  cloudinit_meta_data: !include virtual-mcp-ocata-ovs--meta-data.yaml
-                  cloudinit_user_data: !include virtual-mcp-ocata-ovs--user-data-cfg01.yaml
+                  cloudinit_meta_data: *cloudinit_meta_data
+                  cloudinit_user_data: *cloudinit_user_data_cfg01
 
               interfaces:
                 - label: ens3
@@ -195,8 +201,8 @@
                   format: raw
                   device: cdrom
                   bus: ide
-                  cloudinit_meta_data: !include virtual-mcp-ocata-ovs--meta-data.yaml
-                  cloudinit_user_data: !include virtual-mcp-ocata-ovs--user-data1604.yaml
+                  cloudinit_meta_data: *cloudinit_meta_data
+                  cloudinit_user_data: *cloudinit_user_data_1604
 
               interfaces: &interfaces
                 - label: ens3
@@ -236,8 +242,8 @@
                   format: raw
                   device: cdrom
                   bus: ide
-                  cloudinit_meta_data: !include virtual-mcp-ocata-ovs--meta-data.yaml
-                  cloudinit_user_data: !include virtual-mcp-ocata-ovs--user-data1604.yaml
+                  cloudinit_meta_data: *cloudinit_meta_data
+                  cloudinit_user_data: *cloudinit_user_data_1604
 
               interfaces: *interfaces
               network_config: *network_config
@@ -265,8 +271,8 @@
                   format: raw
                   device: cdrom
                   bus: ide
-                  cloudinit_meta_data: !include virtual-mcp-ocata-ovs--meta-data.yaml
-                  cloudinit_user_data: !include virtual-mcp-ocata-ovs--user-data1604.yaml
+                  cloudinit_meta_data: *cloudinit_meta_data
+                  cloudinit_user_data: *cloudinit_user_data_1604
 
               interfaces: *interfaces
               network_config: *network_config
@@ -294,8 +300,8 @@
                   format: raw
                   device: cdrom
                   bus: ide
-                  cloudinit_meta_data: !include virtual-mcp-ocata-ovs--meta-data.yaml
-                  cloudinit_user_data: !include virtual-mcp-ocata-ovs--user-data1604.yaml
+                  cloudinit_meta_data: *cloudinit_meta_data
+                  cloudinit_user_data: *cloudinit_user_data_1604
 
               interfaces: *interfaces
               network_config: *network_config
@@ -321,8 +327,8 @@
                   format: raw
                   device: cdrom
                   bus: ide
-                  cloudinit_meta_data: !include virtual-mcp-ocata-ovs--meta-data.yaml
-                  cloudinit_user_data: !include virtual-mcp-ocata-ovs--user-data1604.yaml
+                  cloudinit_meta_data: *cloudinit_meta_data
+                  cloudinit_user_data: *cloudinit_user_data_1604
 
 
               interfaces: &all_interfaces
@@ -372,8 +378,8 @@
                   format: raw
                   device: cdrom
                   bus: ide
-                  cloudinit_meta_data: !include virtual-mcp-ocata-ovs--meta-data.yaml
-                  cloudinit_user_data: !include virtual-mcp-ocata-ovs--user-data1604.yaml
+                  cloudinit_meta_data: *cloudinit_meta_data
+                  cloudinit_user_data: *cloudinit_user_data_1604
 
               interfaces: *all_interfaces
               network_config: *all_network_config
@@ -398,8 +404,8 @@
                   format: raw
                   device: cdrom
                   bus: ide
-                  cloudinit_meta_data: !include virtual-mcp-ocata-ovs--meta-data.yaml
-                  cloudinit_user_data: !include virtual-mcp-ocata-ovs--user-data1604.yaml
+                  cloudinit_meta_data: *cloudinit_meta_data
+                  cloudinit_user_data: *cloudinit_user_data_1604
 
               interfaces: *all_interfaces
               network_config: *all_network_config
diff --git a/tcp_tests/templates/underlay/virtual-mcp11-dvr.yaml b/tcp_tests/templates/underlay/virtual-mcp11-dvr.yaml
index 401cee7..0e72511 100644
--- a/tcp_tests/templates/underlay/virtual-mcp11-dvr.yaml
+++ b/tcp_tests/templates/underlay/virtual-mcp11-dvr.yaml
@@ -134,10 +134,6 @@
 
 
         group_volumes:
-         - name: cloudimage1404    # This name is used for 'backing_store' option for node volumes.
-           source_image: !os_env IMAGE_PATH1404  # https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img or
-                                             # http://apt.tcpcloud.eu/images/ubuntu-14-04-x64-201608231134.qcow2
-           format: qcow2
          - name: cloudimage1604    # This name is used for 'backing_store' option for node volumes.
            source_image: !os_env IMAGE_PATH1604  # https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img or
                                              # http://apt.tcpcloud.eu/images/ubuntu-16-04-x64-201608231004.qcow2
diff --git a/tcp_tests/templates/underlay/virtual-mcp11-ovs-dpdk.yaml b/tcp_tests/templates/underlay/virtual-mcp11-ovs-dpdk.yaml
index 48cd4b0..a9bea42 100644
--- a/tcp_tests/templates/underlay/virtual-mcp11-ovs-dpdk.yaml
+++ b/tcp_tests/templates/underlay/virtual-mcp11-ovs-dpdk.yaml
@@ -134,10 +134,6 @@
 
 
         group_volumes:
-         - name: cloudimage1404    # This name is used for 'backing_store' option for node volumes.
-           source_image: !os_env IMAGE_PATH1404  # https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img or
-                                             # http://apt.tcpcloud.eu/images/ubuntu-14-04-x64-201608231134.qcow2
-           format: qcow2
          - name: cloudimage1604    # This name is used for 'backing_store' option for node volumes.
            source_image: !os_env IMAGE_PATH1604  # https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img or
                                              # http://apt.tcpcloud.eu/images/ubuntu-16-04-x64-201608231004.qcow2
diff --git a/tcp_tests/templates/underlay/virtual-mcp11-ovs.yaml b/tcp_tests/templates/underlay/virtual-mcp11-ovs.yaml
index a9d8601..30ccf90 100644
--- a/tcp_tests/templates/underlay/virtual-mcp11-ovs.yaml
+++ b/tcp_tests/templates/underlay/virtual-mcp11-ovs.yaml
@@ -134,10 +134,6 @@
 
 
         group_volumes:
-         - name: cloudimage1404    # This name is used for 'backing_store' option for node volumes.
-           source_image: !os_env IMAGE_PATH1404  # https://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img or
-                                             # http://apt.tcpcloud.eu/images/ubuntu-14-04-x64-201608231134.qcow2
-           format: qcow2
          - name: cloudimage1604    # This name is used for 'backing_store' option for node volumes.
            source_image: !os_env IMAGE_PATH1604  # https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img or
                                              # http://apt.tcpcloud.eu/images/ubuntu-16-04-x64-201608231004.qcow2
diff --git a/tcp_tests/templates/virtual-mcp-ocata-dvr.jinja b/tcp_tests/templates/virtual-mcp-ocata-dvr.jinja
deleted file mode 100644
index 17a112c..0000000
--- a/tcp_tests/templates/virtual-mcp-ocata-dvr.jinja
+++ /dev/null
@@ -1,2 +0,0 @@
-{% set DOMAIN_NAME = os_env('LAB_CONFIG_NAME', 'virtual-mcp-ocata-dvr') + '.local' %}
-{% set HOSTNAME_CFG01 = os_env('HOSTNAME_CFG01', 'cfg01.' + DOMAIN_NAME) %}
diff --git a/tcp_tests/templates/virtual-mcp-ocata-ovs.jinja b/tcp_tests/templates/virtual-mcp-ocata-ovs.jinja
deleted file mode 100644
index 69aa84c..0000000
--- a/tcp_tests/templates/virtual-mcp-ocata-ovs.jinja
+++ /dev/null
@@ -1,2 +0,0 @@
-{% set DOMAIN_NAME = os_env('LAB_CONFIG_NAME', 'virtual-mcp-ocata-ovs') + '.local' %}
-{% set HOSTNAME_CFG01 = os_env('HOSTNAME_CFG01', 'cfg01.' + DOMAIN_NAME) %}