diff --git a/config/samples/nic-config-samples/bonds_vlans/bonds_vlans.j2 b/config/samples/nic-config-samples/bonds_vlans/bonds_vlans.j2 new file mode 100644 index 000000000..ca64ede87 --- /dev/null +++ b/config/samples/nic-config-samples/bonds_vlans/bonds_vlans.j2 @@ -0,0 +1,39 @@ +--- +{% set mtu_list = [ctlplane_mtu] %} +{% for network in nodeset_networks %} +{{ mtu_list.append(lookup('vars', networks_lower[network] ~ '_mtu')) }} +{%- endfor %} +{% set min_viable_mtu = mtu_list | max %} +network_config: +- type: interface + name: nic1 + mtu: {{ ctlplane_mtu }} + use_dhcp: false + addresses: + - ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_cidr }} + routes: {{ ctlplane_host_routes }} +- type: ovs_bridge + name: {{ neutron_physical_bridge_name }} + dns_servers: {{ ctlplane_dns_nameservers }} + domain: {{ dns_search_domains }} + members: + - type: ovs_bond + name: bond1 + mtu: {{ min_viable_mtu }} + ovs_options: {{ edpm_bond_interface_ovs_options }} + members: + - type: interface + name: nic2 + mtu: {{ min_viable_mtu }} + primary: true + - type: interface + name: nic3 + mtu: {{ min_viable_mtu }} +{% for network in nodeset_networks %} + - type: vlan + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + vlan_id: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }} + addresses: + - ip_netmask: {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }} + routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }} +{% endfor %} diff --git a/config/samples/nic-config-samples/bonds_vlans/bonds_vlans_dpdk.j2 b/config/samples/nic-config-samples/bonds_vlans/bonds_vlans_dpdk.j2 new file mode 100644 index 000000000..12b414282 --- /dev/null +++ b/config/samples/nic-config-samples/bonds_vlans/bonds_vlans_dpdk.j2 @@ -0,0 +1,55 @@ +--- +{% set mtu_list = [ctlplane_mtu] %} +{% for network in nodeset_networks %} +{{ mtu_list.append(lookup('vars', networks_lower[network] ~ '_mtu')) }} +{%- endfor %} +{% set min_viable_mtu = mtu_list | max %} +network_config: +- type: interface + name: nic1 + mtu: {{ ctlplane_mtu }} + use_dhcp: false + addresses: + - ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_cidr }} + routes: {{ ctlplane_host_routes }} +- type: linux_bond + name: bond_api + mtu: {{ min_viable_mtu }} + bonding_options: {{ edpm_bond_interface_ovs_options }} + use_dhcp: false + dns_servers: {{ ctlplane_dns_nameservers }} + members: + - type: interface + name: nic2 + mtu: {{ min_viable_mtu }} + primary: true + - type: interface + name: nic3 + mtu: {{ min_viable_mtu }} +{% for network in nodeset_networks %} +- type: vlan + device: bond_api + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + vlan_id: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }} + addresses: + - ip_netmask: {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }} + routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }} +{% endfor %} +{# Used as a provider network with external DHCP #} +- type: ovs_user_bridge + name: br-dpdk0 + members: + - type: ovs_dpdk_bond + name: dpdkbond0 + rx_queue: {{ num_dpdk_interface_rx_queues }} + members: + - type: ovs_dpdk_port + name: dpdk0 + members: + - type: interface + name: nic4 + - type: ovs_dpdk_port + name: dpdk1 + members: + - type: interface + name: nic5 diff --git a/config/samples/nic-config-samples/bonds_vlans/bonds_vlans_storage.j2 b/config/samples/nic-config-samples/bonds_vlans/bonds_vlans_storage.j2 new file mode 100644 index 000000000..e7f94f423 --- /dev/null +++ b/config/samples/nic-config-samples/bonds_vlans/bonds_vlans_storage.j2 @@ -0,0 +1,39 @@ +--- +{% set mtu_list = [ctlplane_mtu] %} +{% for network in nodeset_networks %} +{{ mtu_list.append(lookup('vars', networks_lower[network] ~ '_mtu')) }} +{%- endfor %} +{% set min_viable_mtu = mtu_list | max %} +network_config: +- type: interface + name: nic1 + mtu: {{ ctlplane_mtu }} + use_dhcp: false + addresses: + - ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_cidr }} + routes: {{ ctlplane_host_routes }} +- type: ovs_bridge + name: br-bond + dns_servers: {{ ctlplane_dns_nameservers }} + domain: {{ dns_search_domains }} + members: + - type: ovs_bond + name: bond1 + mtu: {{ min_viable_mtu }} + ovs_options: {{ edpm_bond_interface_ovs_options }} + members: + - type: interface + name: nic2 + mtu: {{ min_viable_mtu }} + primary: true + - type: interface + name: nic3 + mtu: {{ min_viable_mtu }} +{% for network in nodeset_networks %} + - type: vlan + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + vlan_id: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }} + addresses: + - ip_netmask: {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }} + routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }} +{% endfor %} diff --git a/config/samples/nic-config-samples/bonds_vlans/controller_no_external.j2 b/config/samples/nic-config-samples/bonds_vlans/controller_no_external.j2 new file mode 100644 index 000000000..867ccfda1 --- /dev/null +++ b/config/samples/nic-config-samples/bonds_vlans/controller_no_external.j2 @@ -0,0 +1,39 @@ +--- +{% set mtu_list = [ctlplane_mtu] %} +{% for network in nodeset_networks %} +{{ mtu_list.append(lookup('vars', networks_lower[network] ~ '_mtu')) }} +{%- endfor %} +{% set min_viable_mtu = mtu_list | max %} +network_config: +- type: interface + name: nic1 + mtu: {{ ctlplane_mtu }} + use_dhcp: false + addresses: + - ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_cidr }} + routes: {{ ctlplane_host_routes }} +- type: ovs_bridge + name: {{ neutron_physical_bridge_name }} + dns_servers: {{ ctlplane_dns_nameservers }} + domain: {{ dns_search_domains }} + members: + - type: ovs_bond + name: bond1 + mtu: {{ min_viable_mtu }} + ovs_options: {{ edpm_bond_interface_ovs_options }} + members: + - type: interface + name: nic2 + mtu: {{ min_viable_mtu }} + primary: true + - type: interface + name: nic3 + mtu: {{ min_viable_mtu }} +{% for network in nodeset_networks if network != 'external' %} + - type: vlan + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + vlan_id: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }} + addresses: + - ip_netmask: {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }} + routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }} +{% endfor %} diff --git a/config/samples/nic-config-samples/multiple_nics/multiple_nics.j2 b/config/samples/nic-config-samples/multiple_nics/multiple_nics.j2 new file mode 100644 index 000000000..599a1e4d0 --- /dev/null +++ b/config/samples/nic-config-samples/multiple_nics/multiple_nics.j2 @@ -0,0 +1,43 @@ +--- +network_config: +- type: interface + name: nic1 + mtu: {{ ctlplane_mtu }} + dns_servers: {{ ctlplane_dns_nameservers }} + domain: {{ dns_search_domains }} + routes: {{ ctlplane_host_routes }} + use_dhcp: false + addresses: + - ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_cidr }} +{% for network in nodeset_networks %} +{% if network not in ["external", "tenant"] %} +- type: interface + name: nic{{ loop.index +1 }} + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + use_dhcp: false + addresses: + - ip_netmask: + {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }} + routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }} +{% elif 'external_bridge' in nodeset_tags|default([]) %} +- type: ovs_bridge +{% if network == 'external' %} + name: {{ neutron_physical_bridge_name }} +{% else %} + name: {{ 'br-' ~ networks_lower[network] }} +{% endif %} + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + dns_servers: {{ ctlplane_dns_nameservers }} + use_dhcp: false + addresses: + - ip_netmask: + {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }} + routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }} + members: + - type: interface + name: nic{{loop.index + 1}} + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + use_dhcp: false + primary: true +{% endif %} +{% endfor %} diff --git a/config/samples/nic-config-samples/multiple_nics/multiple_nics_dpdk.j2 b/config/samples/nic-config-samples/multiple_nics/multiple_nics_dpdk.j2 new file mode 100644 index 000000000..d368f1923 --- /dev/null +++ b/config/samples/nic-config-samples/multiple_nics/multiple_nics_dpdk.j2 @@ -0,0 +1,62 @@ +--- +network_config: +- type: interface + name: nic1 + mtu: {{ ctlplane_mtu }} + dns_servers: {{ ctlplane_dns_nameservers }} + domain: {{ dns_search_domains }} + routes: {{ ctlplane_host_routes }} + use_dhcp: false + addresses: + - ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_cidr }} +{% set nics_used = [1] %} +{% for network in nodeset_networks %} +{% if network not in ["external", "tenant"] %} +- type: interface + name: nic{{ loop.index +1 }} + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + use_dhcp: false + addresses: + - ip_netmask: + {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }} + routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }} +{% elif 'external_bridge' in nodeset_tags|default([]) %} +- type: ovs_bridge +{% if network == 'external' %} + name: {{ neutron_physical_bridge_name }} +{% else %} + name: {{ 'br-' ~ networks_lower[network] }} +{% endif %} + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + dns_servers: {{ ctlplane_dns_nameservers }} + use_dhcp: false + addresses: + - ip_netmask: + {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }} + routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }} + members: + - type: interface + name: nic{{loop.index + 1}} + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + use_dhcp: false + primary: true +{% endif %} +{% set _ = nics_used.append(loop.index) %} +{% endfor %} +- type: ovs_user_bridge + name: br-dpdk0 + members: + - type: ovs_dpdk_bond + name: dpdkbond0 + rx_queue: {{ num_dpdk_interface_rx_queues }} + members: + - type: ovs_dpdk_port + name: dpdk0 + members: + - type: interface + name: nic{{nics_used[-1] + 1}} + - type: ovs_dpdk_port + name: dpdk1 + members: + - type: interface + name: nic{{nics_used[-1] + 2}} diff --git a/config/samples/nic-config-samples/multiple_nics/multiple_nics_dvr.j2 b/config/samples/nic-config-samples/multiple_nics/multiple_nics_dvr.j2 new file mode 100644 index 000000000..975e7bddb --- /dev/null +++ b/config/samples/nic-config-samples/multiple_nics/multiple_nics_dvr.j2 @@ -0,0 +1,56 @@ +--- +network_config: +- type: interface + name: nic1 + mtu: {{ ctlplane_mtu }} + dns_servers: {{ ctlplane_dns_nameservers }} + domain: {{ dns_search_domains }} + routes: {{ ctlplane_host_routes }} + use_dhcp: false + addresses: + - ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_cidr }} +{% for network in nodeset_networks %} +{% if network == 'external' %} +- type: ovs_bridge + name: {{ neutron_physical_bridge_name }} + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + dns_servers: {{ ctlplane_dns_nameservers }} + use_dhcp: false +{% else %} + addresses: + - ip_netmask: + {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }} + routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }} +{% endif %} + members: + - type: interface + name: nic{{ loop.index +1 }} + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + primary: true +{% if network not in ["external", "tenant"] %} +- type: interface + name: nic{{ loop.index +1 }} + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + use_dhcp: false + addresses: + - ip_netmask: + {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }} + routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }} +{% elif network == 'tenant' %} +- type: ovs_bridge + name: {{ 'br-' ~ networks_lower[network] }} + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + dns_servers: {{ ctlplane_dns_nameservers }} + use_dhcp: false + addresses: + - ip_netmask: + {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }} + routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }} + members: + - type: interface + name: nic{{loop.index + 1}} + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + use_dhcp: false + primary: true +{% endif %} +{% endfor %} diff --git a/config/samples/nic-config-samples/multiple_nics_vlans/multiple_nics_vlans.j2 b/config/samples/nic-config-samples/multiple_nics_vlans/multiple_nics_vlans.j2 new file mode 100644 index 000000000..98189d790 --- /dev/null +++ b/config/samples/nic-config-samples/multiple_nics_vlans/multiple_nics_vlans.j2 @@ -0,0 +1,50 @@ +--- +network_config: +- type: interface + name: nic1 + mtu: {{ ctlplane_mtu }} + dns_servers: {{ ctlplane_dns_nameservers }} + domain: {{ dns_search_domains }} + routes: {{ ctlplane_host_routes }} + use_dhcp: false + addresses: + - ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_cidr }} +{% for network in nodeset_networks %} +{% if network not in ["external", "tenant"] %} +- type: interface + name: nic{{ loop.index + 1 }} + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + use_dhcp: false +- type: vlan + device: nic{{ loop.index + 1 }} + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + vlan_id: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }} + addresses: + - ip_netmask: + {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }} + routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }} +{% elif 'external_bridge' in nodeset_tags|default([]) %} +- type: ovs_bridge +{% if network == 'external' %} + name: {{ neutron_physical_bridge_name }} +{% else %} + name: {{ 'br-' ~ networks_lower[network] }} +{% endif %} + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + dns_servers: {{ ctlplane_dns_nameservers }} + use_dhcp: false + members: + - type: interface + name: nic{{ loop.index + 1 }} + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + use_dhcp: false + primary: true + - type: vlan + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + vlan_id: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }} + addresses: + - ip_netmask: + {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }} + routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }} +{% endif %} +{% endfor %} diff --git a/config/samples/nic-config-samples/multiple_nics_vlans/multiple_nics_vlans_dpdk.j2 b/config/samples/nic-config-samples/multiple_nics_vlans/multiple_nics_vlans_dpdk.j2 new file mode 100644 index 000000000..48e8f4aba --- /dev/null +++ b/config/samples/nic-config-samples/multiple_nics_vlans/multiple_nics_vlans_dpdk.j2 @@ -0,0 +1,69 @@ +--- +network_config: +- type: interface + name: nic1 + mtu: {{ ctlplane_mtu }} + dns_servers: {{ ctlplane_dns_nameservers }} + domain: {{ dns_search_domains }} + routes: {{ ctlplane_host_routes }} + use_dhcp: false + addresses: + - ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_cidr }} +{% set nics_used = [1] %} +{% for network in nodeset_networks %} +{% if network not in ["external", "tenant"] %} +- type: interface + name: nic{{ loop.index + 1 }} + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + use_dhcp: false +- type: vlan + device: nic{{ loop.index + 1 }} + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + vlan_id: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }} + addresses: + - ip_netmask: + {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }} + routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }} +{% elif 'external_bridge' in nodeset_tags|default([]) %} +- type: ovs_bridge +{% if network == 'external' %} + name: {{ neutron_physical_bridge_name }} +{% else %} + name: {{ 'br-' ~ networks_lower[network] }} +{% endif %} + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + dns_servers: {{ ctlplane_dns_nameservers }} + use_dhcp: false + members: + - type: interface + name: nic{{ loop.index + 1 }} + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + use_dhcp: false + primary: true + - type: vlan + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + vlan_id: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }} + addresses: + - ip_netmask: + {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }} + routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }} +{% endif %} +{% set _ = nics_used.append(loop.index) %} +{% endfor %} +- type: ovs_user_bridge + name: br-dpdk0 + members: + - type: ovs_dpdk_bond + name: dpdkbond0 + rx_queue: {{ num_dpdk_interface_rx_queues }} + members: + - type: ovs_dpdk_port + name: dpdk0 + members: + - type: interface + name: nic{{nics_used[-1] + 1}} + - type: ovs_dpdk_port + name: dpdk1 + members: + - type: interface + name: nic{{nics_used[-1] + 2}} diff --git a/config/samples/nic-config-samples/multiple_nics_vlans/multiple_nics_vlans_dvr.j2 b/config/samples/nic-config-samples/multiple_nics_vlans/multiple_nics_vlans_dvr.j2 new file mode 100644 index 000000000..f4e27c406 --- /dev/null +++ b/config/samples/nic-config-samples/multiple_nics_vlans/multiple_nics_vlans_dvr.j2 @@ -0,0 +1,66 @@ +--- +network_config: +- type: interface + name: nic1 + mtu: {{ ctlplane_mtu }} + dns_servers: {{ ctlplane_dns_nameservers }} + domain: {{ dns_search_domains }} + routes: {{ ctlplane_host_routes }} + use_dhcp: false + addresses: + - ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_cidr }} +{% for network in nodeset_networks %} +{% if network == 'external' %} +- type: ovs_bridge + name: {{ neutron_physical_bridge_name }} + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + dns_servers: {{ ctlplane_dns_nameservers }} + use_dhcp: false + members: + - type: interface + name: nic{{ loop.index + 1 }} + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + primary: true +{% else %} + - type: vlan + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + vlan_id: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }} + addresses: + - ip_netmask: + {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }} + routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }} +{% endif %} +{% if network not in ["external", "tenant"] %} +- type: interface + name: nic{{ loop.index + 1 }} + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + use_dhcp: false +- type: vlan + device: nic{{ loop.index + 1 }} + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + vlan_id: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }} + addresses: + - ip_netmask: + {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }} + routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }} +{% elif network == 'tenant' and network in nodeset_networks %} +- type: ovs_bridge + name: {{ 'br-' ~ networks_lower[network] }} + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + dns_servers: {{ ctlplane_dns_nameservers }} + use_dhcp: false + members: + - type: interface + name: nic{{ loop.index + 1 }} + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + use_dhcp: false + primary: true + - type: vlan + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + vlan_id: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }} + addresses: + - ip_netmask: + {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }} + routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }} +{% endif %} +{% endfor %} diff --git a/config/samples/nic-config-samples/single_nic_vlans/controller_no_external.j2 b/config/samples/nic-config-samples/single_nic_vlans/controller_no_external.j2 new file mode 100644 index 000000000..51639be76 --- /dev/null +++ b/config/samples/nic-config-samples/single_nic_vlans/controller_no_external.j2 @@ -0,0 +1,31 @@ +--- +{% set mtu_list = [ctlplane_mtu] %} +{% for network in nodeset_networks %} +{{ mtu_list.append(lookup('vars', networks_lower[network] ~ '_mtu')) }} +{%- endfor %} +{% set min_viable_mtu = mtu_list | max %} +network_config: +- type: ovs_bridge + name: {{ neutron_physical_bridge_name }} + mtu: {{ min_viable_mtu }} + use_dhcp: false + dns_servers: {{ ctlplane_dns_nameservers }} + domain: {{ dns_search_domains }} + addresses: + - ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_cidr }} + routes: {{ ctlplane_host_routes }} + members: + - type: interface + name: nic1 + mtu: {{ min_viable_mtu }} + # force the MAC address of the bridge to this interface + primary: true +{% for network in nodeset_networks if network != 'external' %} + - type: vlan + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + vlan_id: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }} + addresses: + - ip_netmask: + {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }} + routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }} +{% endfor %} diff --git a/config/samples/nic-config-samples/single_nic_vlans/single_nic_vlans.j2 b/config/samples/nic-config-samples/single_nic_vlans/single_nic_vlans.j2 new file mode 100644 index 000000000..9fb986c1e --- /dev/null +++ b/config/samples/nic-config-samples/single_nic_vlans/single_nic_vlans.j2 @@ -0,0 +1,31 @@ +--- +{% set mtu_list = [ctlplane_mtu] %} +{% for network in nodeset_networks %} +{{ mtu_list.append(lookup('vars', networks_lower[network] ~ '_mtu')) }} +{%- endfor %} +{% set min_viable_mtu = mtu_list | max %} +network_config: +- type: ovs_bridge + name: {{ neutron_physical_bridge_name }} + mtu: {{ min_viable_mtu }} + use_dhcp: false + dns_servers: {{ ctlplane_dns_nameservers }} + domain: {{ dns_search_domains }} + addresses: + - ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_cidr }} + routes: {{ ctlplane_host_routes }} + members: + - type: interface + name: nic1 + mtu: {{ min_viable_mtu }} + # force the MAC address of the bridge to this interface + primary: true +{% for network in nodeset_networks %} + - type: vlan + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + vlan_id: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }} + addresses: + - ip_netmask: + {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }} + routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }} +{% endfor %} diff --git a/config/samples/nic-config-samples/single_nic_vlans/single_nic_vlans_bgp.j2 b/config/samples/nic-config-samples/single_nic_vlans/single_nic_vlans_bgp.j2 new file mode 100644 index 000000000..c9b7738e2 --- /dev/null +++ b/config/samples/nic-config-samples/single_nic_vlans/single_nic_vlans_bgp.j2 @@ -0,0 +1,29 @@ +--- +{% set mtu_list = [ctlplane_mtu] %} +{% for network in nodeset_networks %} +{{ mtu_list.append(lookup('vars', networks_lower[network] ~ '_mtu')) }} +{%- endfor %} +{% set min_viable_mtu = mtu_list | max %} +network_config: +- type: interface + name: nic1 + mtu: {{ ctlplane_mtu }} + dns_servers: {{ ctlplane_dns_nameservers }} + domain: {{ dns_search_domains }} + routes: {{ ctlplane_host_routes }} + use_dhcp: false + addresses: + - ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_cidr }} +{% for network in nodeset_networks %} +- type: vlan + device: nic1 + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + vlan_id: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }} + addresses: + - ip_netmask: + {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }} + routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }} +{% endfor %} +- type: ovs_bridge + name: {{ neutron_physical_bridge_name }} + use_dhcp: false diff --git a/config/samples/nic-config-samples/single_nic_vlans/single_nic_vlans_bgp_ovn.j2 b/config/samples/nic-config-samples/single_nic_vlans/single_nic_vlans_bgp_ovn.j2 new file mode 100644 index 000000000..340e74de5 --- /dev/null +++ b/config/samples/nic-config-samples/single_nic_vlans/single_nic_vlans_bgp_ovn.j2 @@ -0,0 +1,57 @@ +--- +{% set mtu_list = [ctlplane_mtu] %} +{% for network in nodeset_networks %} +{{ mtu_list.append(lookup('vars', networks_lower[network] ~ '_mtu')) }} +{%- endfor %} +{% set min_viable_mtu = mtu_list | max %} +network_config: +- type: interface + name: nic1 + mtu: {{ ctlplane_mtu }} + dns_servers: {{ ctlplane_dns_nameservers }} + domain: {{ dns_search_domains }} + use_dhcp: false + addresses: + - ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_cidr }} +{% for network in nodeset_networks %} +- type: vlan + device: nic1 + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + vlan_id: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }} + addresses: + - ip_netmask: + {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }} + routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }} +{% endfor %} +- type: ovs_bridge + name: br-provider + use_dhcp: false +- type: ovs_bridge + name: {{ neutron_physical_bridge_name }} + mtu: {{ min_viable_mtu }} + use_dhcp: false + addresses: + - ip_netmask: {{ lookup('vars', 'bgp_net1_ip') }}/30 + members: + - type: interface + name: nic2 + mtu: {{ min_viable_mtu }} + # force the MAC address of the bridge to this interface + primary: true +- type: ovs_bridge + name: {{ neutron_physical_bridge_name }}-2 + mtu: {{ min_viable_mtu }} + use_dhcp: false + addresses: + - ip_netmask: {{ lookup('vars', 'bgp_net2_ip') }}/30 + members: + - type: interface + name: nic3 + mtu: {{ min_viable_mtu }} + # force the MAC address of the bridge to this interface + primary: true +- type: interface + name: lo + addresses: + - ip_netmask: {{ lookup('vars', 'bgp_main_net_ip') }}/32 + - ip_netmask: {{ lookup('vars', 'bgp_main_net6_ip') }}/128 diff --git a/config/samples/nic-config-samples/single_nic_vlans/single_nic_vlans_storage.j2 b/config/samples/nic-config-samples/single_nic_vlans/single_nic_vlans_storage.j2 new file mode 100644 index 000000000..3bff994c5 --- /dev/null +++ b/config/samples/nic-config-samples/single_nic_vlans/single_nic_vlans_storage.j2 @@ -0,0 +1,31 @@ +--- +{% set mtu_list = [ctlplane_mtu] %} +{% for network in nodeset_networks %} +{{ mtu_list.append(lookup('vars', networks_lower[network] ~ '_mtu')) }} +{%- endfor %} +{% set min_viable_mtu = mtu_list | max %} +network_config: +- type: ovs_bridge + name: br-storage + mtu: {{ min_viable_mtu }} + use_dhcp: false + dns_servers: {{ ctlplane_dns_nameservers }} + domain: {{ dns_search_domains }} + addresses: + - ip_netmask: {{ ctlplane_ip }}/{{ ctlplane_cidr }} + routes: {{ ctlplane_host_routes }} + members: + - type: interface + name: nic1 + mtu: {{ min_viable_mtu }} + # force the MAC address of the bridge to this interface + primary: true +{% for network in nodeset_networks %} + - type: vlan + mtu: {{ lookup('vars', networks_lower[network] ~ '_mtu') }} + vlan_id: {{ lookup('vars', networks_lower[network] ~ '_vlan_id') }} + addresses: + - ip_netmask: + {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr') }} + routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }} +{% endfor %}