Retire the OVN cleanup scripts into kubectl us-net
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Refactor
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- kubernetes, python
- Domain
- devops, networking, tooling
Research direction
Start with scripts/cleanup_dead_ovn_ha_chassis.py, scripts/cleanup_orphaned_ovn_uplinks.py, and the router audit/repair entry points; read the liveness logic in python/neutron-understack/neutron_understack/routers.py and review #2342. Done requires an agreed fleet-wide workflow, decisions on orphan teardown, equivalent coverage for the listed gaps, and retirement of the scripts.
Written by the indexing model from the issue text.
Description
kubectl us-net router audit / router repair (added for #2330) now overlap several one-off scripts under scripts/. The intent is for the command to become the single entry point and for the scripts to be retired.
Overlap today
scripts/cleanup_dead_ovn_ha_chassis.py
- Phase 1 — stale
HA_Chassisremoval: partially covered.router repaironly removes stale members from per-network groups that have no live members, and only for the single router named on the command line. The script sweeps everyHA_Chassisrow in the NB DB. - Phase 2 — empty per-network HCG repopulation: covered, under the same contract (liveness from the SB
Chassisregistry,options:chassisas the primary source, fallback toneutron-<router_id>only when it resolves to exactly one live chassis, priority 32767). - Phase 3 — opt-in orphan-network teardown (
--delete-orphaned-networks): no equivalent.
scripts/cleanup_orphaned_ovn_uplinks.py
- Detects
uplink-*LSPs with no matching Neutron port: no equivalent. The command's uplink audit runs Neutron-to-OVN only.
Blockers
- The coverage gaps in #2342 — specifically stale members in otherwise-live groups, and orphaned
uplink-*LSPs. - No fleet-wide mode.
auditandrepairare deliberately single-router (an early--allflag was removed). Retirement needs either a fleet-wide entry point or an accepted "loop over routers" workflow. - A decision on phase 3. Its teardown is destructive and confirms with Neutron that a network is genuinely gone before deleting anything. Worth deciding whether that belongs in the same tool as the narrow, safe field-level repair, or stays separate.
Note
Phase 1's original rationale has partly expired. Its docstring says a single stale HA_Chassis row anywhere blocks link_vxlan_network_ha_chassis_group's fleet-wide "exactly one distinct live chassis" inference, but that function now filters non-live rows before inferring (python/neutron-understack/neutron_understack/routers.py). What remains is hygiene, and not tripping neutron_ovn_db_sync_util.
Related
- #2330 — the OVN NB drift that motivated the commands
- #2342 — coverage gaps that block this
- #2245 — router uplink dynamic VLAN segment leaked on interface removal; overlaps the uplink cleanup story
- Dominant language
- Python
- Stars
- 13
- Forks
- 12
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 73
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rackerlabs/understack
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
rackerlabs/understack#2193 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
rackerlabs/understack#2346 ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 68/100
rackerlabs/understack#2342 ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 72/100
rackerlabs/understack#2335 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
rackerlabs/understack#2330 · 3 comments ·
All issues in rackerlabs/understack
Similar issues
-
documentation help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
simonw/sqlite-utils#872 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100