diff options
Diffstat (limited to 'config/installers')
-rw-r--r-- | config/installers/fuel/net_macros.j2 | 21 | ||||
-rw-r--r-- | config/installers/fuel/net_map.j2 | 2 | ||||
-rw-r--r-- | config/installers/fuel/pod_config.yml.j2 | 5 |
3 files changed, 22 insertions, 6 deletions
diff --git a/config/installers/fuel/net_macros.j2 b/config/installers/fuel/net_macros.j2 index b9693d11..c0a5d329 100644 --- a/config/installers/fuel/net_macros.j2 +++ b/config/installers/fuel/net_macros.j2 @@ -5,24 +5,25 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -{%- macro linux_network_interfaces_nic(nics) -%} +{%- macro linux_network_interfaces_nic(nics, proto = 'manual') -%} {%- for nic in nics %} {{ nic }}: enabled: true type: eth - proto: manual + proto: {{ proto }} mtu: ${_param:interface_mtu} name: {{ nic }} noifupdown: true {%- endfor %} {%- endmacro -%} -{%- macro linux_network_interfaces_vlan(vlans) -%} +{%- macro linux_network_interfaces_vlan(vlans, proto = 'manual') -%} {%- for vlan in vlans %} {%- if vlan | int > 0 %} {{ vlans[vlan] }}.{{ vlan }}: enabled: true - proto: manual + proto: {{ proto }} + mtu: ${_param:interface_mtu} type: vlan name: {{ vlans[vlan] }}.{{ vlan }} use_interfaces: @@ -34,3 +35,15 @@ {%- macro interface_str(nic, vlan = 0) -%} {{ nic }}{% if vlan | int > 0 %}.{{ vlan }}{% endif %} {%- endmacro -%} + +{%- macro vpp_interface_str(speed, pci_addr, driver = '') -%} + {%- set p = pci_addr.replace('.', ':').split(':') -%} + {%- set s = 'Ethernet%d/%d/%d' | format(p[-3] | int(0, 16), + p[-2] | int(0, 16), + p[-1] | int(0, 16)) -%} + {%- if 'vfio' in driver -%} + VirtualFunction{{ s }} + {%- else -%} + {% if '40g' in speed %}Forty{% elif '10g' in speed %}Ten{% endif %}Gigabit{{ s }} + {%- endif -%} +{%- endmacro -%} diff --git a/config/installers/fuel/net_map.j2 b/config/installers/fuel/net_map.j2 index 8a0e58d1..bc1ac789 100644 --- a/config/installers/fuel/net_map.j2 +++ b/config/installers/fuel/net_map.j2 @@ -36,6 +36,7 @@ {#- Physical interface OS name for each network (e.g. em1, enp1s0f1) #} {%- for role in [ctl01, cmp001] %} + {%- if role.idx < conf.nodes | length %} {%- set node = conf.idf.fuel.network.node[role.idx] %} {%- do role.update({ 'nic_mcp': node.interfaces[idx_mcp], @@ -45,6 +46,7 @@ 'nic_public': node.interfaces[idx_public], 'bus_private': node.busaddr[idx_private]}) %} {#- PCI addresses are only used on computes for DPDK on private net #} + {%- endif %} {%- endfor %} {%- set net_admin = [net.admin.network, net.admin.mask] | join("/") %} diff --git a/config/installers/fuel/pod_config.yml.j2 b/config/installers/fuel/pod_config.yml.j2 index edb63eec..657bc2c1 100644 --- a/config/installers/fuel/pod_config.yml.j2 +++ b/config/installers/fuel/pod_config.yml.j2 @@ -13,9 +13,10 @@ parameters: region: machines: {%- set ctl_roles = 3 if 'virtual' not in conf else conf.virtual.nodes.control | length %} + {%- set has_cmp = True if 'virtual' not in conf else 'compute' in conf.virtual.nodes %} {%- for node in conf.nodes %} {%- if (node.node.type == 'baremetal' and ( - loop.index > nm.cmp001.idx or loop.index0 < ctl_roles)) %} + (has_cmp and loop.index > nm.cmp001.idx) or loop.index0 < ctl_roles)) %} {%- if loop.index > nm.cmp001.idx %} cmp{{ '%03d' | format(loop.index - nm.cmp001.idx) }}: {%- elif 'virtual' not in conf %} {#- strictly for Pharos verify job #} @@ -31,7 +32,7 @@ parameters: power_type: {{ node.remote_management.type }} power_user: {{ node.remote_management.user }} architecture: {{ node.node.arch | dpkg_arch }}/generic - distro_series: xenial + distro_series: bionic hwe_kernel: ${_param:hwe_kernel} {%- if loop.index > nm.cmp001.idx %} disk_layout: |