Merge "Change to set the container network MTU"

This commit is contained in:
Jenkins 2015-07-24 17:55:29 +00:00 committed by Gerrit Code Review
commit 1171ccb5b7
3 changed files with 16 additions and 2 deletions

View File

@ -147,6 +147,9 @@
# Name of mechanism that connects interfaces in containers to the bridge
# on target hosts for this network. Typically 'veth'.
#
# Option: container_mtu (optional, string)
# Sets the MTU within LXC for a given network type.
#
# Option: ip_from_q (optional, string)
# Name of network in 'cidr_networks' level to use for IP address pool. Only
# valid for 'raw' and 'vxlan' types.
@ -226,6 +229,7 @@
# container_bridge: "br-storage"
# container_type: "veth"
# container_interface: "eth2"
# container_mtu: "9000"
# ip_from_q: "storage"
# - network:
# group_binds:
@ -233,6 +237,7 @@
# container_bridge: "br-vxlan"
# container_type: "veth"
# container_interface: "eth10"
# container_mtu: "9000"
# ip_from_q: "tunnel"
# type: "vxlan"
# range: "1:1000"

View File

@ -456,8 +456,9 @@ def _load_optional_q(config, cidr_name):
def _add_additional_networks(key, inventory, ip_q, q_name, netmask, interface,
bridge, net_type, user_config, is_ssh_address,
is_container_address, static_routes):
bridge, net_type, net_mtu, user_config,
is_ssh_address, is_container_address,
static_routes):
"""Process additional ip adds and append then to hosts as needed.
If the host is found to be "is_metal" it will be marked as "on_metal"
@ -492,6 +493,9 @@ def _add_additional_networks(key, inventory, ip_q, q_name, netmask, interface,
if net_type:
_network['type'] = net_type
if net_mtu:
_network['mtu'] = net_mtu
return _network
def return_netmask():
@ -519,6 +523,7 @@ def _add_additional_networks(key, inventory, ip_q, q_name, netmask, interface,
interface,
bridge,
net_type,
net_mtu,
user_config,
is_ssh_address,
is_container_address,
@ -694,6 +699,7 @@ def container_skel_load(container_skel, inventory, config):
interface=p_net['container_interface'],
bridge=p_net['container_bridge'],
net_type=p_net.get('container_type'),
net_mtu=p_net.get('container_mtu'),
user_config=config,
is_ssh_address=p_net.get('is_ssh_address'),
is_container_address=p_net.get('is_container_address'),

View File

@ -10,3 +10,6 @@ lxc.network.link = {{ item.value.bridge }}
lxc.network.hwaddr = 00:16:3e:xx:xx:xx
# enable the device on boot
lxc.network.flags = up
# Set the container network MTU
lxc.network.mtu = {{ item.value.mtu|default('1500') }}