Fix interface configuration for tempest gate

The tempest gate is failing due to tempest being unable to boot
instances. This is due to the veth peer not being setup correctly, and
the linuxbridge configuration being incorrect

This PR fixes the veth peer and and the neutron configuration
options.

Change-Id: Iaffb5f95ab59918feb5e498bbdc6a6325abaa4d4
This commit is contained in:
Andy McCrae 2016-08-12 11:51:05 -05:00 committed by Jesse Pretorius (odyssey4me)
parent 11eb27bffc
commit a467fcf9dc
5 changed files with 103 additions and 27 deletions

View File

@ -30,7 +30,7 @@ container_networks:
type: "veth"
vlan_address:
bridge: "br-vlan"
interface: "eth3"
interface: "eth12"
netmask: null
type: "veth"
physical_host: localhost

View File

@ -15,5 +15,5 @@
neutron_provider_networks:
network_types: "vxlan,flat"
network_mappings: "flat:br-vlan"
network_mappings: "flat:eth12"
network_vxlan_ranges: "1:1000"

View File

@ -15,5 +15,5 @@
neutron_provider_networks:
network_types: "vxlan,flat"
network_mappings: "flat:eth3"
network_mappings: "flat:eth12"
network_vxlan_ranges: "1:1000"

View File

@ -40,30 +40,48 @@
- { src: '/etc/pip.conf', dest: '/etc/pip.conf' }
when: nodepool.stat.exists | bool
post_tasks:
# The elegant solution: change the bridge everywhere to replicate the standard behaviour
- name: Register list of bridges
command: /sbin/brctl show
register: bridge_list
- name: Create br-mgmt bridge
command: /sbin/brctl addbr br-mgmt
when:
- not bridge_list.stdout | search("br-mgmt")
- name: IP br-mgmt
command: /sbin/ifconfig br-mgmt 10.100.102.1 netmask 255.255.255.0
- name: Create br-vxlan bridge
command: /sbin/brctl addbr br-vxlan
when:
- not bridge_list.stdout | search("br-vxlan")
- name: IP br-vxlan
command: /sbin/ifconfig br-vxlan 10.100.101.1 netmask 255.255.255.0
- name: Create br-vlan bridge
command: /sbin/brctl addbr br-vlan
when:
- not bridge_list.stdout | search("br-vlan")
- name: IP br-vlan
command: /sbin/ifconfig br-vlan 10.1.13.1 netmask 255.255.255.0
- name: Add iptables rule to ensure ssh checksum is correct
command: /sbin/iptables -A POSTROUTING -t mangle -p tcp --dport 22 -j CHECKSUM --checksum-fill
- name: Ensure that /etc/network/interfaces.d/ exists
file:
path: /etc/network/interfaces.d/
state: directory
tags:
- networking-dir-create
- name: Copy network configuration
template:
src: test-tempest-interfaces.cfg.j2
dest: /etc/network/interfaces.d/tempest_interfaces.cfg
register: tempest_interfaces
tags:
- networking-interfaces-file
- name: Ensure our interfaces.d configuration files are loaded automatically
lineinfile:
dest: /etc/network/interfaces
line: "source /etc/network/interfaces.d/*.cfg"
tags:
- networking-interfaces-load
- name: Shut down the network interfaces
command: "ifdown {{ item }}"
when: tempest_interfaces | changed
with_items:
- br-mgmt
- br-vlan
- br-vxlan
tags:
- networking-interfaces-stop
- name: Start the network interfaces
command: "ifup {{ item }}"
when: tempest_interfaces | changed
with_items:
- br-mgmt
- br-vlan
- br-vxlan
tags:
- networking-interfaces-start
- name: Add iptables rules for lxc natting
command: /usr/local/bin/lxc-system-manage iptables-create
roles:

View File

@ -0,0 +1,58 @@
## The default networking requires several bridges. These bridges were named to be informative
## however they can be named what ever you like and is adaptable to any network infrastructure
## environment. This file serves as an example of how to setup basic networking and was ONLY
## built for the purpose of being an example and used expressly in the building of an ALL IN
## ONE development environment.
auto br-mgmt
iface br-mgmt inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
# Notice the bridge port is the vlan tagged interface
bridge_ports none
address 10.100.102.1
netmask 255.255.255.0
offload-sg off
auto br-vxlan
iface br-vxlan inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
bridge_ports none
address 10.100.101.1
netmask 255.255.255.0
offload-sg off
# To ensure ssh checksum is correct
up /sbin/iptables -A POSTROUTING -t mangle -p tcp --dport 22 -j CHECKSUM --checksum-fill
down /sbin/iptables -D POSTROUTING -t mangle -p tcp --dport 22 -j CHECKSUM --checksum-fill
# To provide internet connectivity to instances
up /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
down /sbin/iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
auto br-vlan
iface br-vlan inet static
bridge_stp off
bridge_waitport 0
bridge_fd 0
address 10.1.13.200
netmask 255.255.254.0
offload-sg off
# Create veth pair, don't bomb if already exists
pre-up ip link add br-vlan-veth type veth peer name eth12 || true
# Set both ends UP
pre-up ip link set br-vlan-veth up
pre-up ip link set eth12 up
# Delete veth pair on DOWN
post-down ip link del br-vlan-veth || true
bridge_ports br-vlan-veth
# Add an additional address to br-vlan
iface br-vlan inet static
# Flat network default gateway
# -- This needs to exist somewhere for network reachability
# -- from the router namespace for floating IP paths.
# -- Putting this here is primarily for tempest to work.
address 10.1.13.1
netmask 255.255.255.0