Add OVN metadata MTU patch
Change-Id: I9b261f15f647ef78b7535e2ed0a8e7db4528942e
diff --git a/images/neutron/Dockerfile b/images/neutron/Dockerfile
index 854ad0a..6f6ad73 100644
--- a/images/neutron/Dockerfile
+++ b/images/neutron/Dockerfile
@@ -6,6 +6,8 @@
ARG NEUTRON_GIT_REF=804d6006e3f09c214d6de8a3f23de70c44f1d51d
ADD --keep-git-dir=true https://opendev.org/openstack/neutron.git#${NEUTRON_GIT_REF} /src/neutron
RUN git -C /src/neutron fetch --unshallow
+COPY patches/neutron /patches/neutron
+RUN git -C /src/neutron apply --verbose /patches/neutron/*
ARG NEUTRON_VPNAAS_GIT_REF=990e478b1e6db459b6cb9aec53ce808e2957bb65
ADD --keep-git-dir=true https://opendev.org/openstack/neutron-vpnaas.git#${NEUTRON_VPNAAS_GIT_REF} /src/neutron-vpnaas
RUN git -C /src/neutron-vpnaas fetch --unshallow
diff --git a/images/neutron/patches/neutron/0001-fix-ovn-set-mtu-in-external_ids-correctly.patch b/images/neutron/patches/neutron/0001-fix-ovn-set-mtu-in-external_ids-correctly.patch
new file mode 100644
index 0000000..f27bfe6
--- /dev/null
+++ b/images/neutron/patches/neutron/0001-fix-ovn-set-mtu-in-external_ids-correctly.patch
@@ -0,0 +1,39 @@
+From cabb48e339a1f646b4a820d41eaef5c34e678708 Mon Sep 17 00:00:00 2001
+From: Mohammed Naser <mnaser@vexxhost.com>
+Date: Fri, 21 Feb 2025 15:20:18 -0500
+Subject: [PATCH] Add MTU for all non-external ports
+
+In the previous fix, it had brought the MTU lookup within the
+if branch if the vnic_type was VNIC_REMOTELY_MANAGED which
+meant that it didn't get added for anything other than that
+typer of interface.
+
+Since the MTU is used further later, we want to capture it
+because it goes into the OvnPortInfo which will go into the
+external_ids which will be captured by the metadata agent
+to fix the correct MTU.
+
+Closes-Bug: #2053274
+Related-Change-Id: I7ff300e9634e5e3fc68d70540392109fd8b9babc
+Change-Id: Ib4ee7e0e8b13141739f5a8600333be856afd4a4e
+---
+
+diff --git a/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_client.py b/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_client.py
+index aa1c989..f18b558 100644
+--- a/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_client.py
++++ b/neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/ovn_client.py
+@@ -473,11 +473,11 @@
+ # HA Chassis Group will bind the port to the highest
+ # priority Chassis
+ if port_type != ovn_const.LSP_TYPE_EXTERNAL:
++ port_net = self._plugin.get_network(context, port['network_id'])
++ mtu = str(port_net['mtu'])
++
+ if (bp_info.vnic_type == portbindings.VNIC_REMOTE_MANAGED and
+ ovn_const.VIF_DETAILS_PF_MAC_ADDRESS in bp_info.bp_param):
+- port_net = self._plugin.get_network(
+- context, port['network_id'])
+- mtu = str(port_net['mtu'])
+ options.update({
+ ovn_const.LSP_OPTIONS_VIF_PLUG_TYPE_KEY: 'representor',
+ ovn_const.LSP_OPTIONS_VIF_PLUG_MTU_REQUEST_KEY: mtu,
diff --git a/releasenotes/notes/fix-ovn-mtu-d33352771a65e744.yaml b/releasenotes/notes/fix-ovn-mtu-d33352771a65e744.yaml
new file mode 100644
index 0000000..2a27a9f
--- /dev/null
+++ b/releasenotes/notes/fix-ovn-mtu-d33352771a65e744.yaml
@@ -0,0 +1,6 @@
+---
+issues:
+ - The MTU for the metadata interfaces for OVN was not being set correctly,
+ leading to a mismatch between the MTU of the metadata interface and the
+ MTU of the network. This has been fixed with a Neutron change to ensure
+ the ``neutron:mtu`` value in ``external_ids`` is set correctly.