diff --git a/README.md b/README.md index dddfc840..000e8cd7 100644 --- a/README.md +++ b/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=" juju set quantum-gateway-extnet2 "external-network-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 ---- diff --git a/config.yaml b/config.yaml index defb8f81..d7b9ad45 100644 --- a/config.yaml +++ b/config.yaml @@ -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. diff --git a/hooks/quantum_contexts.py b/hooks/quantum_contexts.py index b6ae0cf8..4cb39f7a 100644 --- a/hooks/quantum_contexts.py +++ b/hooks/quantum_contexts.py @@ -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 diff --git a/hooks/quantum_utils.py b/hooks/quantum_utils.py index a7861ee5..11cafc60 100644 --- a/hooks/quantum_utils.py +++ b/hooks/quantum_utils.py @@ -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 diff --git a/templates/havana/dhcp_agent.ini b/templates/havana/dhcp_agent.ini index 1a31a337..6d76fac1 100644 --- a/templates/havana/dhcp_agent.ini +++ b/templates/havana/dhcp_agent.ini @@ -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 diff --git a/templates/havana/dnsmasq.conf b/templates/havana/dnsmasq.conf new file mode 100644 index 00000000..5ac7f804 --- /dev/null +++ b/templates/havana/dnsmasq.conf @@ -0,0 +1,3 @@ +{%- if instance_mtu -%} +dhcp-option=26,{{ instance_mtu }} +{% endif %} diff --git a/unit_tests/test_quantum_contexts.py b/unit_tests/test_quantum_contexts.py index 5afc5994..03223f08 100644 --- a/unit_tests/test_quantum_contexts.py +++ b/unit_tests/test_quantum_contexts.py @@ -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' diff --git a/unit_tests/test_quantum_utils.py b/unit_tests/test_quantum_utils.py index d85810c6..3deee4c2 100644 --- a/unit_tests/test_quantum_utils.py +++ b/unit_tests/test_quantum_utils.py @@ -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'],