← Back to Pull requests

Align VMI MAC collision detection with allocated interfaces #690

Closed
unknown closed this pull request without merging on Sep 28, 2026 05:33 UTC
View on GitHub
unknown unknown commented on Aug 31, 2026 19:58 UTC
Author

What this PR does / why we need it:

KubeMacPool does not allocate unmanaged pod-network interfaces
(l2bridge / bridge / passt on pod: {}), including primary UDN.
Collision detection is not L2-domain-aware: it treats MACs as
cluster-wide. As a result, Isolated PUDNs may reuse the same
OVN IP-derived MAC (0a:58 + IPv4) on different L2 domains; that
is not a dataplane collision.

On a given CUDN/PUDN L2, OVN-K already owns uniqueness: IPAM for
auto-assigned MACs, and (on primary layer2 with preconfigured UDN
addresses) a per-network MAC registry that rejects duplicate user
MACs. KubeMacPool must stay out of that L2 rather than emit a
second, topology-agnostic alert.

This PR therefore aligns collision detection with allocation:
masquerade or Multus only. Status MACs are joined to spec by name,
so the VMI cache keeps spec networks and interfaces. Unmanaged
primary UDN MACs are not alerted on.

https://redhat.atlassian.net/browse/CNV-95971

Special notes for your reviewer:

  • Unplug of the last managed NIC while the VMI stays Running is

  • handled in a follow-up commit: that VMI is dropped from collision
    tracking because peers are not reconciled on that change.
  • E2E uses bridge + pod: {} with a shared MAC as the unmanaged

  • pod-network stand-in (IsInterfaceSupported == false). kubevirtci
    has no UDN CRDs, passt feature gate, or l2bridge binding plugin.

    Release note:
    <!-- Write your release note:
    1. Enter your extended release note in the below block. If the PR requires additional action from users switching to the new release, include the string "action required".
    2. Follow the instructions for writing a release note from k8s: https://git.k8s.io/community/contributors/guide/release-notes.md
    3. If no release note is required, just write "NONE".
    -->

    ``release-note
    MAC collision detection now ignores interfaces KubeMacPool does not allocate, such as isolated primary UDN pod-network MACs.
    ``

    <!-- This is an auto-generated comment: release notes by coderabbit.ai -->

    Summary by CodeRabbit

    Bug Fixes
    Improved MAC collision detection to consider only valid, supported network interfaces.
    Prevented unmanaged, unsupported, unnamed, or invalid pod-network interfaces from triggering false collision alerts.
    Continued detecting collisions on supported masquerade pod-network and Multus interfaces.
    Cleared collision tracking when a virtual machine no longer has managed network interfaces.
    Preserved relevant network and interface details during collision processing while excluding unrelated configuration.
    * Normalized eligible MAC addresses before comparing them for collisions.
    <!-- end of auto-generated comment: release notes by coderabbit.ai -->

    Diff: 347 lines (+260 / -87) across 4 files Reviewer: ormergi Review duration: 39454m
    All Vouch review confidence checks passed
    Residual risk 0.17 = Change Risk (0.42) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.42 · 347 lines diff across 4 files
    0.42
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.350
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #690"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 42.4% (MEDIUM) · Higher = larger blast radius
    42.4%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 16.8% · Safe to merge
    16.8%