From: Alexandru Avadanii Date: Sun, 22 Apr 2018 00:07:27 +0000 (+0200) Subject: [ha] Fix tenant NIC OS config for VLAN ranges X-Git-Tag: opnfv-6.0.0~10^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F51%2F56251%2F1;p=fuel.git [ha] Fix tenant NIC OS config for VLAN ranges Previous commits added support for tenant VLAN range parametrization, yet failed to accomodate the new VLAN range representation ('M:N') in existing `linux.network.interfaces` reclass configuration. This lead to the silent removal of . from interfaces file and for `br-mesh` to try to use instead of ., conflicting with `br-floating`. Stick to using the first VLAN in the tenant range. JIRA: FUEL-365 Change-Id: I88f7263159f1742dba3b6e36649c9344f2932c5f Signed-off-by: Alexandru Avadanii (cherry picked from commit cfc5988be48d1317244e71fd7919480db18745d4) --- diff --git a/mcp/reclass/classes/cluster/mcp-pike-odl-ha/openstack/compute_pdf.yml.j2 b/mcp/reclass/classes/cluster/mcp-pike-odl-ha/openstack/compute_pdf.yml.j2 index a3a86723f..912537f8f 100644 --- a/mcp/reclass/classes/cluster/mcp-pike-odl-ha/openstack/compute_pdf.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-pike-odl-ha/openstack/compute_pdf.yml.j2 @@ -8,7 +8,8 @@ {%- 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 } %} +{%- set vlan_private_start = nm.vlan_private.rsplit('-')[0] %} +{%- set vlans = { vlan_private_start: nm.cmp001.nic_private } %} --- parameters: linux: @@ -45,4 +46,4 @@ parameters: netmask: 255.255.255.0 mtu: 1500 use_interfaces: - - {{ nm.cmp001.nic_private }}{% if nm.vlan_private | int > 0 %}.{{ nm.vlan_private }}{% endif %} + - {{ nm.cmp001.nic_private }}{% if vlan_private_start | int > 0 %}.{{ vlan_private_start }}{% endif %} diff --git a/mcp/reclass/classes/cluster/mcp-pike-ovn-ha/openstack/compute_pdf.yml.j2 b/mcp/reclass/classes/cluster/mcp-pike-ovn-ha/openstack/compute_pdf.yml.j2 index a3a86723f..912537f8f 100644 --- a/mcp/reclass/classes/cluster/mcp-pike-ovn-ha/openstack/compute_pdf.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-pike-ovn-ha/openstack/compute_pdf.yml.j2 @@ -8,7 +8,8 @@ {%- 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 } %} +{%- set vlan_private_start = nm.vlan_private.rsplit('-')[0] %} +{%- set vlans = { vlan_private_start: nm.cmp001.nic_private } %} --- parameters: linux: @@ -45,4 +46,4 @@ parameters: netmask: 255.255.255.0 mtu: 1500 use_interfaces: - - {{ nm.cmp001.nic_private }}{% if nm.vlan_private | int > 0 %}.{{ nm.vlan_private }}{% endif %} + - {{ nm.cmp001.nic_private }}{% if vlan_private_start | int > 0 %}.{{ vlan_private_start }}{% endif %} diff --git a/mcp/reclass/classes/cluster/mcp-pike-ovs-ha/openstack/compute_pdf.yml.j2 b/mcp/reclass/classes/cluster/mcp-pike-ovs-ha/openstack/compute_pdf.yml.j2 index a3a86723f..912537f8f 100644 --- a/mcp/reclass/classes/cluster/mcp-pike-ovs-ha/openstack/compute_pdf.yml.j2 +++ b/mcp/reclass/classes/cluster/mcp-pike-ovs-ha/openstack/compute_pdf.yml.j2 @@ -8,7 +8,8 @@ {%- 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 } %} +{%- set vlan_private_start = nm.vlan_private.rsplit('-')[0] %} +{%- set vlans = { vlan_private_start: nm.cmp001.nic_private } %} --- parameters: linux: @@ -45,4 +46,4 @@ parameters: netmask: 255.255.255.0 mtu: 1500 use_interfaces: - - {{ nm.cmp001.nic_private }}{% if nm.vlan_private | int > 0 %}.{{ nm.vlan_private }}{% endif %} + - {{ nm.cmp001.nic_private }}{% if vlan_private_start | int > 0 %}.{{ vlan_private_start }}{% endif %}