TripleO Ansible project repository. Contains playbooks for use with TripleO OpenStack deployments.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
tripleo-ansible/tripleo_ansible/roles/tripleo_network_config/templates/2_linux_bonds_vlans/2_linux_bonds_vlans_dpdk.j2

72 lines
2.5 KiB

---
{# This block resolves the minimum viable MTU for interfaces, bonds and #}
{# bridges that carry multiple VLANs. Each VLAN may have different MTU. The #}
{# bridge, bond or interface must have an MTU to allow the VLAN with the #}
{# largest MTU. #}
{% set mtu_list = [] %}
{{ mtu_list.append(lookup('vars', ctlplane_mtu)) }}
{% for network in role_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_subnet_cidr }}
routes: {{ ctlplane_host_routes }}
- type: linux_bond
name: bond_api
mtu: {{ min_viable_mtu }}
use_dhcp: false
bonding_options: {{ bond_interface_ovs_options }}
dns_servers: {{ ctlplane_dns_nameservers }}
domain: {{ dns_search_domains }}
members:
- type: interface
name: nic2
mtu: {{ min_viable_mtu }}
primary: true
- type: interface
name: nic3
mtu: {{ min_viable_mtu }}
{% for network in role_networks if not network.startswith('Tenant') %}
- 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 %}
{# Special config for OVS DPDK #}
- type: ovs_user_bridge
name: br-dpdk0
use_dhcp: false
{% for network in role_networks if network.startswith('Tenant') %}
ovs_extra: "set port br-dpdk0 tag={{ lookup('vars', networks_lower[network] ~ '_vlan_id') }}"
addresses:
- ip_netmask: {{ lookup('vars', networks_lower[network] ~ '_ip') }}/{{ lookup('vars', networks_lower[network] ~ '_cidr')}}
{% if default_route_networks and network in default_route_networks %}
routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') + [{'default': true, 'next_hop': lookup('vars', networks_lower[network] ~ '_gateway_ip')}] }}
{% else %}
routes: {{ lookup('vars', networks_lower[network] ~ '_host_routes') }}
{% endif %}
{%- endfor %}
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