Merge "Change tenant_network_types to project_network_types"
This commit is contained in:
@@ -66,7 +66,7 @@ verbose = True
|
||||
[[post-config|/$Q_PLUGIN_CONF_FILE]]
|
||||
[ml2]
|
||||
type_drivers=flat,gre,vlan,vxlan
|
||||
tenant_network_types=vxlan
|
||||
project_network_types=vxlan
|
||||
mechanism_drivers=openvswitch,l2population
|
||||
|
||||
[agent]
|
||||
@@ -74,7 +74,7 @@ tunnel_types=vxlan,gre
|
||||
|
||||
# You can add more config options here for ml2_conf.ini, for instance
|
||||
# you can uncomment the followings to set the segment ID ranges for
|
||||
# various tenant network types.
|
||||
# various project network types.
|
||||
|
||||
#[ml2_type_vxlan]
|
||||
#vni_ranges=1:10000
|
||||
@@ -86,4 +86,4 @@ tunnel_types=vxlan,gre
|
||||
#tunnel_id_ranges = 1:10000
|
||||
|
||||
#[ml2_type_vlan]
|
||||
#network_vlan_ranges = tenant:1:1000
|
||||
#network_vlan_ranges = project:1:1000
|
||||
|
||||
@@ -85,7 +85,7 @@ Controller node configuration
|
||||
|
||||
[ml2]
|
||||
type_drivers = flat,vxlan
|
||||
tenant_network_types = vxlan
|
||||
project_network_types = vxlan
|
||||
mechanism_drivers = openvswitch,l2population
|
||||
extension_drivers = port_security
|
||||
|
||||
@@ -100,7 +100,7 @@ Controller node configuration
|
||||
|
||||
.. note::
|
||||
|
||||
The first value in the ``tenant_network_types`` option becomes the
|
||||
The first value in the ``project_network_types`` option becomes the
|
||||
default project network type when a regular user creates a network.
|
||||
|
||||
Network nodes
|
||||
|
||||
@@ -251,7 +251,7 @@ Configure Nodes (VLAN Configuration)
|
||||
.. code-block:: ini
|
||||
|
||||
[ml2]
|
||||
tenant_network_types = vlan
|
||||
project_network_types = vlan
|
||||
type_drivers = vlan
|
||||
mechanism_drivers = openvswitch
|
||||
|
||||
@@ -295,7 +295,7 @@ Configure Nodes (VXLAN Configuration)
|
||||
.. code-block:: ini
|
||||
|
||||
[ml2]
|
||||
tenant_network_types = vxlan
|
||||
project_network_types = vxlan
|
||||
type_drivers = vxlan
|
||||
mechanism_drivers = openvswitch
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ required by certain drivers like OVS. At this time the following
|
||||
The ``segmentation-type`` and ``segmentation-id`` specified by the user on the
|
||||
subports is intentionally decoupled from the ``segmentation-type`` and ID of
|
||||
the networks. For example, it is possible to configure the Networking service
|
||||
with ``tenant_network_types = vxlan`` and still create subports with
|
||||
with ``project_network_types = vxlan`` and still create subports with
|
||||
``segmentation_type = vlan``. The Networking service performs remapping as
|
||||
necessary.
|
||||
|
||||
|
||||
@@ -122,7 +122,7 @@ Controller node
|
||||
|
||||
[ml2]
|
||||
type_drivers = flat,vlan
|
||||
tenant_network_types =
|
||||
project_network_types =
|
||||
mechanism_drivers = openvswitch
|
||||
extension_drivers = port_security
|
||||
|
||||
@@ -138,7 +138,7 @@ Controller node
|
||||
|
||||
.. note::
|
||||
|
||||
The ``tenant_network_types`` option contains no value because the
|
||||
The ``project_network_types`` option contains no value because the
|
||||
architecture does not support self-service networks.
|
||||
|
||||
.. note::
|
||||
|
||||
@@ -70,7 +70,7 @@ Controller node
|
||||
|
||||
[ml2]
|
||||
type_drivers = flat,vlan,vxlan
|
||||
tenant_network_types = vxlan
|
||||
project_network_types = vxlan
|
||||
|
||||
* Enable the layer-2 population mechanism driver.
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ During normal operation, ``keepalived`` on the master router periodically
|
||||
transmits *heartbeat* packets over a hidden network that connects all VRRP
|
||||
routers for a particular project. Each project with VRRP routers uses a
|
||||
separate hidden network. By default this network uses the first value in
|
||||
the ``tenant_network_types`` option in the ``ml2_conf.ini`` file. For
|
||||
the ``project_network_types`` option in the ``ml2_conf.ini`` file. For
|
||||
additional control, you can specify the self-service network type and physical
|
||||
network name for the hidden network using the ``l3_ha_network_type`` and
|
||||
``l3_ha_network_name`` options in the ``neutron.conf`` file.
|
||||
|
||||
@@ -171,7 +171,7 @@ and switching) virtual networking infrastructure for instances.
|
||||
|
||||
[ml2]
|
||||
# ...
|
||||
tenant_network_types =
|
||||
project_network_types =
|
||||
|
||||
.. end
|
||||
|
||||
|
||||
@@ -172,7 +172,7 @@ and switching) virtual networking infrastructure for instances.
|
||||
|
||||
[ml2]
|
||||
# ...
|
||||
tenant_network_types =
|
||||
project_network_types =
|
||||
|
||||
.. end
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ and switching) virtual networking infrastructure for instances.
|
||||
|
||||
[ml2]
|
||||
# ...
|
||||
tenant_network_types = vxlan
|
||||
project_network_types = vxlan
|
||||
|
||||
.. end
|
||||
|
||||
|
||||
@@ -170,7 +170,7 @@ and switching) virtual networking infrastructure for instances.
|
||||
|
||||
[ml2]
|
||||
# ...
|
||||
tenant_network_types = vxlan
|
||||
project_network_types = vxlan
|
||||
|
||||
.. end
|
||||
|
||||
|
||||
@@ -155,7 +155,7 @@ information.
|
||||
``/etc/neutron/plugins/ml2/ml2_conf.ini`` file:
|
||||
|
||||
* Configure the OVN mechanism driver, network type drivers, self-service
|
||||
(tenant) network types, and enable the port security extension.
|
||||
(project) network types, and enable the port security extension.
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
@@ -163,7 +163,7 @@ information.
|
||||
...
|
||||
mechanism_drivers = ovn
|
||||
type_drivers = local,flat,vlan,geneve
|
||||
tenant_network_types = geneve
|
||||
project_network_types = geneve
|
||||
extension_drivers = port_security
|
||||
overlay_ip_version = 4
|
||||
|
||||
@@ -171,7 +171,7 @@ information.
|
||||
|
||||
To enable VLAN self-service networks, make sure that OVN
|
||||
version 2.11 (or higher) is used, then add ``vlan`` to the
|
||||
``tenant_network_types`` option. The first network type in the
|
||||
``project_network_types`` option. The first network type in the
|
||||
list becomes the default self-service network type.
|
||||
|
||||
To use IPv6 for all overlay (tunnel) network endpoints,
|
||||
|
||||
@@ -52,7 +52,7 @@ Verify operation
|
||||
| | | subnet. |
|
||||
| Quota management support | quotas | Expose functions for |
|
||||
| | | quotas management per |
|
||||
| | | tenant |
|
||||
| | | project |
|
||||
| Provider Network | provider | Expose mapping of virtual |
|
||||
| | | networks to physical |
|
||||
| | | networks |
|
||||
@@ -93,7 +93,7 @@ Verify operation
|
||||
| | | extension. |
|
||||
| RBAC Policies | rbac-policies | Allows creation and |
|
||||
| | | modification of policies |
|
||||
| | | that control tenant access |
|
||||
| | | that control project access|
|
||||
| | | to resources. |
|
||||
| standard-attr-description | standard-attr-description | Extension to add |
|
||||
| | | descriptions to standard |
|
||||
|
||||
@@ -1487,7 +1487,7 @@ def validate_port_forwarding_configuration():
|
||||
|
||||
provider_network_types = ['vlan', 'flat']
|
||||
if any(net_type in provider_network_types
|
||||
for net_type in cfg.CONF.ml2.tenant_network_types):
|
||||
for net_type in cfg.CONF.ml2.project_network_types):
|
||||
raise ovn_exc.InvalidPortForwardingConfiguration()
|
||||
|
||||
|
||||
|
||||
@@ -29,10 +29,10 @@ AGENTS_SCHEDULER_OPTS = [
|
||||
'agents.')),
|
||||
cfg.IntOpt('dhcp_agents_per_network', default=1,
|
||||
min=1,
|
||||
help=_('Number of DHCP agents scheduled to host a tenant '
|
||||
help=_('Number of DHCP agents scheduled to host a project '
|
||||
'network. If this number is greater than 1, the '
|
||||
'scheduler automatically assigns multiple DHCP agents '
|
||||
'for a given tenant network, providing high '
|
||||
'for a given project network, providing high '
|
||||
'availability for the DHCP service. However this does '
|
||||
'not provide high availability for the IPv6 metadata '
|
||||
'service in isolated networks.')),
|
||||
|
||||
@@ -25,8 +25,8 @@ DVR_MAC_ADDRESS_OPTS = [
|
||||
"also be used. The others will be randomly generated. "
|
||||
"The 'dvr_base_mac' *must* be different from "
|
||||
"'base_mac' to avoid mixing it up with MAC's "
|
||||
"allocated for tenant ports. A 4-octet example would be "
|
||||
"dvr_base_mac = fa:16:3f:4f:00:00. The default is 3 "
|
||||
"allocated for project ports. A 4-octet example would "
|
||||
"be dvr_base_mac = fa:16:3f:4f:00:00. The default is 3 "
|
||||
"octets")),
|
||||
]
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ L3_HA_OPTS = [
|
||||
cfg.StrOpt('l3_ha_network_type', default='',
|
||||
help=_("The network type to use when creating the L3 HA "
|
||||
"network for an HA router. By default, or if empty, the "
|
||||
"first 'tenant_network_types' value is used. This is "
|
||||
"first 'project_network_types' value is used. This is "
|
||||
"helpful when the VRRP traffic should use a specific "
|
||||
"network which is not the default one.")),
|
||||
cfg.StrOpt('l3_ha_network_physical_name', default='',
|
||||
|
||||
@@ -27,9 +27,10 @@ ml2_opts = [
|
||||
constants.TYPE_VXLAN, constants.TYPE_GENEVE],
|
||||
help=_("List of network type driver entrypoints to be loaded "
|
||||
"from the neutron.ml2.type_drivers namespace.")),
|
||||
cfg.ListOpt('tenant_network_types',
|
||||
cfg.ListOpt('project_network_types',
|
||||
deprecated_name='tenant_network_types',
|
||||
default=[constants.TYPE_LOCAL],
|
||||
help=_("Ordered list of network_types to allocate as tenant "
|
||||
help=_("Ordered list of network_types to allocate as project "
|
||||
"networks. The default value 'local' is useful for "
|
||||
"single-box testing but provides no connectivity "
|
||||
"between hosts.")),
|
||||
@@ -63,7 +64,7 @@ ml2_opts = [
|
||||
"provider attributes are specified. By default it is "
|
||||
"None, which means that if provider attributes are not "
|
||||
"specified while creating external networks then they "
|
||||
"will have the same type as tenant networks. Allowed "
|
||||
"will have the same type as project networks. Allowed "
|
||||
"values for external_network_type config option depend "
|
||||
"on the network type values configured in type_drivers "
|
||||
"config option.")),
|
||||
|
||||
@@ -24,7 +24,7 @@ gre_opts = [
|
||||
default=[],
|
||||
help=_("Comma-separated list of <tun_min>:<tun_max> tuples "
|
||||
"enumerating ranges of GRE tunnel IDs that are "
|
||||
"available for tenant network allocation"))
|
||||
"available for project network allocation"))
|
||||
]
|
||||
|
||||
flat_opts = [
|
||||
@@ -41,7 +41,7 @@ geneve_opts = [
|
||||
default=[],
|
||||
help=_("Comma-separated list of <vni_min>:<vni_max> tuples "
|
||||
"enumerating ranges of Geneve VNI IDs that are "
|
||||
"available for tenant network allocation. "
|
||||
"available for project network allocation. "
|
||||
"Note OVN does not use the actual values.")),
|
||||
cfg.IntOpt('max_header_size',
|
||||
default=p_const.GENEVE_ENCAP_MIN_OVERHEAD,
|
||||
@@ -60,7 +60,7 @@ vxlan_opts = [
|
||||
default=[],
|
||||
help=_("Comma-separated list of <vni_min>:<vni_max> tuples "
|
||||
"enumerating ranges of VXLAN VNI IDs that are "
|
||||
"available for tenant network allocation")),
|
||||
"available for project network allocation")),
|
||||
cfg.StrOpt('vxlan_group',
|
||||
help=_("Multicast group for VXLAN. When configured, will "
|
||||
"enable sending all broadcast traffic to this multicast "
|
||||
@@ -73,9 +73,9 @@ vlan_opts = [
|
||||
default=[],
|
||||
help=_("List of <physical_network>:<vlan_min>:<vlan_max> or "
|
||||
"<physical_network> specifying physical_network names "
|
||||
"usable for VLAN provider and tenant networks, as "
|
||||
"usable for VLAN provider and project networks, as "
|
||||
"well as ranges of VLAN tags on each available for "
|
||||
"allocation to tenant networks. If no range is "
|
||||
"allocation to project networks. If no range is "
|
||||
"defined, the whole valid VLAN ID set [1, 4094] will "
|
||||
"be assigned."))
|
||||
]
|
||||
|
||||
@@ -44,19 +44,19 @@ DEFAULT_QUOTA_RBAC = 10
|
||||
core_quota_opts = [
|
||||
cfg.IntOpt('default_quota',
|
||||
default=DEFAULT_QUOTA,
|
||||
help=_('Default number of resources allowed per tenant. '
|
||||
help=_('Default number of resources allowed per project. '
|
||||
'A negative value means unlimited.')),
|
||||
cfg.IntOpt('quota_network',
|
||||
default=DEFAULT_QUOTA_NETWORK,
|
||||
help=_('Number of networks allowed per tenant. '
|
||||
help=_('Number of networks allowed per project. '
|
||||
'A negative value means unlimited.')),
|
||||
cfg.IntOpt('quota_subnet',
|
||||
default=DEFAULT_QUOTA_SUBNET,
|
||||
help=_('Number of subnets allowed per tenant, '
|
||||
help=_('Number of subnets allowed per project, '
|
||||
'A negative value means unlimited.')),
|
||||
cfg.IntOpt('quota_port',
|
||||
default=DEFAULT_QUOTA_PORT,
|
||||
help=_('Number of ports allowed per tenant. '
|
||||
help=_('Number of ports allowed per project. '
|
||||
'A negative value means unlimited.')),
|
||||
cfg.StrOpt('quota_driver',
|
||||
default=QUOTA_DB_DRIVER,
|
||||
@@ -78,11 +78,11 @@ core_quota_opts = [
|
||||
security_group_quota_opts = [
|
||||
cfg.IntOpt('quota_security_group',
|
||||
default=DEFAULT_QUOTA_SG,
|
||||
help=_('Number of security groups allowed per tenant. '
|
||||
help=_('Number of security groups allowed per project. '
|
||||
'A negative value means unlimited.')),
|
||||
cfg.IntOpt('quota_security_group_rule',
|
||||
default=DEFAULT_QUOTA_SG_RULE,
|
||||
help=_('Number of security group rules allowed per tenant. '
|
||||
help=_('Number of security group rules allowed per project. '
|
||||
'A negative value means unlimited.')),
|
||||
]
|
||||
|
||||
@@ -90,18 +90,18 @@ security_group_quota_opts = [
|
||||
l3_quota_opts = [
|
||||
cfg.IntOpt('quota_router',
|
||||
default=DEFAULT_QUOTA_ROUTER,
|
||||
help=_('Number of routers allowed per tenant. '
|
||||
help=_('Number of routers allowed per project. '
|
||||
'A negative value means unlimited.')),
|
||||
cfg.IntOpt('quota_floatingip',
|
||||
default=DEFAULT_QUOTA_FIP,
|
||||
help=_('Number of floating IPs allowed per tenant. '
|
||||
help=_('Number of floating IPs allowed per project. '
|
||||
'A negative value means unlimited.')),
|
||||
]
|
||||
|
||||
# rbac_quota_opts from neutron/extensions/rbac.py
|
||||
rbac_quota_opts = [
|
||||
cfg.IntOpt('quota_rbac_policy', default=DEFAULT_QUOTA_RBAC,
|
||||
help=_('Default number of RBAC entries allowed per tenant. '
|
||||
help=_('Default number of RBAC entries allowed per project. '
|
||||
'A negative value means unlimited.'))
|
||||
]
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ class FlatTypeDriver(helpers.BaseTypeDriver):
|
||||
return segment
|
||||
|
||||
def allocate_tenant_segment(self, context, filters=None):
|
||||
# Tenant flat networks are not supported.
|
||||
# Project flat networks are not supported.
|
||||
return
|
||||
|
||||
def release_segment(self, context, segment):
|
||||
|
||||
@@ -58,7 +58,7 @@ class TypeManager(stevedore.named.NamedExtensionManager):
|
||||
invoke_on_load=True)
|
||||
LOG.info("Loaded type driver names: %s", self.names())
|
||||
self._register_types()
|
||||
self._check_tenant_network_types(cfg.CONF.ml2.tenant_network_types)
|
||||
self._check_project_network_types(cfg.CONF.ml2.project_network_types)
|
||||
self._check_external_network_type(cfg.CONF.ml2.external_network_type)
|
||||
|
||||
def _register_types(self):
|
||||
@@ -75,15 +75,15 @@ class TypeManager(stevedore.named.NamedExtensionManager):
|
||||
self.drivers[network_type] = ext
|
||||
LOG.info("Registered types: %s", self.drivers.keys())
|
||||
|
||||
def _check_tenant_network_types(self, types):
|
||||
self.tenant_network_types = []
|
||||
def _check_project_network_types(self, types):
|
||||
self.project_network_types = []
|
||||
for network_type in types:
|
||||
if network_type not in self.drivers:
|
||||
LOG.error("No type driver for tenant network_type: %s. "
|
||||
LOG.error("No type driver for project network_type: %s. "
|
||||
"Service terminated!", network_type)
|
||||
raise SystemExit(1)
|
||||
self.tenant_network_types.append(network_type)
|
||||
LOG.info("Tenant network_types: %s", self.tenant_network_types)
|
||||
self.project_network_types.append(network_type)
|
||||
LOG.info("Project network_types: %s", self.project_network_types)
|
||||
|
||||
def _check_external_network_type(self, ext_network_type):
|
||||
if ext_network_type and ext_network_type not in self.drivers:
|
||||
@@ -208,10 +208,10 @@ class TypeManager(stevedore.named.NamedExtensionManager):
|
||||
segments_db.update_network_segment(
|
||||
context, network_id, segmentation_id)
|
||||
|
||||
def create_network_segments(self, context, network, tenant_id):
|
||||
def create_network_segments(self, context, network, project_id):
|
||||
"""Call type drivers to create network segments."""
|
||||
segments = self._process_provider_create(network)
|
||||
filters = {'project_id': tenant_id}
|
||||
filters = {'project_id': project_id}
|
||||
with db_api.CONTEXT_WRITER.using(context):
|
||||
network_id = network['id']
|
||||
if segments:
|
||||
@@ -226,7 +226,7 @@ class TypeManager(stevedore.named.NamedExtensionManager):
|
||||
context, filters=filters)
|
||||
self._add_network_segment(context, network_id, segment)
|
||||
else:
|
||||
segment = self._allocate_tenant_net_segment(
|
||||
segment = self._allocate_project_net_segment(
|
||||
context, filters=filters)
|
||||
self._add_network_segment(context, network_id, segment)
|
||||
|
||||
@@ -302,11 +302,12 @@ class TypeManager(stevedore.named.NamedExtensionManager):
|
||||
def _allocate_segment(self, context, network_type, filters=None):
|
||||
driver = self.drivers.get(network_type)
|
||||
if isinstance(driver.obj, api.TypeDriver):
|
||||
return driver.obj.allocate_tenant_segment(context.session, filters)
|
||||
return driver.obj.allocate_tenant_segment(context.session,
|
||||
filters)
|
||||
return driver.obj.allocate_tenant_segment(context, filters)
|
||||
|
||||
def _allocate_tenant_net_segment(self, context, filters=None):
|
||||
for network_type in self.tenant_network_types:
|
||||
def _allocate_project_net_segment(self, context, filters=None):
|
||||
for network_type in self.project_network_types:
|
||||
segment = self._allocate_segment(context, network_type, filters)
|
||||
if segment:
|
||||
return segment
|
||||
|
||||
@@ -160,7 +160,7 @@ class TestOVNFunctionalBase(testlib_api.MySQLTestCaseMixin,
|
||||
ml2_config.cfg.CONF.set_override('extension_drivers',
|
||||
self._extension_drivers,
|
||||
group='ml2')
|
||||
ml2_config.cfg.CONF.set_override('tenant_network_types',
|
||||
ml2_config.cfg.CONF.set_override('project_network_types',
|
||||
['geneve'],
|
||||
group='ml2')
|
||||
ml2_config.cfg.CONF.set_override('vni_ranges',
|
||||
|
||||
@@ -1274,7 +1274,7 @@ class ValidatePortForwardingConfigurationTestCase(base.BaseTestCase):
|
||||
cfg.CONF.set_override(
|
||||
'enable_distributed_floating_ip', False, group='ovn')
|
||||
cfg.CONF.set_override('service_plugins', 'some_plugin,port_forwarding')
|
||||
cfg.CONF.set_override('tenant_network_types', 'geneve,vlan',
|
||||
cfg.CONF.set_override('project_network_types', 'geneve,vlan',
|
||||
group='ml2')
|
||||
utils.validate_port_forwarding_configuration()
|
||||
|
||||
@@ -1282,7 +1282,7 @@ class ValidatePortForwardingConfigurationTestCase(base.BaseTestCase):
|
||||
cfg.CONF.set_override(
|
||||
'enable_distributed_floating_ip', True, group='ovn')
|
||||
cfg.CONF.set_override('service_plugins', 'some_plugin')
|
||||
cfg.CONF.set_override('tenant_network_types', 'geneve,vlan',
|
||||
cfg.CONF.set_override('project_network_types', 'geneve,vlan',
|
||||
group='ml2')
|
||||
utils.validate_port_forwarding_configuration()
|
||||
|
||||
@@ -1290,7 +1290,7 @@ class ValidatePortForwardingConfigurationTestCase(base.BaseTestCase):
|
||||
cfg.CONF.set_override(
|
||||
'enable_distributed_floating_ip', True, group='ovn')
|
||||
cfg.CONF.set_override('service_plugins', 'some_plugin,port_forwarding')
|
||||
cfg.CONF.set_override('tenant_network_types', 'geneve,vxlan',
|
||||
cfg.CONF.set_override('project_network_types', 'geneve,vxlan',
|
||||
group='ml2')
|
||||
utils.validate_port_forwarding_configuration()
|
||||
|
||||
@@ -1298,7 +1298,7 @@ class ValidatePortForwardingConfigurationTestCase(base.BaseTestCase):
|
||||
cfg.CONF.set_override(
|
||||
'enable_distributed_floating_ip', True, group='ovn')
|
||||
cfg.CONF.set_override('service_plugins', 'some_plugin,port_forwarding')
|
||||
cfg.CONF.set_override('tenant_network_types', 'geneve,vlan',
|
||||
cfg.CONF.set_override('project_network_types', 'geneve,vlan',
|
||||
group='ml2')
|
||||
self.assertRaises(
|
||||
ovn_exc.InvalidPortForwardingConfiguration,
|
||||
|
||||
@@ -207,7 +207,7 @@ class TunnelTypeTestMixin:
|
||||
segment[api.SEGMENTATION_ID] = tunnel_id
|
||||
self.driver.release_segment(self.context, segment)
|
||||
|
||||
def test_allocate_tenant_segment(self):
|
||||
def test_allocate_project_segment(self):
|
||||
tunnel_ids = set()
|
||||
for x in range(TUN_MIN, TUN_MAX + 1):
|
||||
segment = self.driver.allocate_tenant_segment(self.context)
|
||||
|
||||
@@ -86,14 +86,14 @@ class TestOVNClientQosExtension(test_plugin.Ml2PluginV2TestCase):
|
||||
common_config.register_common_config_options()
|
||||
ovn_conf.register_opts()
|
||||
driver_type.register_ml2_drivers_geneve_opts()
|
||||
self.tenant_type = constants.TYPE_GENEVE
|
||||
self.project_type = constants.TYPE_GENEVE
|
||||
cfg.CONF.set_override('extension_drivers', self._extension_drivers,
|
||||
group='ml2')
|
||||
cfg.CONF.set_override('enable_distributed_floating_ip', 'False',
|
||||
group='ovn')
|
||||
cfg.CONF.set_override('external_network_type', 'vlan',
|
||||
group='ml2')
|
||||
cfg.CONF.set_override('tenant_network_types', [self.tenant_type],
|
||||
cfg.CONF.set_override('project_network_types', [self.project_type],
|
||||
group='ml2')
|
||||
cfg.CONF.set_override('vni_ranges', ['1:200'], group='ml2_type_geneve')
|
||||
cfg.CONF.set_override('max_header_size', 38, group='ml2_type_geneve')
|
||||
@@ -451,7 +451,7 @@ class TestOVNClientQosExtension(test_plugin.Ml2PluginV2TestCase):
|
||||
self.context, mock.ANY, self.networks[0], original_network)
|
||||
self.assertEqual(reference_ports, reviewed_port_ids)
|
||||
calls = [mock.call(mock.ANY, mock.ANY, self.ports[0].id,
|
||||
self.ports[0].network_id, self.tenant_type,
|
||||
self.ports[0].network_id, self.project_type,
|
||||
qos_policy_id, None)]
|
||||
self.mock_rules.assert_has_calls(calls)
|
||||
self.mock_rules.reset_mock()
|
||||
@@ -528,7 +528,7 @@ class TestOVNClientQosExtension(test_plugin.Ml2PluginV2TestCase):
|
||||
reset=True)
|
||||
self.assertEqual(reference_ports, reviewed_port_ids)
|
||||
calls = [mock.call(mock.ANY, mock.ANY, self.ports[0].id,
|
||||
self.ports[0].network_id, self.tenant_type,
|
||||
self.ports[0].network_id, self.project_type,
|
||||
qos_policy_id, None)]
|
||||
self.mock_rules.assert_has_calls(calls)
|
||||
self.mock_rules.reset_mock()
|
||||
@@ -561,7 +561,7 @@ class TestOVNClientQosExtension(test_plugin.Ml2PluginV2TestCase):
|
||||
self.assertEqual(reference_ports, reviewed_port_ids)
|
||||
calls = [mock.call(
|
||||
mock.ANY, mock.ANY, self.ports[0].id,
|
||||
self.ports[0].network_id, self.tenant_type, qos_policy_id,
|
||||
self.ports[0].network_id, self.project_type, qos_policy_id,
|
||||
None)]
|
||||
self.mock_rules.assert_has_calls(calls)
|
||||
self.mock_rules.reset_mock()
|
||||
@@ -614,12 +614,12 @@ class TestOVNClientQosExtension(test_plugin.Ml2PluginV2TestCase):
|
||||
# Ports updated from "update_port": self.ports[1], self.ports[4]
|
||||
updated_ports = [self.ports[1], self.ports[4]]
|
||||
calls = [mock.call(mock.ANY, self.txn, port.id,
|
||||
port.network_id, self.tenant_type,
|
||||
port.network_id, self.project_type,
|
||||
self.qos_policies[0].id, mock_qos_rules, lsp=None)
|
||||
for port in updated_ports]
|
||||
# Port updated from "update_network": self.ports[3]
|
||||
calls.append(mock.call(mock.ANY, self.txn, self.ports[3].id,
|
||||
self.ports[3].network_id, self.tenant_type,
|
||||
self.ports[3].network_id, self.project_type,
|
||||
self.qos_policies[0].id, mock_qos_rules))
|
||||
|
||||
# We can't ensure the call order because we are not enforcing any order
|
||||
|
||||
@@ -164,7 +164,7 @@ class TestOVNMechanismDriverBase(MechDriverSetupBase,
|
||||
cfg.CONF.set_override('extension_drivers',
|
||||
self._extension_drivers,
|
||||
group='ml2')
|
||||
cfg.CONF.set_override('tenant_network_types',
|
||||
cfg.CONF.set_override('project_network_types',
|
||||
['geneve'],
|
||||
group='ml2')
|
||||
cfg.CONF.set_override('vni_ranges',
|
||||
@@ -3493,7 +3493,7 @@ class OVNMechanismDriverTestCase(MechDriverSetupBase,
|
||||
if enable_metadata:
|
||||
ovn_conf.cfg.CONF.set_override('ovn_metadata_enabled', True,
|
||||
group='ovn')
|
||||
cfg.CONF.set_override('tenant_network_types',
|
||||
cfg.CONF.set_override('project_network_types',
|
||||
['geneve'],
|
||||
group='ml2')
|
||||
cfg.CONF.set_override('vni_ranges',
|
||||
|
||||
@@ -121,7 +121,7 @@ class FlatTypeTest(testlib_api.SqlTestCase):
|
||||
self.driver.reserve_provider_segment,
|
||||
self.context, segment)
|
||||
|
||||
def test_allocate_tenant_segment(self):
|
||||
def test_allocate_project_segment(self):
|
||||
self.assertIsNone(self.driver.allocate_tenant_segment(self.context))
|
||||
|
||||
def test_get_mtu(self):
|
||||
|
||||
@@ -60,7 +60,7 @@ class LocalTypeTest(base.BaseTestCase):
|
||||
observed = self.driver.reserve_provider_segment(self.context, segment)
|
||||
self.driver.release_segment(self.context, observed)
|
||||
|
||||
def test_allocate_tenant_segment(self):
|
||||
def test_allocate_project_segment(self):
|
||||
expected = {api.NETWORK_TYPE: p_const.TYPE_LOCAL}
|
||||
observed = self.driver.allocate_tenant_segment(self.context)
|
||||
self.assertEqual(expected, observed)
|
||||
|
||||
@@ -283,7 +283,7 @@ class VlanTypeTest(testlib_api.SqlTestCase):
|
||||
self.driver.physnet_mtus = {}
|
||||
self.assertEqual(0, self.driver.get_mtu('physnet1'))
|
||||
|
||||
def test_allocate_tenant_segment(self):
|
||||
def test_allocate_project_segment(self):
|
||||
cfg.CONF.set_override('network_vlan_ranges', TENANT_VLAN_RANGES,
|
||||
group='ml2_type_vlan')
|
||||
driver = type_vlan.VlanTypeDriver()
|
||||
@@ -297,7 +297,7 @@ class VlanTypeTest(testlib_api.SqlTestCase):
|
||||
self.assertLess(vlan_id, VLAN_MAX + 1)
|
||||
self.assertEqual(TENANT_NET, segment[api.PHYSICAL_NETWORK])
|
||||
|
||||
def test_allocate_tenant_segment_no_available(self):
|
||||
def test_allocate_project_segment_no_available(self):
|
||||
cfg.CONF.set_override('network_vlan_ranges', TENANT_VLAN_RANGES,
|
||||
group='ml2_type_vlan')
|
||||
driver = type_vlan.VlanTypeDriver()
|
||||
@@ -326,7 +326,7 @@ class VlanTypeTest(testlib_api.SqlTestCase):
|
||||
|
||||
class VlanTypeAllocationTest(testlib_api.SqlTestCase):
|
||||
|
||||
def test_allocate_tenant_segment_in_order_of_config(self):
|
||||
def test_allocate_project_segment_in_order_of_config(self):
|
||||
ranges = NETWORK_VLAN_RANGES + ['phys_net3:20:30']
|
||||
cfg.CONF.set_override('network_vlan_ranges',
|
||||
ranges,
|
||||
|
||||
@@ -703,7 +703,7 @@ class TestExternalNetwork(Ml2PluginV2TestCase):
|
||||
|
||||
network = self._create_external_network()
|
||||
# For external network, expected network type to be
|
||||
# tenant_network_types which is by default 'local'.
|
||||
# project_network_types which is by default 'local'.
|
||||
self.assertEqual(constants.TYPE_LOCAL,
|
||||
network['network'][pnet.NETWORK_TYPE])
|
||||
# No physical network specified, expected 'None'.
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
deprecations:
|
||||
- |
|
||||
The ``tenant_network_types`` option of the ML2 configuration has been
|
||||
deprecated and replaced with the ``project_network_types`` option.
|
||||
The old option name will continue to work as it does today, but will
|
||||
be removed in the ``2027.1`` release.
|
||||
@@ -101,7 +101,7 @@
|
||||
- { dest: '/etc/neutron/neutron.conf', section: 'DEFAULT', option: 'notification_drivers', value: 'ovn-qos' }
|
||||
- { dest: '/etc/neutron/plugins/ml2/ml2_conf.ini', section: 'ml2', option: 'mechanism_drivers', value: 'ovn' }
|
||||
- { dest: '/etc/neutron/plugins/ml2/ml2_conf.ini', section: 'ml2', option: 'type_drivers', value: 'geneve,vxlan,vlan,flat' }
|
||||
- { dest: '/etc/neutron/plugins/ml2/ml2_conf.ini', section: 'ml2', option: 'tenant_network_types', value: 'geneve' }
|
||||
- { dest: '/etc/neutron/plugins/ml2/ml2_conf.ini', section: 'ml2', option: 'project_network_types', value: 'geneve' }
|
||||
- { dest: '/etc/neutron/plugins/ml2/ml2_conf.ini', section: 'ml2_type_geneve', option: 'vni_ranges', value: '1:65536' }
|
||||
- { dest: '/etc/neutron/plugins/ml2/ml2_conf.ini', section: 'ml2_type_geneve', option: 'max_header_size', value: '38' }
|
||||
- { dest: '/etc/neutron/plugins/ml2/ml2_conf.ini', section: 'ovn', option: 'ovn_nb_connection', value: '"tcp:{{ ovn_db_ip }}:6641"' }
|
||||
|
||||
Reference in New Issue
Block a user