Fix MNAIO Flat Networking

In order to get flat networking working correctly we need to create
a new veth pair that neutron can use on the host machines.  Neutron can
take the veth end of this pair for the brq bridge while the other end
remains in br-flat allowing communication back to the VM.  This also
expands the DHCP range for the veth pairs and changes the
host_bind_override to use the new veth.

Change-Id: I9cd161599ba659890142143d4718420d680d7dca
This commit is contained in:
d34dh0r53 2018-05-17 14:19:17 -05:00
parent ebf309a9e7
commit f856f3bfaf
5 changed files with 22 additions and 4 deletions

View File

@ -9,6 +9,8 @@ authoritative;
shared-network all-networks {
{% for dhcp in dhcp_list %}
subnet {{ dhcp.subnet }} netmask {{ dhcp.netmask }} {
range {{ dhcp.range_start }} {{ dhcp.range_end }};
option broadcast-address {{ dhcp.broadcast }};
option routers {{ dhcp.gateway }};
option domain-name-servers {{ dhcp.dns }};
option subnet-mask {{ dhcp.netmask }};

View File

@ -16,10 +16,13 @@ dhcp_max_lease_time: 43200 # Max lease time
ipxe_boot_file: "boot.ipxe" # Path of initial iPXE bootloader
# - List of DHCP Subnets - These are iterated though and each will be created
dhcp_list:
- netmask: 255.255.255.0 # Netmask
- netmask: 255.255.252.0 # Netmask
gateway: 10.0.2.1 # Gateway
dns: 8.8.8.8 # DNS
subnet: 10.0.2.0 # Subnet mask
subnet: 10.0.0.0 # Subnet mask
range_start: 10.0.2.160 # Start of DHCP range
range_end: 10.0.3.254 # End of DHCP range
broadcast: 10.0.3.255 # Network Broadcast address
default_lease_time: 21600 # Subnet Default lease time - The default is used if this is not defined
max_lease_time: 43200 # Subnet Max lease time - The default is used if this is not defined
ipxe_boot_file: "boot.ipxe" # Path of initial iPXE bootloader to boot from first

View File

@ -65,3 +65,6 @@ mnaio_host_iptables_prerouting_ports:
- host_port: 6082
vm_port: 6082
vm_ip: "{{ hostvars[groups['loadbalancer_hosts'][0]]['server_vm_fixed_addr'] }}"
- host_port: 8443
vm_port: 8443
vm_ip: "{{ hostvars[groups['loadbalancer_hosts'][0]]['server_vm_fixed_addr'] }}"

View File

@ -42,7 +42,7 @@ global_overrides:
container_bridge: "br-flat"
container_type: "veth"
container_interface: "eth12"
host_bind_override: "eth2"
host_bind_override: "veth2"
type: "flat"
net_name: "flat"
group_binds:

View File

@ -15,8 +15,18 @@ iface br-{{ key }} inet {{ value.inet_type }}
bridge_stp off
bridge_waitport 10
bridge_fd 0
bridge_ports {{ value.iface | default('none') }}
offload-sg off
{% if value.iface is defined %}
pre-up ip link add br-veth-{{ key }} type veth peer name v{{ value.iface }} || true
# Set both ends UP
pre-up ip link set br-veth-{{ key }} up
pre-up ip link set v{{ value.iface }} up
# Delete veth pair on DOWN
post-down ip link del br-vlan-veth || true
bridge_ports {{ value.iface }} br-veth-{{ key }}
{% else %}
bridge_ports none
{% endif %}
{% if value.address is defined %}
address {{ value.address }}
{% endif %}