Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions components/images-openstack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ images:
neutron_openvswitch_agent: "ghcr.io/rackerlabs/understack/neutron:2026.1"
neutron_server: "ghcr.io/rackerlabs/understack/neutron:2026.1"
neutron_rpc_server: "ghcr.io/rackerlabs/understack/neutron:2026.1"
neutron_ovn_maintenance_worker: "ghcr.io/rackerlabs/understack/neutron:2026.1"
neutron_bagpipe_bgp: "ghcr.io/rackerlabs/understack/neutron:2026.1"
neutron_netns_cleanup_cron: "ghcr.io/rackerlabs/understack/neutron:2026.1"

Expand Down
19 changes: 19 additions & 0 deletions components/neutron/configmap-neutron-bin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1623,6 +1623,25 @@ data:
kill -TERM 1
}

$COMMAND
neutron-ovn-maintenance-worker.sh: |
#!/bin/bash

set -ex
COMMAND="${@:-start}"

function start () {
exec neutron-ovn-maintenance-worker \
--config-file /etc/neutron/neutron.conf \
--config-file /tmp/pod-shared/ovn.ini \
--config-file /etc/neutron/plugins/ml2/ml2_conf.ini \
--config-dir /etc/neutron/neutron.conf.d
}

function stop () {
kill -TERM 1
}

$COMMAND
neutron-server.sh: |
#!/bin/bash
Expand Down
10 changes: 10 additions & 0 deletions components/neutron/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ pod:
neutron_server:
- secret:
name: neutron-ks-etc
neutron_ovn_maintenance_worker:
- secret:
name: neutron-ks-etc

use_fqdn:
neutron_agent: false
Expand Down Expand Up @@ -179,6 +182,9 @@ dependencies:
rpc_server:
jobs:
- neutron-db-sync
ovn_maintenance_worker:
jobs:
- neutron-db-sync
ironic_agent:
jobs:
- neutron-db-sync
Expand All @@ -204,6 +210,10 @@ manifests:
daemonset_metadata_agent: false
daemonset_ovs_agent: false
deployment_rpc_server: false
deployment_ovn_maintenance_worker: true
# The janitor only needs the OVN maintenance worker. The chart enables the
# generic periodic worker by default; disable it.
deployment_periodic_worker: false
daemonset_sriov_agent: false
daemonset_l2gw_agent: false
daemonset_bagpipe_bgp: false
Expand Down
7 changes: 7 additions & 0 deletions python/neutron-understack/neutron_understack/l3_router/vrf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

from neutron_understack import config
from neutron_understack import evpn_compat
from neutron_understack import maintenance as understack_maintenance
from neutron_understack.api.definitions import understack_vni as apidef
from neutron_understack.l3_router import understack_vni_db

Expand Down Expand Up @@ -129,6 +130,12 @@ def get_plugin_type(cls):
def get_plugin_description(self):
return "Understack router VNI allocation plugin"

def ovn_maintenance_periodics(self, ovn_client):
LOG.warning("NETDEV ovn_maintenance_periodics called")
return [
understack_maintenance.NetdevRouterMaintenancePeriodics(self, ovn_client)
]

@staticmethod
@resource_extend.extends([apidef.COLLECTION_NAME])
def _extend_router_dict(router_res, router_db):
Expand Down
41 changes: 41 additions & 0 deletions python/neutron-understack/neutron_understack/maintenance.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
"""Periodics run in the OVN maintenance worker.

Proves the mechanism fires end to end (hook discovered, worker runs, once
cluster-wide) before the real reconciliation logic is added.
"""

# NOTE: Re-verify these symbols still exist on every neutron upgrade has_lock_periodic
# and MAINTENANCE_NB_IDL_LOCK_NAME coz they are neutron-internal module.
from neutron.plugins.ml2.drivers.ovn.mech_driver.ovsdb import maintenance
from oslo_log import log as logging

LOG = logging.getLogger(__name__)
RECONCILE_SPACING = 600 # Temp


class NetdevRouterMaintenancePeriodics:
"""Reconcile netdev-router Ironic state from the OVN maintenance worker.

Body is a no-op log line.
"""

def __init__(self, plugin, ovn_client):
self._plugin = plugin
# Take the maintenance lock so exactly one neutron-server runs these
# periodics.
LOG.warning(
"NETDEV periodic __init__; _nb_idl=%r",
getattr(ovn_client, "_nb_idl", "MISSING"),
)
self._idl = ovn_client._nb_idl.idl
self._idl.set_lock(maintenance.MAINTENANCE_NB_IDL_LOCK_NAME)

@property
def has_lock(self):
return self._idl.has_lock

@maintenance.has_lock_periodic(spacing=RECONCILE_SPACING, run_immediately=False)
def reconcile_netdev_routers(self):
# No-op: proves the periodic is scheduled and fires on exactly one
# neutron-server. host= lets us confirm it is not firing per-worker.
LOG.debug("netdev-router reconcile: placeholder, no action yet")
Loading