[virtual] PDF-based network defs for cluster nodes 69/51269/12
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Sat, 27 Jan 2018 22:59:50 +0000 (23:59 +0100)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Mon, 5 Feb 2018 05:03:35 +0000 (06:03 +0100)
Decouple virtual cluster nodes (ctl, gtw etc.) from opnfv_fn_* vars
in favor of parsing PDF/IDF.
This is the first step towards unifying baremetal and virtual network
definition templates, as well as allowing virtual nodes to run on a
remote hypervisor (and eventually with a different arch).

opnfv_fn_* vars will still be used for infra VMs spawned on FN (cfg01
and optionally mas01).

Adopt new 'net_map.j2' from Pharos submodule for new templates (virt),
as well as old ones (baremetal).

JIRA: FUEL-322

Change-Id: I150c2416566bbe42ea11cd00f12a8a7bf96776c2
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
16 files changed:
.gitignore
mcp/reclass/classes/cluster/all-mcp-arch-common/infra/config_dpdk_pdf.yml.j2
mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/infra/kvm_pdf.yml.j2
mcp/reclass/classes/cluster/baremetal-mcp-pike-common-ha/openstack_compute_pdf.yml.j2
mcp/reclass/classes/cluster/baremetal-mcp-pike-odl-ha/openstack/compute_pdf.yml.j2
mcp/reclass/classes/cluster/baremetal-mcp-pike-ovs-dpdk-ha/openstack/compute_pdf.yml.j2
mcp/reclass/classes/cluster/baremetal-mcp-pike-ovs-ha/openstack/compute_pdf.yml.j2
mcp/reclass/classes/cluster/virtual-mcp-pike-common-noha/openstack_compute.yml
mcp/reclass/classes/cluster/virtual-mcp-pike-common-noha/openstack_compute_pdf.yml.j2 [new file with mode: 0644]
mcp/reclass/classes/cluster/virtual-mcp-pike-common-noha/openstack_control.yml
mcp/reclass/classes/cluster/virtual-mcp-pike-common-noha/openstack_control_pdf.yml.j2 [new file with mode: 0644]
mcp/reclass/classes/cluster/virtual-mcp-pike-common-noha/openstack_gateway.yml
mcp/reclass/classes/cluster/virtual-mcp-pike-common-noha/openstack_gateway_pdf.yml.j2 [new file with mode: 0644]
mcp/reclass/classes/cluster/virtual-mcp-pike-odl-noha/opendaylight/control.yml
mcp/reclass/classes/cluster/virtual-mcp-pike-odl-noha/opendaylight/control_pdf.yml.j2 [new file with mode: 0644]
mcp/scripts/lib.sh

index 0b00d55..49939c1 100644 (file)
@@ -14,3 +14,4 @@
 **/mcp/scripts/user-data.sh
 **/mcp/scripts/virsh_net/*.xml
 **/mcp/scripts/*.img
+**/net_map.j2
index 062e8a4..54b2b55 100644 (file)
@@ -5,19 +5,7 @@
 # which accompanies this distribution, and is available at
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
-{%- if conf.idf is defined and conf.idf.net_config is defined -%}
-    {#- NOTE: Currently, we assume all cluster nodes use the same mapping -#}
-
-    {#- Determine interface index for each network (plumbing vars) -#}
-    {%- set idx_private = conf['idf']['net_config']['private']['interface'] -%}
-
-    {#- Physical interface OS name for each network (e.g. em1, enp1s0f1) -#}
-    {%- set node = conf['idf']['fuel']['network']['node'][0] -%}
-    {%- set nic_private = node['interfaces'][idx_private] -%}
-
-    {#- PCI addresses (only for DPDK on private) -#}
-    {%- set bus_private = node['busaddr'][idx_private] -%}
-{%- endif -%}
+{%- import 'net_map.j2' as nm with context %}
 ---
 parameters:
   reclass:
@@ -25,9 +13,9 @@ parameters:
       node:
         openstack_compute_node01:
           params:
-            dpdk0_name: {{ nic_private }}
-            dpdk0_pci: '"{{ bus_private }}"'
+            dpdk0_name: {{ nm.cmp001.nic_private }}
+            dpdk0_pci: '"{{ nm.cmp001.bus_private }}"'
         openstack_compute_node02:
           params:
-            dpdk0_name: {{ nic_private }}
-            dpdk0_pci: '"{{ bus_private }}"'
+            dpdk0_name: {{ nm.cmp001.nic_private }}
+            dpdk0_pci: '"{{ nm.cmp001.bus_private }}"'
index 0aab6cb..0d86a08 100644 (file)
@@ -1,49 +1,15 @@
 ##############################################################################
-# Copyright (c) 2017 Mirantis Inc., Enea AB and others.
+# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Apache License, Version 2.0
 # which accompanies this distribution, and is available at
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
-{# NOTE: br-{mgmt,ctl} are cross-referenced, careful when changing names #}
-{%- if conf.idf is defined and conf.idf.net_config is defined -%}
-    {#- NOTE: Currently, we assume all cluster nodes use the same mapping -#}
-
-    {#- Determine interface index for each network (plumbing vars) -#}
-    {%- set idx_admin = conf['idf']['net_config']['admin']['interface'] -%}
-    {%- set idx_mgmt = conf['idf']['net_config']['mgmt']['interface'] -%}
-    {%- set idx_private = conf['idf']['net_config']['private']['interface'] -%}
-    {%- set idx_public = conf['idf']['net_config']['public']['interface'] -%}
-
-    {#- Physical interface OS name for each network (e.g. em1, enp1s0f1) -#}
-    {%- set node = conf['idf']['fuel']['network']['node'][0] -%}
-    {%- set nic_admin = node['interfaces'][idx_admin] -%}
-    {%- set nic_mgmt = node['interfaces'][idx_mgmt] -%}
-    {%- set nic_private = node['interfaces'][idx_private] -%}
-    {%- set nic_public = node['interfaces'][idx_public] -%}
-
-    {#- PCI addresses (only for DPDK on private) -#}
-    {%- set bus_private = node['busaddr'][idx_private] -%}
-
-    {#- VLAN for each network (only untagged 'admin' is supported by MaaS config!) -#}
-    {%- set vlan_admin = conf['idf']['net_config']['admin']['vlan'] -%}
-    {%- set vlan_mgmt = conf['idf']['net_config']['mgmt']['vlan'] -%}
-    {%- set vlan_private = conf['idf']['net_config']['private']['vlan'] -%}
-    {%- set vlan_public = conf['idf']['net_config']['public']['vlan'] -%}
-{%- else -%}
-    {%- set nic_admin = 'enp6s0' -%}
-    {%- set nic_mgmt = 'enp6s0' -%}
-    {%- set nic_private = None -%}
-    {%- set nic_public = None -%}
-    {%- set vlan_admin = 'native' -%}
-    {%- set vlan_mgmt = '300' -%}
-    {%- set vlan_private = '1000' -%}
-{%- endif -%}
-
-{#- Filter-out NIC duplicates by constructing a dict (used NICs only) -#}
-{%- set nics = { nic_admin: True, nic_mgmt: True, nic_public: True } -%}
-
-{%- set vlans = { vlan_admin: nic_admin, vlan_mgmt: nic_mgmt, vlan_public: nic_public } -%}
+{#- NOTE: br-{mgmt,ctl} are cross-referenced, careful when changing names #}
+{%- import 'net_map.j2' as nm with context %}
+{#- Filter-out NIC duplicates by constructing a dict (used NICs only) #}
+{%- set nics = { nm.ctl01.nic_admin: True, nm.ctl01.nic_mgmt: True, nm.ctl01.nic_public: True } %}
+{%- set vlans = { nm.vlan_admin: nm.ctl01.nic_admin, nm.vlan_mgmt: nm.ctl01.nic_mgmt, nm.vlan_public: nm.ctl01.nic_public } %}
 ---
 parameters:
   linux:
@@ -77,7 +43,7 @@ parameters:
           proto: dhcp
           type: bridge
           use_interfaces:
-            - {{ nic_admin }}{% if vlan_admin and vlan_admin != 'native' %}.{{ vlan_admin }}{% endif %}
+            - {{ nm.ctl01.nic_admin }}{% if nm.vlan_admin and nm.vlan_admin != 'native' %}.{{ nm.vlan_admin }}{% endif %}
           noifupdown: true
         br-ctl:
           enabled: true
@@ -86,7 +52,7 @@ parameters:
           address: ${_param:single_address}
           netmask: 255.255.255.0
           use_interfaces:
-            - {{ nic_mgmt }}{% if vlan_mgmt and vlan_mgmt != 'native' %}.{{ vlan_mgmt }}{% endif %}
+            - {{ nm.ctl01.nic_mgmt }}{% if nm.vlan_mgmt and nm.vlan_mgmt != 'native' %}.{{ nm.vlan_mgmt }}{% endif %}
         br-ex:
           enabled: true
           proto: manual
@@ -94,5 +60,5 @@ parameters:
           netmask: ${_param:opnfv_net_public_mask}
           type: bridge
           use_interfaces:
-            - {{ nic_public }}{% if vlan_public and vlan_public != 'native' %}.{{ vlan_public }}{% endif %}
+            - {{ nm.ctl01.nic_public }}{% if nm.vlan_public and nm.vlan_public != 'native' %}.{{ nm.vlan_public }}{% endif %}
           noifupdown: true
index 2e94669..ed9ddd6 100644 (file)
@@ -1,46 +1,15 @@
 ##############################################################################
-# Copyright (c) 2017 Mirantis Inc., Enea AB and others.
+# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Apache License, Version 2.0
 # which accompanies this distribution, and is available at
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
-{# NOTE: br-{mgmt,ctl} are cross-referenced, careful when changing names #}
-{%- if conf.idf is defined and conf.idf.net_config is defined -%}
-    {#- NOTE: Currently, we assume all cluster nodes use the same mapping -#}
-
-    {#- Determine interface index for each network (plumbing vars) -#}
-    {%- set idx_admin = conf['idf']['net_config']['admin']['interface'] -%}
-    {%- set idx_mgmt = conf['idf']['net_config']['mgmt']['interface'] -%}
-    {%- set idx_private = conf['idf']['net_config']['private']['interface'] -%}
-    {%- set idx_public = conf['idf']['net_config']['public']['interface'] -%}
-
-    {#- Physical interface OS name for each network (e.g. em1, enp1s0f1) -#}
-    {%- set iface_names = conf['idf']['fuel']['network']['node'][3]['interfaces'] -%}
-    {%- set nic_admin = iface_names[idx_admin] -%}
-    {%- set nic_mgmt = iface_names[idx_mgmt] -%}
-    {%- set nic_private = iface_names[idx_private] -%}
-    {%- set nic_public = iface_names[idx_public] -%}
-
-    {#- VLAN for each network (only untagged 'admin' is supported by MaaS config!) -#}
-    {%- set vlan_admin = conf['idf']['net_config']['admin']['vlan'] -%}
-    {%- set vlan_mgmt = conf['idf']['net_config']['mgmt']['vlan'] -%}
-    {%- set vlan_private = conf['idf']['net_config']['private']['vlan'] -%}
-    {%- set vlan_public = conf['idf']['net_config']['public']['vlan'] -%}
-{%- else -%}
-    {%- set nic_admin = 'enp6s0' -%}
-    {%- set nic_mgmt = 'enp6s0' -%}
-    {%- set nic_private = None -%}
-    {%- set nic_public = None -%}
-    {%- set vlan_admin = 'native' -%}
-    {%- set vlan_mgmt = '300' -%}
-    {%- set vlan_private = '1000' -%}
-{%- endif -%}
-
-{#- Filter-out NIC duplicates by constructing a dict (used NICs only) -#}
-{%- set nics = { nic_admin: True, nic_mgmt: True } -%}
-
-{%- set vlans = { vlan_admin: nic_admin, vlan_mgmt: nic_mgmt } -%}
+{#- NOTE: br-{mgmt,ctl} are cross-referenced, careful when changing names #}
+{%- import 'net_map.j2' as nm with context %}
+{#- Filter-out NIC duplicates by constructing a dict (used NICs only) #}
+{%- set nics = { nm.cmp001.nic_admin: True, nm.cmp001.nic_mgmt: True } %}
+{%- set vlans = { nm.vlan_admin: nm.cmp001.nic_admin, nm.vlan_mgmt: nm.cmp001.nic_mgmt } %}
 ---
 parameters:
   linux:
@@ -48,7 +17,7 @@ parameters:
       bridge: openvswitch
       interface:
 {%- for nic in nics %}
-    {%- if nic == nic_admin %}
+    {%- if nic == nm.cmp001.nic_admin %}
         {{ nic }}:
           enabled: true
           type: eth
@@ -60,7 +29,7 @@ parameters:
           type: eth
           proto: manual
           address: 0.0.0.0
-          {%- if nic == nic_public %}
+          {%- if nic == nm.cmp001.nic_public %}
           netmask: ${_param:opnfv_net_public_mask}
           {%- else %}
           netmask: 255.255.255.0
@@ -89,7 +58,7 @@ parameters:
           address: ${_param:single_address}
           netmask: 255.255.255.0
           use_interfaces:
-            - {{ nic_mgmt }}{% if vlan_mgmt and vlan_mgmt != 'native' %}.{{ vlan_mgmt }}{% endif %}
+            - {{ nm.cmp001.nic_mgmt }}{% if nm.vlan_mgmt and nm.vlan_mgmt != 'native' %}.{{ nm.vlan_mgmt }}{% endif %}
         br-floating:
           enabled: true
           type: ovs_bridge
@@ -99,8 +68,8 @@ parameters:
           type: ovs_port
           bridge: br-floating
           proto: static
-          {%- if vlan_public and vlan_public != 'native' %}
-          ovs_options: tag={{ vlan_public }}
+          {%- if nm.vlan_public and nm.vlan_public != 'native' %}
+          ovs_options: tag={{ nm.vlan_public }}
           {%- endif %}
           address: ${_param:external_address}
           netmask: 255.255.255.0
@@ -109,7 +78,7 @@ parameters:
               address: 0.0.0.0
               netmask: 0.0.0.0
               gateway: ${_param:opnfv_net_public_gw}
-        {{ nic_public }}:
+        {{ nm.cmp001.nic_public }}:
           enabled: true
           proto: manual
           ovs_port_type: OVSPort
index f371c1d..4e0f7d1 100644 (file)
@@ -1,49 +1,14 @@
 ##############################################################################
-# Copyright (c) 2017 Mirantis Inc., Enea AB and others.
+# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Apache License, Version 2.0
 # which accompanies this distribution, and is available at
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
-{# NOTE: br-{mgmt,ctl} are cross-referenced, careful when changing names #}
-{%- if conf.idf is defined and conf.idf.net_config is defined -%}
-    {#- NOTE: Currently, we assume all cluster nodes use the same mapping -#}
-
-    {#- Determine interface index for each network (plumbing vars) -#}
-    {%- set idx_admin = conf['idf']['net_config']['admin']['interface'] -%}
-    {%- set idx_mgmt = conf['idf']['net_config']['mgmt']['interface'] -%}
-    {%- set idx_private = conf['idf']['net_config']['private']['interface'] -%}
-    {%- set idx_public = conf['idf']['net_config']['public']['interface'] -%}
-
-    {#- Physical interface OS name for each network (e.g. em1, enp1s0f1) -#}
-    {%- set node = conf['idf']['fuel']['network']['node'][3] -%}
-    {%- set nic_admin = node['interfaces'][idx_admin] -%}
-    {%- set nic_mgmt = node['interfaces'][idx_mgmt] -%}
-    {%- set nic_private = node['interfaces'][idx_private] -%}
-    {%- set nic_public = node['interfaces'][idx_public] -%}
-
-    {#- PCI addresses (only for DPDK on private) -#}
-    {%- set bus_private = node['busaddr'][idx_private] -%}
-
-    {#- VLAN for each network (only untagged 'admin' is supported by MaaS config!) -#}
-    {%- set vlan_admin = conf['idf']['net_config']['admin']['vlan'] -%}
-    {%- set vlan_mgmt = conf['idf']['net_config']['mgmt']['vlan'] -%}
-    {%- set vlan_private = conf['idf']['net_config']['private']['vlan'] -%}
-    {%- set vlan_public = conf['idf']['net_config']['public']['vlan'] -%}
-{%- else -%}
-    {%- set nic_admin = 'enp6s0' -%}
-    {%- set nic_mgmt = 'enp6s0' -%}
-    {%- set nic_private = None -%}
-    {%- set nic_public = None -%}
-    {%- set vlan_admin = 'native' -%}
-    {%- set vlan_mgmt = '300' -%}
-    {%- set vlan_private = '1000' -%}
-{%- endif -%}
-
-{#- Filter-out NIC duplicates by constructing a dict (used NICs only) -#}
-{%- set nics = { nic_private: True } -%}
-
-{%- set vlans = { vlan_private: nic_private } -%}
+{%- import 'net_map.j2' as nm with context %}
+{#- Filter-out NIC duplicates by constructing a dict (used NICs only) #}
+{%- set nics = { nm.cmp001.nic_private: True } %}
+{%- set vlans = { nm.vlan_private: nm.cmp001.nic_private } %}
 ---
 parameters:
   linux:
@@ -53,7 +18,7 @@ parameters:
         {{ nic }}:
           enabled: true
           type: eth
-    {%- if nic == nic_admin %}
+    {%- if nic == nm.cmp001.nic_admin %}
           proto: dhcp
     {%- else %}
           proto: manual
@@ -80,4 +45,4 @@ parameters:
           netmask: 255.255.255.0
           mtu: 1500
           use_interfaces:
-            - {{ nic_private }}{% if vlan_private and vlan_private != 'native' %}.{{ vlan_private }}{% endif %}
+            - {{ nm.cmp001.nic_private }}{% if nm.vlan_private and nm.vlan_private != 'native' %}.{{ nm.vlan_private }}{% endif %}
index faa4558..475f3a0 100644 (file)
@@ -5,11 +5,7 @@
 # which accompanies this distribution, and is available at
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
-{%- if conf.idf is defined and conf.idf.net_config is defined -%}
-    {%- set vlan_private = conf['idf']['net_config']['private']['vlan'] -%}
-{%- else -%}
-    {%- set vlan_private = '1000' -%}
-{%- endif -%}
+{%- import 'net_map.j2' as nm with context %}
 ---
 parameters:
   linux:
@@ -28,6 +24,6 @@ parameters:
           type: dpdk_ovs_bridge
           address: ${_param:tenant_address}
           netmask: 255.255.255.0
-          {%- if vlan_private and vlan_private != 'native' %}
-          tag: {{ vlan_private }}
+          {%- if nm.vlan_private and nm.vlan_private != 'native' %}
+          tag: {{ nm.vlan_private }}
           {%- endif %}
index f371c1d..4e0f7d1 100644 (file)
@@ -1,49 +1,14 @@
 ##############################################################################
-# Copyright (c) 2017 Mirantis Inc., Enea AB and others.
+# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Apache License, Version 2.0
 # which accompanies this distribution, and is available at
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
-{# NOTE: br-{mgmt,ctl} are cross-referenced, careful when changing names #}
-{%- if conf.idf is defined and conf.idf.net_config is defined -%}
-    {#- NOTE: Currently, we assume all cluster nodes use the same mapping -#}
-
-    {#- Determine interface index for each network (plumbing vars) -#}
-    {%- set idx_admin = conf['idf']['net_config']['admin']['interface'] -%}
-    {%- set idx_mgmt = conf['idf']['net_config']['mgmt']['interface'] -%}
-    {%- set idx_private = conf['idf']['net_config']['private']['interface'] -%}
-    {%- set idx_public = conf['idf']['net_config']['public']['interface'] -%}
-
-    {#- Physical interface OS name for each network (e.g. em1, enp1s0f1) -#}
-    {%- set node = conf['idf']['fuel']['network']['node'][3] -%}
-    {%- set nic_admin = node['interfaces'][idx_admin] -%}
-    {%- set nic_mgmt = node['interfaces'][idx_mgmt] -%}
-    {%- set nic_private = node['interfaces'][idx_private] -%}
-    {%- set nic_public = node['interfaces'][idx_public] -%}
-
-    {#- PCI addresses (only for DPDK on private) -#}
-    {%- set bus_private = node['busaddr'][idx_private] -%}
-
-    {#- VLAN for each network (only untagged 'admin' is supported by MaaS config!) -#}
-    {%- set vlan_admin = conf['idf']['net_config']['admin']['vlan'] -%}
-    {%- set vlan_mgmt = conf['idf']['net_config']['mgmt']['vlan'] -%}
-    {%- set vlan_private = conf['idf']['net_config']['private']['vlan'] -%}
-    {%- set vlan_public = conf['idf']['net_config']['public']['vlan'] -%}
-{%- else -%}
-    {%- set nic_admin = 'enp6s0' -%}
-    {%- set nic_mgmt = 'enp6s0' -%}
-    {%- set nic_private = None -%}
-    {%- set nic_public = None -%}
-    {%- set vlan_admin = 'native' -%}
-    {%- set vlan_mgmt = '300' -%}
-    {%- set vlan_private = '1000' -%}
-{%- endif -%}
-
-{#- Filter-out NIC duplicates by constructing a dict (used NICs only) -#}
-{%- set nics = { nic_private: True } -%}
-
-{%- set vlans = { vlan_private: nic_private } -%}
+{%- import 'net_map.j2' as nm with context %}
+{#- Filter-out NIC duplicates by constructing a dict (used NICs only) #}
+{%- set nics = { nm.cmp001.nic_private: True } %}
+{%- set vlans = { nm.vlan_private: nm.cmp001.nic_private } %}
 ---
 parameters:
   linux:
@@ -53,7 +18,7 @@ parameters:
         {{ nic }}:
           enabled: true
           type: eth
-    {%- if nic == nic_admin %}
+    {%- if nic == nm.cmp001.nic_admin %}
           proto: dhcp
     {%- else %}
           proto: manual
@@ -80,4 +45,4 @@ parameters:
           netmask: 255.255.255.0
           mtu: 1500
           use_interfaces:
-            - {{ nic_private }}{% if vlan_private and vlan_private != 'native' %}.{{ vlan_private }}{% endif %}
+            - {{ nm.cmp001.nic_private }}{% if nm.vlan_private and nm.vlan_private != 'native' %}.{{ nm.vlan_private }}{% endif %}
index da933dc..0f89d50 100644 (file)
@@ -1,5 +1,5 @@
 ##############################################################################
-# Copyright (c) 2017 Mirantis Inc., Enea AB and others.
+# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Apache License, Version 2.0
 # which accompanies this distribution, and is available at
@@ -15,11 +15,9 @@ classes:
   - system.ceilometer.agent.cluster
   - system.ceilometer.client.nova_compute
   - system.ceilometer.client.cinder_volume
+  - cluster.virtual-mcp-pike-common-noha.openstack_compute_pdf
 parameters:
   _param:
-    primary_interface: ${_param:opnfv_fn_vm_secondary_interface}
-    tenant_interface: ${_param:opnfv_fn_vm_tertiary_interface}
-    external_interface: ${_param:opnfv_fn_vm_quaternary_interface}
     interface_mtu: 9000
     linux_system_codename: xenial
     loopback_device_size: 20
@@ -65,31 +63,3 @@ parameters:
         sysctl:
           vm.dirty_ratio: 10
           vm.dirty_background_ratio: 5
-    network:
-      bridge: openvswitch
-      interface:
-        dhcp_int:
-          enabled: true
-          name: ${_param:opnfv_fn_vm_primary_interface}
-          proto: dhcp
-          type: eth
-          mtu: ${_param:interface_mtu}
-        primary_interface:
-          enabled: true
-          name: ${_param:primary_interface}
-          proto: manual
-          type: eth
-        tenant_interface:
-          enabled: true
-          name: ${_param:tenant_interface}
-          mtu: ${_param:interface_mtu}
-          proto: manual
-          type: eth
-        br-mgmt:
-          enabled: true
-          type: bridge
-          proto: static
-          address: ${_param:single_address}
-          netmask: 255.255.255.0
-          use_interfaces:
-            - ${_param:primary_interface}
diff --git a/mcp/reclass/classes/cluster/virtual-mcp-pike-common-noha/openstack_compute_pdf.yml.j2 b/mcp/reclass/classes/cluster/virtual-mcp-pike-common-noha/openstack_compute_pdf.yml.j2
new file mode 100644 (file)
index 0000000..64af148
--- /dev/null
@@ -0,0 +1,44 @@
+##############################################################################
+# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+{#- NOTE: br-{mgmt,ctl} are cross-referenced, careful when changing names #}
+{%- import 'net_map.j2' as nm with context %}
+---
+parameters:
+  _param:
+    primary_interface: {{ nm.cmp001.nic_mgmt }}
+    tenant_interface: {{ nm.cmp001.nic_private }}
+    external_interface: {{ nm.cmp001.nic_public }}
+  linux:
+    network:
+      bridge: openvswitch
+      interface:
+        dhcp_int:
+          enabled: true
+          name: {{ nm.cmp001.nic_admin }}
+          proto: dhcp
+          type: eth
+          mtu: ${_param:interface_mtu}
+        primary_interface:
+          enabled: true
+          name: ${_param:primary_interface}
+          proto: manual
+          type: eth
+        tenant_interface:
+          enabled: true
+          name: ${_param:tenant_interface}
+          mtu: ${_param:interface_mtu}
+          proto: manual
+          type: eth
+        br-mgmt:
+          enabled: true
+          type: bridge
+          proto: static
+          address: ${_param:single_address}
+          netmask: 255.255.255.0
+          use_interfaces:
+            - ${_param:primary_interface}
index 9defb00..30e880f 100644 (file)
@@ -44,6 +44,7 @@ classes:
   - system.horizon.server.single
   - service.haproxy.proxy.single
   - cluster.virtual-mcp-pike-common-noha.haproxy_openstack_api
+  - cluster.virtual-mcp-pike-common-noha.openstack_control_pdf
 parameters:
   _param:
     linux_system_codename: xenial
@@ -52,27 +53,6 @@ parameters:
       package:
         python-msgpack:
           version: latest
-    network:
-      interface:
-        dhcp_int:
-          enabled: true
-          name: ${_param:opnfv_fn_vm_primary_interface}
-          proto: dhcp
-          type: eth
-        single_int:
-          enabled: true
-          name: ${_param:opnfv_fn_vm_secondary_interface}
-          type: eth
-          proto: static
-          address: ${_param:single_address}
-          netmask: 255.255.255.0
-        public_int:
-          enabled: true
-          name: ${_param:opnfv_fn_vm_quaternary_interface}
-          type: eth
-          proto: static
-          address: ${_param:cluster_public_host}
-          netmask: 255.255.255.0
   keystone:
     server:
       admin_email: ${_param:admin_email}
diff --git a/mcp/reclass/classes/cluster/virtual-mcp-pike-common-noha/openstack_control_pdf.yml.j2 b/mcp/reclass/classes/cluster/virtual-mcp-pike-common-noha/openstack_control_pdf.yml.j2
new file mode 100644 (file)
index 0000000..8219637
--- /dev/null
@@ -0,0 +1,32 @@
+##############################################################################
+# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+{%- import 'net_map.j2' as nm with context %}
+---
+parameters:
+  linux:
+    network:
+      interface:
+        dhcp_int:
+          enabled: true
+          name: {{ nm.ctl01.nic_admin }}
+          proto: dhcp
+          type: eth
+        single_int:
+          enabled: true
+          name: {{ nm.ctl01.nic_mgmt }}
+          type: eth
+          proto: static
+          address: ${_param:single_address}
+          netmask: 255.255.255.0
+        public_int:
+          enabled: true
+          name: {{ nm.ctl01.nic_public }}
+          type: eth
+          proto: static
+          address: ${_param:cluster_public_host}
+          netmask: 255.255.255.0
index 9822de7..6c10bf8 100644 (file)
@@ -1,16 +1,15 @@
 ##############################################################################
-# Copyright (c) 2017 Mirantis Inc., Enea AB and others.
+# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Apache License, Version 2.0
 # which accompanies this distribution, and is available at
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
 ---
+classes:
+  - cluster.virtual-mcp-pike-common-noha.openstack_gateway_pdf
 parameters:
   _param:
-    primary_interface: ${_param:opnfv_fn_vm_secondary_interface}
-    tenant_interface: ${_param:opnfv_fn_vm_tertiary_interface}
-    external_interface: ${_param:opnfv_fn_vm_quaternary_interface}
     interface_mtu: 9000
     linux_system_codename: xenial
   neutron:
@@ -18,59 +17,3 @@ parameters:
       notification: true
       agent_mode: ${_param:neutron_gateway_agent_mode}
       vlan_aware_vms: true
-  linux:
-    network:
-      bridge: openvswitch
-      interface:
-        dhcp_int:
-          enabled: true
-          name: ${_param:opnfv_fn_vm_primary_interface}
-          proto: dhcp
-          type: eth
-          mtu: ${_param:interface_mtu}
-        primary_interface:
-          enabled: true
-          name: ${_param:primary_interface}
-          mtu: ${_param:interface_mtu}
-          proto: manual
-          type: eth
-        tenant_interface:
-          enabled: true
-          name: ${_param:tenant_interface}
-          mtu: ${_param:interface_mtu}
-          proto: manual
-          type: eth
-        external_interface:
-          enabled: true
-          name: ${_param:external_interface}
-          mtu: ${_param:interface_mtu}
-          proto: manual
-          type: eth
-        br-floating:
-          enabled: true
-          type: ovs_bridge
-          mtu: ${_param:interface_mtu}
-        br-mgmt:
-          enabled: true
-          type: bridge
-          proto: static
-          address: ${_param:single_address}
-          netmask: 255.255.255.0
-          mtu: ${_param:interface_mtu}
-          use_interfaces:
-            - ${_param:primary_interface}
-        float-to-ex:
-          enabled: true
-          type: ovs_port
-          mtu: ${_param:interface_mtu}
-          bridge: br-floating
-        br-ex:
-          enabled: true
-          type: bridge
-          mtu: ${_param:interface_mtu}
-          address: ${_param:external_address}
-          netmask: 255.255.255.0
-          use_interfaces:
-            - ${_param:external_interface}
-          use_ovs_ports:
-            - float-to-ex
diff --git a/mcp/reclass/classes/cluster/virtual-mcp-pike-common-noha/openstack_gateway_pdf.yml.j2 b/mcp/reclass/classes/cluster/virtual-mcp-pike-common-noha/openstack_gateway_pdf.yml.j2
new file mode 100644 (file)
index 0000000..7067d59
--- /dev/null
@@ -0,0 +1,70 @@
+##############################################################################
+# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+---
+{%- import 'net_map.j2' as nm with context %}
+parameters:
+  _param:
+    primary_interface: {{ nm.ctl01.nic_mgmt }}
+    tenant_interface: {{ nm.ctl01.nic_private }}
+    external_interface: {{ nm.ctl01.nic_public }}
+  linux:
+    network:
+      bridge: openvswitch
+      interface:
+        dhcp_int:
+          enabled: true
+          name: {{ nm.ctl01.nic_admin }}
+          proto: dhcp
+          type: eth
+          mtu: ${_param:interface_mtu}
+        primary_interface:
+          enabled: true
+          name: ${_param:primary_interface}
+          mtu: ${_param:interface_mtu}
+          proto: manual
+          type: eth
+        tenant_interface:
+          enabled: true
+          name: ${_param:tenant_interface}
+          mtu: ${_param:interface_mtu}
+          proto: manual
+          type: eth
+        external_interface:
+          enabled: true
+          name: ${_param:external_interface}
+          mtu: ${_param:interface_mtu}
+          proto: manual
+          type: eth
+        br-floating:
+          enabled: true
+          type: ovs_bridge
+          mtu: ${_param:interface_mtu}
+        br-mgmt:
+          enabled: true
+          type: bridge
+          proto: static
+          address: ${_param:single_address}
+          netmask: 255.255.255.0
+          mtu: ${_param:interface_mtu}
+          use_interfaces:
+            - ${_param:primary_interface}
+        float-to-ex:
+          enabled: true
+          type: ovs_port
+          mtu: ${_param:interface_mtu}
+          bridge: br-floating
+        br-ex:
+          enabled: true
+          type: bridge
+          mtu: ${_param:interface_mtu}
+          address: ${_param:external_address}
+          netmask: 255.255.255.0
+          use_interfaces:
+            - ${_param:external_interface}
+          use_ovs_ports:
+            - float-to-ex
index f4404a6..b53af0f 100644 (file)
@@ -1,5 +1,5 @@
 ##############################################################################
-# Copyright (c) 2017 Mirantis Inc., Enea AB and others.
+# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Apache License, Version 2.0
 # which accompanies this distribution, and is available at
@@ -11,19 +11,10 @@ classes:
   - system.linux.system.repo.mcp.extra
   - system.opendaylight.server.single
   - cluster.virtual-mcp-pike-odl-noha
+  - cluster.virtual-mcp-pike-odl-noha.opendaylight.control_pdf
 parameters:
   _param:
     linux_system_codename: xenial
-  linux:
-    network:
-      interface:
-        single_int:
-          enabled: true
-          name: ${_param:opnfv_fn_vm_secondary_interface}
-          type: eth
-          proto: static
-          address: ${_param:single_address}
-          netmask: 255.255.255.0
   opendaylight:
     server:
       odl_bind_ip: ${_param:single_address}
diff --git a/mcp/reclass/classes/cluster/virtual-mcp-pike-odl-noha/opendaylight/control_pdf.yml.j2 b/mcp/reclass/classes/cluster/virtual-mcp-pike-odl-noha/opendaylight/control_pdf.yml.j2
new file mode 100644 (file)
index 0000000..74f9288
--- /dev/null
@@ -0,0 +1,20 @@
+##############################################################################
+# Copyright (c) 2018 Mirantis Inc., Enea AB and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+{%- import 'net_map.j2' as nm with context %}
+---
+parameters:
+  linux:
+    network:
+      interface:
+        single_int:
+          enabled: true
+          name: {{ nm.ctl01.nic_mgmt }}
+          type: eth
+          proto: static
+          address: ${_param:single_address}
+          netmask: 255.255.255.0
index 6f3c438..cc65f9e 100644 (file)
@@ -490,6 +490,7 @@ function do_templates() {
   RECLASS_CLUSTER_DIR=$(cd "${git_repo_root}/mcp/reclass/classes/cluster"; pwd)
   PHAROS_GEN_CFG="./pharos/config/utils/generate_config.py"
   PHAROS_INSTALLER_ADAPTER="./pharos/config/installers/fuel/pod_config.yml.j2"
+  PHAROS_INSTALLER_NETMAP="$(dirname "${PHAROS_INSTALLER_ADAPTER}")/net_map.j2"
   BASE_CONFIG_PDF="${lab_config_uri}/labs/${target_lab}/${target_pod}.yaml"
   BASE_CONFIG_IDF="${lab_config_uri}/labs/${target_lab}/idf-${target_pod}.yaml"
   LOCAL_PDF="${image_dir}/$(basename "${BASE_CONFIG_PDF}")"
@@ -522,8 +523,10 @@ function do_templates() {
   # shellcheck disable=SC2086
   find ${template_dirs} -name '*.j2' | while read -r tp; do
     # Jinja2 import does not allow '..' directory traversal
+    ln -sf "$(readlink -f "${PHAROS_INSTALLER_NETMAP}")" "$(dirname "${tp}")"
     if ! "${PHAROS_GEN_CFG}" -y "${LOCAL_PDF}" -j "${tp}" > "${tp%.j2}"; then
       notify_e "[ERROR] ${template_err_str}"
     fi
+    rm -f "$(dirname "${tp}")/$(basename "${PHAROS_INSTALLER_NETMAP}")"
   done
 }