[jacekn,r=james-page,t=james-page] Add option to support configuration of instance MTU.
This commit is contained in:
commit
fcc2f15d3c
23
README.md
23
README.md
@ -49,6 +49,14 @@ The gateway provides two key services; L3 network routing and DHCP services.
|
||||
|
||||
These are both required in a fully functional Neutron Openstack deployment.
|
||||
|
||||
See upstream [Neutron multi extnet](http://docs.openstack.org/trunk/config-reference/content/adv_cfg_l3_agent_multi_extnet.html)
|
||||
|
||||
Configuration Options
|
||||
---------------------
|
||||
|
||||
Multiple Floating Pools
|
||||
=======================
|
||||
|
||||
If multiple floating pools are needed then an L3 agent (which corresponds to
|
||||
a quantum-gateway for the sake of this charm) is needed for each one. Each
|
||||
gateway needs to be deployed as a seperate service so that the external
|
||||
@ -70,7 +78,20 @@ network id can be set differently for each gateway e.g.
|
||||
juju set quantum-gateway-extnet1 "external-network-id=<extnet1 id>"
|
||||
juju set quantum-gateway-extnet2 "external-network-id=<extnet2 id>"
|
||||
|
||||
See upstream [Neutron multi extnet](http://docs.openstack.org/trunk/config-reference/content/adv_cfg_l3_agent_multi_extnet.html)
|
||||
Instance MTU
|
||||
============
|
||||
|
||||
When using Open vSwitch plugin with GRE tunnels default MTU of 1500 can cause
|
||||
packet fragmentation due to GRE overhead. One solution is to increase the MTU on
|
||||
physical hosts and network equipment. When this is not possible or practical thi
|
||||
charm's instance-mtu option can be used to reduce instance MTU via DHCP.
|
||||
|
||||
juju set quantum-gateway instance-mtu=1400
|
||||
|
||||
OpenStack upstream documentation recomments a MTU value of 1400:
|
||||
[Openstack documentation](http://docs.openstack.org/admin-guide-cloud/content/openvswitch_plugin.html)
|
||||
|
||||
Note that this option was added in Havana and will be ignored in older releases.
|
||||
|
||||
TODO
|
||||
----
|
||||
|
@ -50,3 +50,10 @@ options:
|
||||
type: string
|
||||
description: RabbitMQ Virtual Host
|
||||
default: openstack
|
||||
instance-mtu:
|
||||
type: int
|
||||
description: |
|
||||
Configure DHCP services to provide MTU configuration to instances
|
||||
within the cloud. This is useful in deployments where its not
|
||||
possible to increase MTU on switches and physical servers to
|
||||
accomodate the packet overhead of using GRE tunnels.
|
||||
|
@ -133,7 +133,8 @@ class QuantumGatewayContext(OSContextGenerator):
|
||||
'shared_secret': get_shared_secret(),
|
||||
'local_ip': get_host_ip(), # XXX: data network impact
|
||||
'core_plugin': core_plugin(),
|
||||
'plugin': config('plugin')
|
||||
'plugin': config('plugin'),
|
||||
'instance_mtu': config('instance-mtu')
|
||||
}
|
||||
return ctxt
|
||||
|
||||
|
@ -140,6 +140,7 @@ QUANTUM_METADATA_AGENT_CONF = "/etc/quantum/metadata_agent.ini"
|
||||
NEUTRON_CONF = "/etc/neutron/neutron.conf"
|
||||
NEUTRON_L3_AGENT_CONF = "/etc/neutron/l3_agent.ini"
|
||||
NEUTRON_DHCP_AGENT_CONF = "/etc/neutron/dhcp_agent.ini"
|
||||
NEUTRON_DNSMASQ_CONF = "/etc/neutron/dnsmasq.conf"
|
||||
NEUTRON_METADATA_AGENT_CONF = "/etc/neutron/metadata_agent.ini"
|
||||
|
||||
NOVA_CONF = "/etc/nova/nova.conf"
|
||||
@ -172,6 +173,10 @@ NEUTRON_SHARED_CONFIG_FILES = {
|
||||
'hook_contexts': [QuantumGatewayContext()],
|
||||
'services': ['neutron-dhcp-agent']
|
||||
},
|
||||
NEUTRON_DNSMASQ_CONF: {
|
||||
'hook_contexts': [QuantumGatewayContext()],
|
||||
'services': ['neutron-dhcp-agent']
|
||||
},
|
||||
NEUTRON_METADATA_AGENT_CONF: {
|
||||
'hook_contexts': [NetworkServiceContext(),
|
||||
QuantumGatewayContext()],
|
||||
@ -272,7 +277,6 @@ def register_configs():
|
||||
for conf in CONFIG_FILES[name][plugin]:
|
||||
configs.register(conf,
|
||||
CONFIG_FILES[name][plugin][conf]['hook_contexts'])
|
||||
|
||||
return configs
|
||||
|
||||
|
||||
|
@ -1,9 +1,16 @@
|
||||
###############################################################################
|
||||
# [ WARNING ]
|
||||
# Configuration file maintained by Juju. Local changes may be overwritten.
|
||||
###############################################################################
|
||||
[DEFAULT]
|
||||
state_path = /var/lib/neutron
|
||||
interface_driver = neutron.agent.linux.interface.OVSInterfaceDriver
|
||||
dhcp_driver = neutron.agent.linux.dhcp.Dnsmasq
|
||||
root_helper = sudo /usr/bin/neutron-rootwrap /etc/neutron/rootwrap.conf
|
||||
ovs_use_veth = True
|
||||
{% if instance_mtu -%}
|
||||
dnsmasq_config_file = /etc/neutron/dnsmasq.conf
|
||||
{% endif %}
|
||||
{% if plugin == 'nvp' %}
|
||||
enable_metadata_network = True
|
||||
enable_isolated_metadata = True
|
||||
|
3
templates/havana/dnsmasq.conf
Normal file
3
templates/havana/dnsmasq.conf
Normal file
@ -0,0 +1,3 @@
|
||||
{%- if instance_mtu -%}
|
||||
dhcp-option=26,{{ instance_mtu }}
|
||||
{% endif %}
|
@ -180,13 +180,19 @@ class TestQuantumGatewayContext(CharmTestCase):
|
||||
@patch.object(quantum_contexts, 'get_shared_secret')
|
||||
@patch.object(quantum_contexts, 'get_host_ip')
|
||||
def test_all(self, _host_ip, _secret):
|
||||
self.config.return_value = 'ovs'
|
||||
def side_effect(arg):
|
||||
return_values = {'plugin': 'ovs',
|
||||
'instance-mtu': 1420,
|
||||
'openstack-origin': 'foo'}
|
||||
return return_values[arg]
|
||||
self.config.side_effect = side_effect
|
||||
self.get_os_codename_install_source.return_value = 'folsom'
|
||||
_host_ip.return_value = '10.5.0.1'
|
||||
_secret.return_value = 'testsecret'
|
||||
self.assertEquals(quantum_contexts.QuantumGatewayContext()(), {
|
||||
'shared_secret': 'testsecret',
|
||||
'local_ip': '10.5.0.1',
|
||||
'instance_mtu': 1420,
|
||||
'core_plugin': "quantum.plugins.openvswitch.ovs_quantum_plugin."
|
||||
"OVSQuantumPluginV2",
|
||||
'plugin': 'ovs'
|
||||
|
@ -158,6 +158,7 @@ class TestQuantumUtils(CharmTestCase):
|
||||
quantum_utils.NEUTRON_METADATA_AGENT_CONF:
|
||||
['neutron-metadata-agent'],
|
||||
quantum_utils.NEUTRON_DHCP_AGENT_CONF: ['neutron-dhcp-agent'],
|
||||
quantum_utils.NEUTRON_DNSMASQ_CONF: ['neutron-dhcp-agent'],
|
||||
quantum_utils.NEUTRON_CONF: ['neutron-l3-agent',
|
||||
'neutron-dhcp-agent',
|
||||
'neutron-metadata-agent',
|
||||
@ -209,6 +210,7 @@ class TestQuantumUtils(CharmTestCase):
|
||||
self.config.return_value = 'nvp'
|
||||
ex_map = {
|
||||
quantum_utils.NEUTRON_DHCP_AGENT_CONF: ['neutron-dhcp-agent'],
|
||||
quantum_utils.NEUTRON_DNSMASQ_CONF: ['neutron-dhcp-agent'],
|
||||
quantum_utils.NOVA_CONF: ['nova-api-metadata'],
|
||||
quantum_utils.NEUTRON_CONF: ['neutron-dhcp-agent',
|
||||
'neutron-metadata-agent'],
|
||||
|
Loading…
x
Reference in New Issue
Block a user