moving virtual labs to new templates && system update

Change-Id: I713b73cbfe1a8f168dfd6dcaf5fd4ec34df47758
diff --git a/classes/cluster/virtual-mcp11-contrail-nfv/infra/config.yml b/classes/cluster/virtual-mcp11-contrail-nfv/infra/config.yml
index 3af2439..62fd211 100755
--- a/classes/cluster/virtual-mcp11-contrail-nfv/infra/config.yml
+++ b/classes/cluster/virtual-mcp11-contrail-nfv/infra/config.yml
@@ -29,10 +29,7 @@
 - system.mysql.client.single
 - system.reclass.storage.system.openstack_control_cluster
 - system.reclass.storage.system.opencontrail_control_cluster
-- system.reclass.storage.system.openstack_compute_multi
-- system.reclass.storage.system.openstack_dashboard_single
-- system.reclass.storage.system.openstack_proxy_single
-- system.reclass.storage.system.stacklight_server_cluster
+- system.reclass.storage.system.stacklightv2_server_cluster
 - cluster.virtual-mcp11-contrail-nfv.openstack.proxy
 - cluster.virtual-mcp11-contrail-nfv.stacklight.proxy
 - cluster.virtual-mcp11-contrail-nfv
@@ -63,8 +60,96 @@
             host: prx
         nginx_proxy_openstack_api_heat_cfn:
           enabled: false
+  salt:
+    master:
+      reactor:
+        reclass/minion/classify:
+        - salt://reclass/reactor/node_register.sls
   reclass:
     storage:
+      class_mapping:
+        common_node:
+          expression: all
+          node_param:
+            single_address:
+              value_template: <<node_control_ip>>
+            linux_system_codename:
+              value_template: <<node_os>>
+            salt_master_host:
+              value_template: <<node_master_ip>>
+        infra_config:
+          expression: <<node_hostname>>__startswith__cfg
+          cluster_param:
+            infra_config_address:
+              value_template: <<node_control_ip>>
+            infra_config_deploy_address:
+              value_template: <<node_deploy_ip>>
+            cluster_domain:
+              value_template: <<node_domain>>
+        openstack_control01:
+          expression: <<node_hostname>>__equals__ctl01
+          cluster_param:
+            openstack_control_node01_address:
+              value_template: <<node_control_ip>>
+        openstack_control02:
+          expression: <<node_hostname>>__equals__ctl02
+          cluster_param:
+            openstack_control_node02_address:
+              value_template: <<node_control_ip>>
+        openstack_control03:
+          expression: <<node_hostname>>__equals__ctl03
+          cluster_param:
+            openstack_control_node03_address:
+              value_template: <<node_control_ip>>
+        opencontrail_control01:
+          expression: <<node_hostname>>__equals__ntw01
+          cluster_param:
+            opencontrail_control_node01_address:
+              value_template: <<node_control_ip>>
+        opencontrail_control02:
+          expression: <<node_hostname>>__equals__ntw02
+          cluster_param:
+            opencontrail_control_node02_address:
+              value_template: <<node_control_ip>>
+        opencontrail_control03:
+          expression: <<node_hostname>>__equals__ntw03
+          cluster_param:
+            opencontrail_control_node03_address:
+              value_template: <<node_control_ip>>  
+        openstack_compute:
+          expression: <<node_hostname>>__startswith__cmp
+          node_class:
+            value_template:
+              - cluster.<<node_cluster>>.openstack.compute
+          node_param:
+            tenant_address:
+              value_template: <<node_tenant_ip>>
+            external_address:
+              value_template: <<node_external_ip>>
+        stacklight_monitor_node01:
+          expression: <<node_hostname>>__equals__mon01
+          cluster_param:
+            stacklight_monitor_node03_address:
+              value_template: <<node_control_ip>>
+        stacklight_monitor_node02:
+          expression: <<node_hostname>>__equals__mon02
+          cluster_param:
+            stacklight_monitor_node03_address:
+              value_template: <<node_control_ip>>
+        stacklight_monitor_node03:
+          expression: <<node_hostname>>__equals__mon03
+          cluster_param:
+            stacklight_monitor_node03_address:
+              value_template: <<node_control_ip>>
+        openstack_dashboard:
+          expression: <<node_hostname>>__startswith__prx
+          node_class:
+            value_template:
+              - cluster.<<node_cluster>>.openstack.dashboard
+              - cluster.<<node_cluster>>.openstack.proxy
+          cluster_param:
+            openstack_proxy_node01_address:
+              value_template: <<node_control_ip>>
       node:
         openstack_control_node01:
           classes:
@@ -84,34 +169,15 @@
           params:
             mysql_cluster_role: slave
             linux_system_codename: xenial
-        openstack_proxy_node01:
-          classes:
-          - cluster.virtual-mcp11-contrail-nfv.openstack.proxy
-          params:
-            linux_system_codename: xenial
         stacklight_server_node01:
           classes:
           - system.influxdb.server.single
           - system.influxdb.database.stacklight
         openstack_compute_node01:
-          name: ${_param:openstack_compute_node01_hostname}
-          domain: ${_param:cluster_domain}
-          classes:
-          - cluster.${_param:cluster_name}.openstack.compute
           params:
-            salt_master_host: ${_param:reclass_config_master}
-            linux_system_codename: ${_param:linux_system_codename}
-            single_address: 172.16.10.105
             compute_vrouter_dpdk_mac_address: 02:9e:de:d3:5b:ce #must be manually changed to mac of ens4
             compute_vrouter_dpdk_pci: "'0000:00:04.0'"
         openstack_compute_node02:
-          name: ${_param:openstack_compute_node02_hostname}
-          domain: ${_param:cluster_domain}
-          classes:
-          - cluster.${_param:cluster_name}.openstack.compute
           params:
-            salt_master_host: ${_param:reclass_config_master}
-            linux_system_codename: ${_param:linux_system_codename}
-            single_address: 172.16.10.106
             compute_vrouter_dpdk_mac_address: 02:de:aa:e6:12:81 #must be manually changed to mac of ens4
             compute_vrouter_dpdk_pci: "'0000:00:04.0'"
\ No newline at end of file
diff --git a/classes/cluster/virtual-mcp11-contrail-nfv/init.yml b/classes/cluster/virtual-mcp11-contrail-nfv/init.yml
index 6749750..d9ffa88 100755
--- a/classes/cluster/virtual-mcp11-contrail-nfv/init.yml
+++ b/classes/cluster/virtual-mcp11-contrail-nfv/init.yml
@@ -15,22 +15,21 @@
     cluster_name: virtual-mcp11-contrail-nfv
 
     # infra service addresses
-    infra_config_address: 172.16.10.100
-
+    infra_config_address: 172.16.10.90
     # openstack service addresses
-    openstack_proxy_address: 172.16.10.121
-    openstack_proxy_node01_address: 172.16.10.121
-
+    openstack_proxy_hostname: prx
+    openstack_proxy_address: ${_param:openstack_proxy_node01_address}
+    openstack_proxy_node01_hostname: prx01
+    openstack_proxy_node01_address: ${_param:infra_config_address}
+    openstack_control_hostname: ctl
+    openstack_control_node01_hostname: ctl01
+    openstack_control_node02_hostname: ctl02
+    openstack_control_node03_hostname: ctl03
     openstack_control_address: 172.16.10.254
-    openstack_control_node01_address: 172.16.10.101
-    openstack_control_node02_address: 172.16.10.102
-    openstack_control_node03_address: 172.16.10.103
-
+    openstack_control_node01_address: 172.16.10.91
+    openstack_control_node02_address: 172.16.10.92
+    openstack_control_node03_address: 172.16.10.93
     openstack_database_address: ${_param:openstack_control_address}
-    openstack_database_node01_address: ${_param:openstack_control_node01_address}
-    openstack_database_node02_address: ${_param:openstack_control_node02_address}
-    openstack_database_node03_address: ${_param:openstack_control_node02_address}
-
     openstack_message_queue_address: ${_param:openstack_control_address}
     openstack_message_queue_node01_address: ${_param:openstack_control_node01_address}
     openstack_message_queue_node02_address: ${_param:openstack_control_node02_address}
@@ -42,23 +41,19 @@
     opencontrail_analytics_node02_address: ${_param:openstack_control_node02_address}
     opencontrail_analytics_node03_address: ${_param:openstack_control_node03_address}
 
-    opencontrail_control_address: 172.16.10.252
-    opencontrail_control_node01_address: 172.16.10.111
-    opencontrail_control_node02_address: 172.16.10.112
-    opencontrail_control_node03_address: 172.16.10.113
+    opencontrail_control_address: ${_param:openstack_control_address}
+    opencontrail_control_node01_address: ${_param:openstack_control_node01_address}
+    opencontrail_control_node02_address: ${_param:openstack_control_node02_address}
+    opencontrail_control_node03_address: ${_param:openstack_control_node03_address}
 
     # stacklight service addresses
     stacklight_monitor_address: 172.16.10.253
     stacklight_monitor_node01_address: 172.16.10.107
     stacklight_monitor_node02_address: 172.16.10.108
     stacklight_monitor_node03_address: 172.16.10.109
-
     stacklight_telemetry_address: ${_param:stacklight_monitor_address}
-    stacklight_telemetry_node01_address: ${_param:stacklight_monitor_node01_address}
     stacklight_log_address: ${_param:stacklight_monitor_address}
-
-    openstack_compute_node01_hostname: cmp01
-    openstack_compute_node02_hostname: cmp02
+    stacklight_telemetry_node01_address: ${_param:stacklight_monitor_node01_address}
 
   linux:
     network:
diff --git a/classes/cluster/virtual-mcp11-contrail-nfv/openstack/compute.yml b/classes/cluster/virtual-mcp11-contrail-nfv/openstack/compute.yml
index 51217c4..f2f7bcd 100755
--- a/classes/cluster/virtual-mcp11-contrail-nfv/openstack/compute.yml
+++ b/classes/cluster/virtual-mcp11-contrail-nfv/openstack/compute.yml
@@ -3,6 +3,7 @@
 - system.linux.system.repo.mcp.openstack
 - system.linux.system.repo.mcp.extra
 - system.linux.system.repo.saltstack.xenial
+- system.linux.network.hosts
 - system.nova.compute.cluster
 - system.opencontrail.compute.cluster
 - system.heka.alarm.openstack_compute
diff --git a/classes/cluster/virtual-mcp11-contrail-nfv/openstack/init.yml b/classes/cluster/virtual-mcp11-contrail-nfv/openstack/init.yml
index 28b0404..dd0e610 100755
--- a/classes/cluster/virtual-mcp11-contrail-nfv/openstack/init.yml
+++ b/classes/cluster/virtual-mcp11-contrail-nfv/openstack/init.yml
@@ -182,16 +182,6 @@
           names:
           - dbs03
           - dbs03.${_param:cluster_domain}
-        cmp01:
-          address: 172.16.10.105
-          names:
-          - cmp01
-          - cmp01.${_param:cluster_domain}
-        cmp02:
-          address: 172.16.10.106
-          names:
-          - cmp02
-          - cmp02.${_param:cluster_domain}
     system:
       user:
         root: