Merge "Deprecate vlan_qinq
and vlan_transparent
config options"
This commit is contained in:
@@ -125,10 +125,24 @@ core_opts = [
|
||||
help=_("Neutron IPAM (IP address management) driver to use. "
|
||||
"By default, the reference implementation of the "
|
||||
"Neutron IPAM driver is used.")),
|
||||
cfg.BoolOpt('vlan_transparent', default=False,
|
||||
cfg.BoolOpt('vlan_transparent', default=None,
|
||||
deprecated_for_removal=True,
|
||||
deprecated_reason=_(
|
||||
'This option is going to be removed as availability '
|
||||
'of the `vlan_transparency` in the deployment is '
|
||||
'now calculated automatically based on the loaded '
|
||||
'mechanism drivers.'),
|
||||
deprecated_since='2025.2',
|
||||
help=_('If True, then allow plugins that support it to '
|
||||
'create VLAN transparent networks.')),
|
||||
cfg.BoolOpt('vlan_qinq', default=False,
|
||||
cfg.BoolOpt('vlan_qinq', default=None,
|
||||
deprecated_for_removal=True,
|
||||
deprecated_reason=_(
|
||||
'This option is going to be removed as availability '
|
||||
'of the `vlan_qinq` in the deployment is '
|
||||
'now calculated automatically based on the loaded '
|
||||
'mechanism drivers.'),
|
||||
deprecated_since='2025.2',
|
||||
help=_('If True, then allow plugins that support it to '
|
||||
'create VLAN transparent networks using 0x8a88 '
|
||||
'ethertype.')),
|
||||
|
@@ -22,7 +22,7 @@ LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def _disable_extension_by_config(aliases):
|
||||
if not cfg.CONF.vlan_qinq:
|
||||
if cfg.CONF.vlan_qinq is False:
|
||||
if apidef.ALIAS in aliases:
|
||||
aliases.remove(apidef.ALIAS)
|
||||
LOG.info('Disabled VLAN QinQ extension.')
|
||||
|
@@ -21,7 +21,7 @@ LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def _disable_extension_by_config(aliases):
|
||||
if not cfg.CONF.vlan_transparent:
|
||||
if cfg.CONF.vlan_transparent is False:
|
||||
if 'vlan-transparent' in aliases:
|
||||
aliases.remove('vlan-transparent')
|
||||
LOG.info('Disabled vlantransparent extension.')
|
||||
|
@@ -15,6 +15,8 @@
|
||||
# under the License.
|
||||
|
||||
from neutron_lib.api.definitions import portbindings
|
||||
from neutron_lib.api.definitions import qinq as qinq_apidef
|
||||
from neutron_lib.api.definitions import vlantransparent as vlan_apidef
|
||||
from neutron_lib import constants
|
||||
from neutron_lib.plugins.ml2 import api
|
||||
from oslo_log import log
|
||||
@@ -37,6 +39,11 @@ class MacvtapMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase):
|
||||
network.
|
||||
"""
|
||||
|
||||
_explicitly_not_supported_extensions = set([
|
||||
vlan_apidef.ALIAS,
|
||||
qinq_apidef.ALIAS
|
||||
])
|
||||
|
||||
def __init__(self):
|
||||
vif_details = {portbindings.CAP_PORT_FILTER: False,
|
||||
portbindings.VIF_DETAILS_CONNECTIVITY:
|
||||
@@ -56,14 +63,6 @@ class MacvtapMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase):
|
||||
def get_mappings(self, agent):
|
||||
return agent['configurations'].get('interface_mappings', {})
|
||||
|
||||
def check_vlan_transparency(self, context):
|
||||
"""Macvtap driver vlan transparency support."""
|
||||
return False
|
||||
|
||||
def check_vlan_qinq(self, context):
|
||||
"""Currently Macvtap driver doesn't support QinQ vlan."""
|
||||
return False
|
||||
|
||||
def _is_live_migration(self, context):
|
||||
# We cannot just check if
|
||||
# context.original['host_id'] != context.current['host_id']
|
||||
|
@@ -43,6 +43,8 @@ class AgentMechanismDriverBase(api.MechanismDriver, metaclass=abc.ABCMeta):
|
||||
__init__(), and must implement try_to_bind_segment_for_agent().
|
||||
"""
|
||||
|
||||
_explicitly_not_supported_extensions = set()
|
||||
|
||||
def __init__(self, agent_type, supported_vnic_types):
|
||||
"""Initialize base class for specific L2 agent type.
|
||||
|
||||
@@ -56,6 +58,11 @@ class AgentMechanismDriverBase(api.MechanismDriver, metaclass=abc.ABCMeta):
|
||||
def initialize(self):
|
||||
pass
|
||||
|
||||
def supported_extensions(self, extensions):
|
||||
# filter out extensions which this mech driver explicitly claimed
|
||||
# that are not supported
|
||||
return extensions - self._explicitly_not_supported_extensions
|
||||
|
||||
def create_port_precommit(self, context):
|
||||
self._insert_provisioning_block(context)
|
||||
|
||||
|
@@ -18,6 +18,8 @@ import uuid
|
||||
|
||||
from neutron_lib.api.definitions import portbindings
|
||||
from neutron_lib.api.definitions import provider_net
|
||||
from neutron_lib.api.definitions import qinq as qinq_apidef
|
||||
from neutron_lib.api.definitions import vlantransparent as vlan_apidef
|
||||
from neutron_lib.callbacks import events
|
||||
from neutron_lib.callbacks import registry
|
||||
from neutron_lib import constants
|
||||
@@ -53,6 +55,11 @@ class OpenvswitchMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase):
|
||||
resource_provider_uuid5_namespace = uuid.UUID(
|
||||
'87ee7d5c-73bb-11e8-9008-c4d987b2a692')
|
||||
|
||||
_explicitly_not_supported_extensions = set([
|
||||
vlan_apidef.ALIAS,
|
||||
qinq_apidef.ALIAS
|
||||
])
|
||||
|
||||
def __init__(self):
|
||||
sg_enabled = securitygroups_rpc.is_firewall_enabled()
|
||||
vif_details = {portbindings.CAP_PORT_FILTER: sg_enabled,
|
||||
@@ -109,14 +116,6 @@ class OpenvswitchMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase):
|
||||
_('Cannot standardize bridge mappings of agent type: %s'),
|
||||
agent['agent_type'])
|
||||
|
||||
def check_vlan_transparency(self, context):
|
||||
"""Currently Openvswitch driver doesn't support vlan transparency."""
|
||||
return False
|
||||
|
||||
def check_vlan_qinq(self, context):
|
||||
"""Currently Openvswitch driver doesn't support QinQ vlan."""
|
||||
return False
|
||||
|
||||
def bind_port(self, context):
|
||||
vnic_type = context.current.get(portbindings.VNIC_TYPE,
|
||||
portbindings.VNIC_NORMAL)
|
||||
|
@@ -1148,8 +1148,6 @@ class TestVlanTransparencyOptions(base.TestOVNFunctionalBase):
|
||||
|
||||
def setUp(self):
|
||||
common_conf.register_core_common_config_opts()
|
||||
common_conf.cfg.CONF.set_override('vlan_qinq', True)
|
||||
common_conf.cfg.CONF.set_override('vlan_transparent', True)
|
||||
super().setUp()
|
||||
self._ovn_client = self.mech_driver._ovn_client
|
||||
|
||||
|
@@ -180,8 +180,6 @@ class TestOVNMechanismDriverBase(MechDriverSetupBase,
|
||||
# Need to register here for 'vlan_transparent' config before
|
||||
# setting up test_plugin
|
||||
config.register_common_config_options()
|
||||
cfg.CONF.set_override('vlan_transparent', True)
|
||||
cfg.CONF.set_override('vlan_qinq', True)
|
||||
cfg.CONF.set_override('ovsdb_connection_timeout', 30, group='ovn')
|
||||
mock.patch.object(impl_idl_ovn.Backend, 'schema_helper').start()
|
||||
super().setUp()
|
||||
|
@@ -49,7 +49,6 @@ import webob
|
||||
|
||||
from neutron._i18n import _
|
||||
from neutron.agent import rpc as agent_rpc
|
||||
from neutron.common import config
|
||||
from neutron.common import utils
|
||||
from neutron.db import agents_db
|
||||
from neutron.db import ipam_pluggable_backend
|
||||
@@ -678,11 +677,6 @@ class TestMl2NetworksWithVlanTransparencyBase(TestMl2NetworksV2):
|
||||
pnet.PHYSICAL_NETWORK: 'physnet1'}],
|
||||
'vlan_transparent': 'True'}}
|
||||
|
||||
def setUp(self, plugin=None):
|
||||
config.register_common_config_options()
|
||||
cfg.CONF.set_override('vlan_transparent', True)
|
||||
super().setUp(plugin)
|
||||
|
||||
|
||||
class TestMl2NetworksWithVlanTransparency(
|
||||
TestMl2NetworksWithVlanTransparencyBase):
|
||||
|
@@ -0,0 +1,9 @@
|
||||
---
|
||||
deprecations:
|
||||
- |
|
||||
Config options ``vlan_transparent`` and ``vlan_qinq`` are now deprecated and
|
||||
will be removed in a future release. Availability of the ``vlan-transparent``
|
||||
and ``vlan-qinq`` API extensions can now be calculated by Neutron based on the
|
||||
mechanism drivers enabled in the environment. If any of the enabled
|
||||
mechanism drivers do not support these features, the API extensions will be
|
||||
disabled automatically.
|
Reference in New Issue
Block a user