api-plugin-ovn forcibly overrides charm-neutron-api's default-tenant-network-type

Bug #1936773 reported by Nobuto Murata
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Neutron API Charm
Triaged
High
Unassigned
OpenStack Neutron API OVN Plugin Charm
Triaged
High
Unassigned

Bug Description

charm-neutron-api allows users setting "default-tenant-network-type" which network type should be used by default as a tenant network.
https://jaas.ai/neutron-api#charm-config-default-tenant-network-type

One of the use cases is setting vlan or flat prior to overlay networks such as gre or vxlan. However, by using charm-neutron-api-plugin-ovn, the list in neutron.conf will have "geneve" at the top of the list and it will be used by default.

[when default-tenant-network-type is empty(default) in neutron-api charm config]
tenant_network_types = geneve,gre,vlan,flat,local

[actual value when default-tenant-network-type is vlan]
tenant_network_types = geneve,vlan,gre,flat,local

[expected value when default-tenant-network-type is vlan]
tenant_network_types = vlan,geneve,gre,flat,local

Nobuto Murata (nobuto)
description: updated
Revision history for this message
Nobuto Murata (nobuto) wrote (last edit ):

default_tenant_network_type is not passed from neutron-api to neutron-api-plugin-ovn.

machine-1-lxd-3: 05:01:52 INFO unit.neutron-api-plugin-ovn/0.juju-log neutron-plugin:59: DEBUG: neutron_config_data="{'core_plugin': 'neutron.plugins.ml2.plugin.Ml2Plugin', 'neutron_security_groups': True, 'tenant_network_types': 'vlan,gre,flat,local', 'restart_trigger': None, 'extension_drivers': 'dns_domain_ports', 'mechanism_drivers': 'openvswitch,hyperv,l2population', 'service_plugins': 'router,metering,segments,neutron_dynamic_routing.services.bgp.bgp_plugin.BgpPlugin'}"

Revision history for this message
Alex Kavanagh (ajkavanagh) wrote :

Triaged: High

Confirmed that the ovn plugin doesn't get the default-tenant-network-type and forces 'geneve' as the first item here:

https://github.com/openstack/charm-neutron-api-plugin-ovn/blob/c78ae6f8f307d34a29f9c9b810c7c44205c39e29/src/lib/charm/openstack/neutron_api_plugin_ovn.py#L228

    def tenant_network_types(self, neutron_tenant_network_types=None):
        """Provide list of tenant network types for current OpenStack release.

        The ``network_types`` class variable dfines which types to
        prepend and must be set in the release specific charm classes.

        :param neutron_tenant_network_types: Comma separated list of tenant
                                             network types from Neutron.
        :type neutron_tenant_network_types: Optional[str]
        :returns: List of tenant network types
        :rtype: List[str]
        """
        neutron_tenant_network_types = neutron_tenant_network_types or ''
        return self.network_types + [
            network_type
            for network_type in neutron_tenant_network_types.split(',')
        ]

self.network_types = ['geneve'] as a default.

To fix this, we have to float the default-default-tenant-network-type into the plugin relation-data and then make use of it in the plugin.

Changed in charm-neutron-api-plugin-ovn:
importance: Undecided → High
status: New → Triaged
Changed in charm-neutron-api:
importance: Undecided → High
status: New → Triaged
Revision history for this message
Frode Nordahl (fnordahl) wrote :

I concur with your assessment, Alex.

The way the subordinate plugin framework is laid out in the neutron-api charm the existing helper functions for the NeutronCCContext class does not appear to be used at all when these decisions are outsourced to a subordinate.

So if the plugin subordinate could also get the default-tenant-network-type it could make a better choice.

Note that the reasoning behind the current layout is to always use geneve when OVN is in use as gre and vxlan are not supported.

But the non-overlay types should be fine to use, so allowing the user to choose that through the existing option would be a good way forward.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.