Skip to content

[OVN] Backport duplicate lswitch and NAT gateway_port - #342

Merged
stackhpc-zuul[bot] merged 3 commits into
stackhpc/2026.1from
2026.1-duplicate-logical-switch
Sep 14, 2026
Merged

stackhpc-zuul[bot] merged 3 commits into
stackhpc/2026.1from
2026.1-duplicate-logical-switch

Conversation

@bbezak

@bbezak bbezak commented Sep 10, 2026

Copy link
Copy Markdown
Member

Three OVN commits for 2026.1.

Commit Upstream
[OVN] Do not create a duplicated Logical_Switch 1000174open, not merged yet
[OVN] Add missing unit test scaffolding not a backport — test-only lines needed to make the commit above pass, from openstack/neutron@f0f77d08ab
[OVN] Only set NAT gateway_port when distributed FIP is enabled 987187 — merged on master; needed because of our HCG backports (#286, #332), upstream won't backport it to stable/2026.1

A Logical_Switch created before persist_uuid was used has a random
register UUID and is only identifiable by its "neutron-<net_id>"
name, as stated in change
Icc27c2b8825d7f96c9dac87dec8bbb55d493d942: "The name of the LS
continues to be neutron-$UUID to match existing usage and to keep
lookups by name working". Two code paths still resolve the register
by UUID:

* The maintenance task passes the Neutron network ID to
  ``get_lswitch``, that since change
  If59ac6a6fc59382904a6cdf0790fcd7a773b7cfe requires the
  Logical_Switch name. The lookup then matches only a register UUID
  or a name equal to that raw ID, the switch is not found and
  ``_fix_create_update`` takes the create branch (``_fix_delete``
  is affected too).

* ``AddNetworkCommand.run_idl`` probes the Logical_Switch table only
  by register UUID, so a pre-existing register with the same name is
  invisible and ``may_exist`` does not protect against it.

The Logical_Switch table has no index in the OVN_Northbound schema,
thus ovsdb-server accepts the resulting second register with a
duplicated name. The ports created afterwards are resolved by name
and land on any of the two registers; the duplicated one has no
router port and no metadata port, so the instances booted on it have
neither gateway nor metadata. The port deletion is resolved by name
too and leaves orphan Logical_Switch_Ports behind.

The maintenance resource map now retrieves the register by name and
``AddNetworkCommand`` falls back to a name lookup before inserting,
restoring the duplicated name check ``LsAddCommand`` performs.

This is not only an upgrade artifact: ``ovs_persist_uuid_supported``
returns False on OVS older than 3.1.5/3.2.3/3.3.1, thus a freshly
deployed cloud running an older OVS also creates random UUID
registers and is exposed to the same duplication.

Closes-Bug: #2162974
Related-Change: If59ac6a6fc59382904a6cdf0790fcd7a773b7cfe
Related-Change: Icc27c2b8825d7f96c9dac87dec8bbb55d493d942
Change-Id: I18d78af03541f627ad75308248f0186beecd16ac
Signed-off-by: To Minh Hien <tominhhien97@gmail.com>
(cherry picked from commit 745d9da5895c5016f67ea37c71c9fb8c44af0e1b)
@bbezak
bbezak requested a review from a team as a code owner September 10, 2026 12:44
@mnasiadka mnasiadka closed this Sep 10, 2026
@mnasiadka mnasiadka reopened this Sep 10, 2026
priteau
priteau previously approved these changes Sep 10, 2026
@bbezak
bbezak marked this pull request as draft September 11, 2026 11:40
Test-only subset of openstack/neutron@f0f77d08ab, which landed on
master after stable/2026.1 branched: the uuid/uuidutils imports in
test_commands.py and FakeOvsdbTransaction.idl. The rest of that change
is a feature and bumps ovsdbapp to 2.18.0, so it cannot be backported.

Needed-By: #342

Signed-off-by: Bartosz Bezak <bartosz@stackhpc.com>
@bbezak
bbezak marked this pull request as ready for review September 14, 2026 09:33
The guard for setting gateway_port on FIP NAT entries checked
reside-on-redirect-chassis on the LRP, but this option is always
'true' for non-DVR setups with provider networks, even on gateway
routers pinned to a chassis. This caused northd to reject the NAT
rule and not generate DNAT flows, breaking FIP connectivity after
ovn-controller restart.

Only set gateway_port when distributed floating IPs are enabled
(is_ovn_distributed_floating_ip). Without it, routers get pinned
to a chassis (LR.options.chassis), making northd classify them as
L3 gateway routers that reject gateway_port on NAT rules. This
check is race-free unlike checking LR.options.chassis at FIP
creation time, since the router may not be pinned yet.

Closes-Bug: #2150866
Change-Id: I772b687fb92eb9bbcafbf401b9e70c6124f78716
Signed-off-by: Eduardo Olivares <eolivare@redhat.com>
Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
(cherry picked from commit 299b0c5)
@bbezak bbezak changed the title [OVN] Do not create a duplicated Logical_Switch [OVN] Backport duplicate lswitch and NAT gateway_port Sep 14, 2026
@mnasiadka mnasiadka added the gate Zuul: Gate this patch label Sep 14, 2026
@stackhpc-zuul
stackhpc-zuul Bot merged commit a66cf6b into stackhpc/2026.1 Sep 14, 2026
2 checks passed
@stackhpc-zuul
stackhpc-zuul Bot deleted the 2026.1-duplicate-logical-switch branch September 14, 2026 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gate Zuul: Gate this patch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants