Skip to content

Commit

Permalink
Merge "Remove deprecated 'external_network_bridge' option"
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuul authored and openstack-gerrit committed Mar 13, 2019
2 parents 03d0e43 + b09b446 commit 7198fb6
Show file tree
Hide file tree
Showing 39 changed files with 115 additions and 304 deletions.
2 changes: 1 addition & 1 deletion doc/source/admin/config-az.rst
Expand Up @@ -94,7 +94,7 @@ To confirm the agent's availability zone:
| availability_zone | zone-1 |
| binary | neutron-l3-agent |
| configurations | agent_mode='legacy', ex_gw_ports='2', |
| | external_network_bridge='', floating_ips='0', |
| | floating_ips='0', |
| | gateway_external_network_id='', |
| | handle_internal_only_routers='True', |
| | interface_driver='openvswitch', interfaces='4', |
Expand Down
6 changes: 0 additions & 6 deletions doc/source/admin/config-dvr-ha-snat.rst
Expand Up @@ -136,13 +136,8 @@ Network nodes
[DEFAULT]
ha_vrrp_auth_password = password
interface_driver = openvswitch
external_network_bridge =
agent_mode = dvr_snat
.. note::

The ``external_network_bridge`` option intentionally contains
no value.
Compute nodes
-------------
Expand Down Expand Up @@ -170,7 +165,6 @@ Compute nodes
[DEFAULT]
interface_driver = openvswitch
external_network_bridge =
agent_mode = dvr
Replace ``TUNNEL_INTERFACE_IP_ADDRESS`` with the IP address of the interface
Expand Down
9 changes: 4 additions & 5 deletions doc/source/admin/config-services-agent.rst
Expand Up @@ -39,8 +39,7 @@ should be instructed to act upon these values through RPC.
Each individual agent may have its own configuration file. This file should be
loaded after the main ``neutron.conf`` file, so the agent configuration takes
precedence. The agent-specific configuration may contain configurations which
vary between hosts in a neutron deployment such as the
``external_network_bridge`` for an L3 agent. If any agent requires access to
additional external services beyond the neutron RPC, those endpoints should be
defined in the agent-specific configuration file (for example, nova metadata
for metadata agent).
vary between hosts in a neutron deployment such as the ``local_ip`` for an L2
agent. If any agent requires access to additional external services beyond the
neutron RPC, those endpoints should be defined in the agent-specific
configuration file (for example, nova metadata for metadata agent).
6 changes: 0 additions & 6 deletions doc/source/admin/deploy-lb-ha-vrrp.rst
Expand Up @@ -118,12 +118,6 @@ Network node 2
[DEFAULT]
interface_driver = linuxbridge
external_network_bridge =
.. note::

The ``external_network_bridge`` option intentionally contains
no value.
#. Start the following services:

Expand Down
6 changes: 0 additions & 6 deletions doc/source/admin/deploy-lb-selfservice.rst
Expand Up @@ -146,12 +146,6 @@ Network node
[DEFAULT]
interface_driver = linuxbridge
external_network_bridge =
.. note::

The ``external_network_bridge`` option intentionally contains
no value.
#. Start the following services:

Expand Down
10 changes: 0 additions & 10 deletions doc/source/admin/deploy-ovs-ha-dvr.rst
Expand Up @@ -97,10 +97,6 @@ Network node
[DEFAULT]
agent_mode = dvr_snat
.. note::

The ``external_network_bridge`` option intentionally contains
no value.
#. Restart the following services:

Expand All @@ -125,14 +121,8 @@ Compute nodes
[DEFAULT]
interface_driver = openvswitch
external_network_bridge =
agent_mode = dvr
.. note::

The ``external_network_bridge`` option intentionally contains
no value.

#. Restart the following services:

* Open vSwitch agent
Expand Down
6 changes: 0 additions & 6 deletions doc/source/admin/deploy-ovs-ha-vrrp.rst
Expand Up @@ -119,12 +119,6 @@ Network node 2
[DEFAULT]
interface_driver = openvswitch
external_network_bridge =
.. note::

The ``external_network_bridge`` option intentionally contains
no value.
#. Start the following services:

Expand Down
6 changes: 0 additions & 6 deletions doc/source/admin/deploy-ovs-selfservice.rst
Expand Up @@ -150,12 +150,6 @@ Network node
[DEFAULT]
interface_driver = openvswitch
external_network_bridge =
.. note::

The ``external_network_bridge`` option intentionally contains
no value.
#. Start the following services:

Expand Down
6 changes: 3 additions & 3 deletions doc/source/contributor/internals/services_and_agents.rst
Expand Up @@ -103,7 +103,7 @@ should be instructed to act upon these values via RPC.
Each individual agent may have its own configuration file. This file should be
loaded after the main ```neutron.conf``` file, so the agent configuration takes
precedence. The agent specific configuration may contain configurations which
vary between hosts in a Neutron deployment such as the external_network_bridge
for a L3 agent. If any agent requires access to additional external services
beyond the Neutron RPC, those endpoints should be defined in the agent specific
vary between hosts in a Neutron deployment such as the ``local_ip`` for an L2
agent. If any agent requires access to additional external services beyond the
neutron RPC, those endpoints should be defined in the agent-specific
configuration file (e.g. nova metadata for metadata agent).
14 changes: 0 additions & 14 deletions neutron/agent/l3/agent.py
Expand Up @@ -50,7 +50,6 @@
from neutron.agent.l3 import legacy_router
from neutron.agent.l3 import namespace_manager
from neutron.agent.linux import external_process
from neutron.agent.linux import ip_lib
from neutron.agent.linux import pd
from neutron.agent.linux import utils as linux_utils
from neutron.agent.metadata import driver as metadata_driver
Expand Down Expand Up @@ -359,12 +358,6 @@ def _fetch_external_net_id(self, force=False):
if self.conf.gateway_external_network_id:
return self.conf.gateway_external_network_id

# L3 agent doesn't use external_network_bridge to handle external
# networks, so bridge_mappings with provider networks will be used
# and the L3 agent is able to handle any external networks.
if not self.conf.external_network_bridge:
return

if not force and self.target_ex_net_id:
return self.target_ex_net_id

Expand Down Expand Up @@ -546,12 +539,6 @@ def network_update(self, context, **kwargs):
self._resync_router(update)

def _process_router_if_compatible(self, router):
if (self.conf.external_network_bridge and
not ip_lib.device_exists(self.conf.external_network_bridge)):
LOG.error("The external network bridge '%s' does not exist",
self.conf.external_network_bridge)
return

# Either ex_net_id or handle_internal_only_routers must be set
ex_net_id = (router['external_gateway_info'] or {}).get('network_id')
if not ex_net_id and not self.conf.handle_internal_only_routers:
Expand Down Expand Up @@ -867,7 +854,6 @@ def __init__(self, host, conf=None):
'agent_mode': self.conf.agent_mode,
'handle_internal_only_routers':
self.conf.handle_internal_only_routers,
'external_network_bridge': self.conf.external_network_bridge,
'gateway_external_network_id':
self.conf.gateway_external_network_id,
'interface_driver': self.conf.interface_driver,
Expand Down
2 changes: 0 additions & 2 deletions neutron/agent/l3/dvr_edge_router.py
Expand Up @@ -95,7 +95,6 @@ def _external_gateway_removed(self, ex_gw_port, interface_name):
return

self.driver.unplug(interface_name,
bridge=self.agent_conf.external_network_bridge,
namespace=self.snat_namespace.name,
prefix=router.EXTERNAL_DEV_PREFIX)

Expand Down Expand Up @@ -270,7 +269,6 @@ def _delete_stale_external_devices(self, interface_name):
LOG.debug('Deleting stale external router device: %s', d.name)
self.driver.unplug(
d.name,
bridge=self.agent_conf.external_network_bridge,
namespace=self.snat_namespace.name,
prefix=router.EXTERNAL_DEV_PREFIX)

Expand Down
14 changes: 0 additions & 14 deletions neutron/agent/l3/dvr_fip_ns.py
Expand Up @@ -163,29 +163,17 @@ def _create_gateway_port(self, ex_gw_port, interface_name):
ex_gw_port['id'],
interface_name,
ex_gw_port['mac_address'],
bridge=self.agent_conf.external_network_bridge,
namespace=ns_name,
prefix=FIP_EXT_DEV_PREFIX,
mtu=ex_gw_port.get('mtu'))
if self.agent_conf.external_network_bridge:
# NOTE(Swami): for OVS implementations remove the DEAD VLAN tag
# on ports. DEAD VLAN tag is added to each newly created port
# and should be removed by L2 agent but if
# external_network_bridge is set than external gateway port is
# created in this bridge and will not be touched by L2 agent.
# This is related to lp#1767422
self.driver.remove_vlan_tag(
self.agent_conf.external_network_bridge, interface_name)
# Remove stale fg devices
ip_wrapper = ip_lib.IPWrapper(namespace=ns_name)
devices = ip_wrapper.get_devices()
for device in devices:
name = device.name
if name.startswith(FIP_EXT_DEV_PREFIX) and name != interface_name:
LOG.debug('DVR: unplug: %s', name)
ext_net_bridge = self.agent_conf.external_network_bridge
self.driver.unplug(name,
bridge=ext_net_bridge,
namespace=ns_name,
prefix=FIP_EXT_DEV_PREFIX)

Expand Down Expand Up @@ -232,9 +220,7 @@ def _delete(self):
# single port from FIP NS to br-ext
# TODO(carl) Where does the port get deleted?
LOG.debug('DVR: unplug: %s', d.name)
ext_net_bridge = self.agent_conf.external_network_bridge
self.driver.unplug(d.name,
bridge=ext_net_bridge,
namespace=self.name,
prefix=FIP_EXT_DEV_PREFIX)

Expand Down
1 change: 0 additions & 1 deletion neutron/agent/l3/dvr_snat_ns.py
Expand Up @@ -53,7 +53,6 @@ def delete(self):
elif d.name.startswith(namespaces.EXTERNAL_DEV_PREFIX):
self.driver.unplug(
d.name,
bridge=self.agent_conf.external_network_bridge,
namespace=self.name,
prefix=namespaces.EXTERNAL_DEV_PREFIX)

Expand Down
1 change: 0 additions & 1 deletion neutron/agent/l3/ha_router.py
Expand Up @@ -449,7 +449,6 @@ def external_gateway_removed(self, ex_gw_port, interface_name):
else:
# We are not the master node, so no need to delete ip addresses.
self.driver.unplug(interface_name,
bridge=self.agent_conf.external_network_bridge,
namespace=self.ns_name,
prefix=router.EXTERNAL_DEV_PREFIX)

Expand Down
1 change: 0 additions & 1 deletion neutron/agent/l3/namespaces.py
Expand Up @@ -143,7 +143,6 @@ def delete(self):
elif d.name.startswith(EXTERNAL_DEV_PREFIX):
self.driver.unplug(
d.name,
bridge=self.agent_conf.external_network_bridge,
namespace=self.name,
prefix=EXTERNAL_DEV_PREFIX)

Expand Down
12 changes: 0 additions & 12 deletions neutron/agent/l3/router_info.py
Expand Up @@ -661,19 +661,9 @@ def _plug_external_gateway(self, ex_gw_port, interface_name, ns_name):
ex_gw_port['id'],
interface_name,
ex_gw_port['mac_address'],
bridge=self.agent_conf.external_network_bridge,
namespace=ns_name,
prefix=EXTERNAL_DEV_PREFIX,
mtu=ex_gw_port.get('mtu'))
if self.agent_conf.external_network_bridge:
# NOTE(slaweq): for OVS implementations remove the DEAD VLAN tag
# on ports. DEAD VLAN tag is added to each newly created port
# and should be removed by L2 agent but if
# external_network_bridge is set than external gateway port is
# created in this bridge and will not be touched by L2 agent.
# This is related to lp#1767422
self.driver.remove_vlan_tag(
self.agent_conf.external_network_bridge, interface_name)

def _get_external_gw_ips(self, ex_gw_port):
gateway_ips = []
Expand Down Expand Up @@ -802,7 +792,6 @@ def external_gateway_removed(self, ex_gw_port, interface_name):
ip_addr['ip_address'],
prefixlen))
self.driver.unplug(interface_name,
bridge=self.agent_conf.external_network_bridge,
namespace=self.ns_name,
prefix=EXTERNAL_DEV_PREFIX)

Expand All @@ -819,7 +808,6 @@ def _delete_stale_external_devices(self, interface_name):
LOG.debug('Deleting stale external router device: %s', stale_dev)
self.agent.pd.remove_gw_interface(self.router['id'])
self.driver.unplug(stale_dev,
bridge=self.agent_conf.external_network_bridge,
namespace=self.ns_name,
prefix=EXTERNAL_DEV_PREFIX)

Expand Down
15 changes: 0 additions & 15 deletions neutron/agent/linux/interface.py
Expand Up @@ -238,17 +238,6 @@ def check_bridge_exists(self, bridge):
def get_device_name(self, port):
return (self.DEV_NAME_PREFIX + port.id)[:self.DEV_NAME_LEN]

def remove_vlan_tag(self, bridge, interface_name):
"""Remove vlan tag from given interface.
This method is necessary only for the case when deprecated
option 'external_network_bridge' is used in L3 agent as
external gateway port is then created in this external bridge
directly and it will have DEAD_VLAN_TAG added by default.
"""
# TODO(slaweq): remove it when external_network_bridge option will be
# removed

@staticmethod
def configure_ipv6_ra(namespace, dev_name, value):
"""Configure handling of IPv6 Router Advertisements on an
Expand Down Expand Up @@ -348,10 +337,6 @@ def _ovs_add_port(self, bridge, device_name, port_id, mac_address,
ovs = ovs_lib.OVSBridge(bridge)
ovs.replace_port(device_name, *attrs)

def remove_vlan_tag(self, bridge, interface):
ovs = ovs_lib.OVSBridge(bridge)
ovs.clear_db_attribute("Port", interface, "tag")

def plug_new(self, network_id, port_id, device_name, mac_address,
bridge=None, namespace=None, prefix=None, mtu=None):
"""Plug in the interface."""
Expand Down
3 changes: 1 addition & 2 deletions neutron/cmd/ovs_cleanup.py
Expand Up @@ -60,8 +60,7 @@ def main():


def do_main(conf):
configuration_bridges = set([conf.ovs_integration_bridge,
conf.external_network_bridge])
configuration_bridges = set([conf.ovs_integration_bridge])
ovs = ovs_lib.BaseOVS()
ovs_bridges = set(ovs.get_bridges())
available_configuration_bridges = configuration_bridges & ovs_bridges
Expand Down
11 changes: 0 additions & 11 deletions neutron/conf/agent/common.py
Expand Up @@ -154,17 +154,6 @@
help=_("Availability zone of this node")),
]

EXT_NET_BRIDGE_OPTS = [
cfg.StrOpt('external_network_bridge', default='',
deprecated_for_removal=True,
help=_("Name of bridge used for external network "
"traffic. When this parameter is set, the L3 agent will "
"plug an interface directly into an external bridge "
"which will not allow any wiring by the L2 agent. Using "
"this will result in incorrect port statuses. This "
"option is deprecated and will be removed in Ocata."))
]


def get_log_args(conf, log_file_name, **kwargs):
cmd_args = []
Expand Down
13 changes: 4 additions & 9 deletions neutron/conf/agent/l3/config.py
Expand Up @@ -18,7 +18,6 @@
from oslo_config import cfg

from neutron._i18n import _
from neutron.conf.agent import common as config


OPTS = [
Expand Down Expand Up @@ -58,12 +57,10 @@
"False for all agents if all routers must have an "
"external network gateway.")),
cfg.StrOpt('gateway_external_network_id', default='',
help=_("When external_network_bridge is set, each L3 agent can "
"be associated with no more than one external network. "
"This value should be set to the UUID of that external "
"network. To allow L3 agent support multiple external "
"networks, both the external_network_bridge and "
"gateway_external_network_id must be left empty."),
help=_("To allow the L3 agent to support multiple external "
"networks, gateway_external_network_id must be left "
"empty. Otherwise this value should be set to the UUID "
"of the single external network to be used."),
deprecated_for_removal=True),
cfg.StrOpt('ipv6_gateway', default='',
help=_("With IPv6, the network used for the external gateway "
Expand Down Expand Up @@ -103,8 +100,6 @@
'0xffff so that only the lower 16 bits will be used.')),
]

OPTS += config.EXT_NET_BRIDGE_OPTS


def register_l3_agent_config_opts(opts, cfg=cfg.CONF):
cfg.register_opts(opts)

0 comments on commit 7198fb6

Please sign in to comment.