Segmentation ID should be lower or equal to 4095

Bug #1951517 reported by Mikhail Okhrimenko
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Invalid
Undecided
Unassigned

Bug Description

Hi,

I am trying to set up OVN using Openstack.

OS: CentOS Stream release 8
OVN 21.06
Openstack wallaby

When creating a network in openstack, we get an error:

"Segmentation ID should be lower or equal to 4095."

ml2 config:

# ML2 general
[ml2]
type_drivers = flat,vlan,vxlan,geneve
tenant_network_types = geneve
mechanism_drivers = ovn
extension_drivers = port_security,dns
physical_network_mtus = vlan:1500,floating:1500
path_mtu = 1558
overlay_ip_version = 4

# ML2 geneve networks
[ml2_type_geneve]
vni_ranges = 5000:6000
max_header_size = 38

# ML2 VLAN networks
[ml2_type_vlan]
network_vlan_ranges = vlan:3900:3999

# ML2 VXLAN networks
[ml2_type_vxlan]
vni_ranges = 5000:6000

# Security groups
[securitygroup]
enable_security_group = True
firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver

[ovn]
ovn_nb_connection = tcp:<IP>:6641
ovn_sb_connection = tcp:<IP>:6642
ovn_l3_scheduler = leastloaded
ovn_metadata_enabled = True
isolated_metadata = True

When I execute the command
$ ovn-nbctl get NB_Global. options:max_tunid
or
$ ovn-sbctl get SB_Global. options:max_tunid
I get "4095"

If I manually try to change max_tunid using the command
$ ovn-nbctl set NB_Global. options:max_tunid="16777215"
or
$ ovn-sbctl set SB_Global. options:max_tunid="16777215"
then no change occurs.

How can I change max_tunid from 4095 to 16777215 for supporting geneve or vxlan networks in Openstack.

Tags: ovn
Hongbin Lu (hongbin.lu)
tags: added: ovn
Revision history for this message
Rodolfo Alonso (rodolfo-alonso-hernandez) wrote :

Hello Mikhail:

"max_tunid" is a read only parameter set by OVN (Neutron can only read it). It is used to determine the capacity of the cluster depending on the tunnel types enabled for encapsulation.

This option is useful only when VXLAN is enabled, due to limitations in the protocol header. For more info, please read [1].

In a nutshell, if you allow VXLAN, then the "max_tunid" value will be reduced to 4095. If not, the value will be 16711680 (0xFF0000).

Regards.

[1]https://<email address hidden>/msg06771.html

Changed in neutron:
status: New → Invalid
Revision history for this message
Mikhail Okhrimenko (mihter) wrote :
Download full text (3.3 KiB)

Hi, Rodolfo

Thank you for your answer.

I tried to leave only geneve and the flat in the ml2 settings. Removed ml2_type_vlan and ml2_type_vxlan from config, changed directive type_drivers = flat, geneve.

The error remains the same, nothing has changed.

I see an error in the neutron server logs:

2021-11-22 09:20:52.305 13 INFO neutron.db.segments_db [req-d05021d8-6141-4de5-bf36-3f2a54cd3feb f0488da431084a9c9c706b84d395d69b 6262abefa5f84685845dc3d5d541f092 - default default] Added segment 9d86fc06-6398-4daf-9c11-2a7c35b895ce of type geneve for network e7ab4781-afc4-456d-8749-2cf9d72e7157
2021-11-22 09:20:52.371 13 ERROR neutron.plugins.ml2.managers [req-d05021d8-6141-4de5-bf36-3f2a54cd3feb f0488da431084a9c9c706b84d395d69b 6262abefa5f84685845dc3d5d541f092 - default default] Mechanism driver 'ovn' failed in create_network_precommit: neutron_lib.exceptions.InvalidInput: Invalid input for operation: Segmentation ID should be lower or equal to 4095.
2021-11-22 09:20:52.371 13 ERROR neutron.plugins.ml2.managers Traceback (most recent call last):
2021-11-22 09:20:52.371 13 ERROR neutron.plugins.ml2.managers File "/usr/lib/python3.6/site-packages/neutron/plugins/ml2/managers.py", line 477, in _call_on_drivers
2021-11-22 09:20:52.371 13 ERROR neutron.plugins.ml2.managers getattr(driver.obj, method_name)(context)
2021-11-22 09:20:52.371 13 ERROR neutron.plugins.ml2.managers File "/usr/lib/python3.6/site-packages/neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py", line 500, in create_network_precommit
2021-11-22 09:20:52.371 13 ERROR neutron.plugins.ml2.managers self._validate_network_segments(context.network_segments)
2021-11-22 09:20:52.371 13 ERROR neutron.plugins.ml2.managers File "/usr/lib/python3.6/site-packages/neutron/plugins/ml2/drivers/ovn/mech_driver/mech_driver.py", line 473, in _validate_network_segments
2021-11-22 09:20:52.371 13 ERROR neutron.plugins.ml2.managers raise n_exc.InvalidInput(error_message=m)
2021-11-22 09:20:52.371 13 ERROR neutron.plugins.ml2.managers neutron_lib.exceptions.InvalidInput: Invalid input for operation: Segmentation ID should be lower or equal to 4095.
2021-11-22 09:20:52.371 13 ERROR neutron.plugins.ml2.managers
2021-11-22 09:20:52.374 13 INFO neutron.pecan_wsgi.hooks.translation [req-d05021d8-6141-4de5-bf36-3f2a54cd3feb...

Read more...

Revision history for this message
Mikhail Okhrimenko (mihter) wrote :

I forgot to change the encapsulation type from geneve,vxlan to geneve with the command
$ ovs-vsctl set open. external-ids:ovn-encap-type=geneve
now everything works. Thanks to all!

Revision history for this message
sharif uddin (shorif2000) wrote :
Revision history for this message
sharif uddin (shorif2000) wrote :

here is my file

sudo grep -v '^#' /etc/neutron/plugins/ml2/ml2_conf.ini
[DEFAULT]

[ml2]

type_drivers = local,flat,vlan,geneve

tenant_network_types = geneve

mechanism_drivers = ovn

extension_drivers = port_security

overlay_ip_version = 4

[ml2_type_flat]

flat_networks = provider

[ml2_type_geneve]

vni_ranges = 1:65536

max_header_size = 38

[ml2_type_gre]

[ml2_type_vlan]

network_vlan_ranges = enp1s0,enp7s0

[ml2_type_vxlan]

vni_ranges = 1:1000

[ovs_driver]

[securitygroup]

enable_security_group = true

enable_ipset = true

[sriov_driver]

[ovn]
ovn_nb_connection = tcp:192.168.122.124:6641
ovn_sb_connection = tcp:192.168.122.124:6642
ovn_l3_scheduler = leastloaded

Revision history for this message
Ryan M Belgrave (rmb1993) wrote :

This still happens on Zed. Was able to fix it by setting this in the ml2_conf.ini

[ml2_type_geneve]
vni_ranges = 1:4094

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.