Fix interface configuration for nova gate
The nova 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: Ia156b8e69f3cbc3806fe4380af38fed15d48b6ed
This commit is contained in:
parent
0bad22d604
commit
c7a9a1c3c3
@ -30,7 +30,7 @@ container_networks:
|
||||
type: "veth"
|
||||
vlan_address:
|
||||
bridge: "br-vlan"
|
||||
interface: "eth3"
|
||||
interface: "eth12"
|
||||
netmask: null
|
||||
type: "veth"
|
||||
physical_host: localhost
|
||||
|
@ -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"
|
||||
|
@ -15,5 +15,5 @@
|
||||
|
||||
neutron_provider_networks:
|
||||
network_types: "vxlan,flat"
|
||||
network_mappings: "flat:eth3"
|
||||
network_mappings: "flat:eth12"
|
||||
network_vxlan_ranges: "1:1000"
|
||||
|
58
tests/test-nova-interfaces.cfg.j2
Normal file
58
tests/test-nova-interfaces.cfg.j2
Normal 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
|
@ -40,30 +40,47 @@
|
||||
- { 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-nova-interfaces.cfg.j2
|
||||
dest: /etc/network/interfaces.d/nova_interfaces.cfg
|
||||
register: nova_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: nova_interfaces | changed
|
||||
with_items:
|
||||
- br-mgmt
|
||||
- br-vlan
|
||||
- br-vxlan
|
||||
tags:
|
||||
- networking-interfaces-stop
|
||||
|
||||
- name: Start the network interfaces
|
||||
command: "ifup {{ item }}"
|
||||
when: nova_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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user