Skip to content

fix(api): make tenant FQDNs + FNN detection IPv6-aware - #4632

Merged
chet merged 1 commit into
NVIDIA:mainfrom
chet:gh-issue-2406
Aug 7, 2026
Merged

fix(api): make tenant FQDNs + FNN detection IPv6-aware#4632
chet merged 1 commit into
NVIDIA:mainfrom
chet:gh-issue-2406

Conversation

@chet

@chet chet commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

As it stood, the tenant FQDN fallback grabbed whichever physical address happened to come out of a HashMap, then only knew how to turn dotted IPv4 into a DNS label. That made IPv6-only names invalid and let a dual-stack name change with map iteration order.

So, this picks IPv4 first for compatibility, uses the lowest address within each family, and runs the fallback through the existing address_to_hostname formatter. It also teaches smells_like_fnn about /126 and narrower IPv6 linknets, documents why gateway_cidr keeps the segment prefix length, and removes the unused next_machine_interface_v4_ip path that could never support IPv6 allocation.

The result is a small cleanup of the remaining IPv4-only assumptions without changing the supported VPC migration model.

Related issues

Type of Change

  • Add - New feature or capability
  • Change - Changes in existing functionality
  • Fix - Bug fixes
  • Remove - Removed features or deprecated functionality
  • Internal - Internal changes (refactoring, tests, docs, etc.)

Breaking Changes

  • This PR contains breaking changes

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • No testing required (docs, internal refactor, etc.)

Additional Notes

UpdateVpcVirtualization is deliberately unchanged. ETV -> FNN is the only supported direction, and FNN already accepts every segment type and address family ETV can use; adding guards for reverse transitions would make an unsupported path look intentional.

Closes #2406

@chet
chet requested a review from a team as a code owner August 5, 2026 22:11
@chet

chet commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

@chet I will perform a complete review of the current changes in #4632.

ᕱᕱ

✅ Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@chet, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 16 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 83d5791b-0cd6-4e6f-82ca-8b245cfd5dca

📥 Commits

Reviewing files that changed from the base of the PR and between 9d296f6 and 2081a7f.

📒 Files selected for processing (4)
  • crates/api-core/src/handlers/dpu.rs
  • crates/api-db/src/host_naming/mod.rs
  • crates/api-db/src/ip_allocator.rs
  • crates/api-model/src/network_prefix.rs

Summary by CodeRabbit

  • Bug Fixes

    • Physical IP selection is now deterministic, preferring the lowest IPv4 address, then the lowest IPv6 address.
    • Tenant hostnames are preserved when configured and safely derived when needed.
    • IPv6 network prefix detection now correctly handles /126 and narrower prefixes.
    • Clear errors are retained when no physical address is available.
  • Improvements

    • Improved validation for gateway formatting, network prefixes, and hostname generation.
    • Removed a deprecated IP allocation path.

Walkthrough

The PR makes DPU physical IP selection deterministic, centralizes tenant FQDN construction, exposes IP hostname conversion, extends IPv6 FNN detection, and removes the deprecated PostgreSQL IPv4 allocation path.

Changes

Network and DPU addressing

Layer / File(s) Summary
Network prefix gateway and FNN contracts
crates/api-model/src/network_prefix.rs
NetworkPrefix documents gateway and FNN behavior. IPv6 prefixes with /126 or narrower lengths now qualify. Tests cover gateway formatting, missing gateways, thresholds, and VPC association.
Deterministic DPU address and FQDN flow
crates/api-core/src/handlers/dpu.rs, crates/api-db/src/host_naming/mod.rs
DPU handling selects the lowest IPv4 address, then the lowest IPv6 address. Configured tenant hostnames remain unchanged. Derived FQDNs use address-based hostname conversion. The formatter is now public. Tests cover address ordering and FQDN cases.
Deprecated allocator path removal
crates/api-db/src/ip_allocator.rs
The deprecated PostgreSQL IPv4 allocation function and its unused SQL-related imports are removed.

Estimated code review effort: 3 (Moderate) | ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the primary IPv6-related fixes to tenant FQDN generation and FNN detection.
Description check ✅ Passed The description accurately explains the IPv6 fixes, deterministic address selection, cleanup, testing, and migration scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/api-core/src/handlers/dpu.rs`:
- Around line 384-386: Update the error message passed to CarbideError::internal
in the physical IP lookup error path to use the lowercase phrase “physical IP
address not found,” preserving the existing error handling.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 08dde7e8-05b2-46ef-87a2-c66d463e65b4

📥 Commits

Reviewing files that changed from the base of the PR and between 78eb0e6 and b1b57cc.

📒 Files selected for processing (4)
  • crates/api-core/src/handlers/dpu.rs
  • crates/api-db/src/host_naming/mod.rs
  • crates/api-db/src/ip_allocator.rs
  • crates/api-model/src/network_prefix.rs
💤 Files with no reviewable changes (1)
  • crates/api-db/src/ip_allocator.rs

Comment thread crates/api-core/src/handlers/dpu.rs
@chet

chet commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

@chet I will perform a complete review of the current changes in #4632.

ᕱᕱ

✅ Action performed

Full review finished.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@chet

chet commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@chet I will perform a complete review of the current changes in #4632.

ᕱᕱ

✅ Action performed

Full review finished.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@crates/api-core/src/handlers/dpu.rs`:
- Around line 1574-1581: Replace the value_scenarios! usage around
tenant_interface_fqdn with scenarios! so the returned Result is preserved.
Define each scenario’s expected successful or failing outcome using
Outcome::Yields(...), and remove the unwrap() call from the run closure.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 191fc16f-b5de-40fb-b6c1-9391803df71f

📥 Commits

Reviewing files that changed from the base of the PR and between 9d296f6 and a116178.

📒 Files selected for processing (4)
  • crates/api-core/src/handlers/dpu.rs
  • crates/api-db/src/host_naming/mod.rs
  • crates/api-db/src/ip_allocator.rs
  • crates/api-model/src/network_prefix.rs
💤 Files with no reviewable changes (1)
  • crates/api-db/src/ip_allocator.rs

Comment thread crates/api-core/src/handlers/dpu.rs Outdated
As it stood, the tenant FQDN fallback grabbed whichever physical address happened to come out of a `HashMap`, then only knew how to turn dotted IPv4 into a DNS label. That made IPv6-only names invalid and let a dual-stack name change with map iteration order.

So, this picks IPv4 first for compatibility, uses the lowest address within each family, and runs the fallback through the existing `address_to_hostname` formatter. It also teaches `smells_like_fnn` about `/126` and narrower IPv6 linknets, documents why `gateway_cidr` keeps the segment prefix length, and removes the unused `next_machine_interface_v4_ip` path that could never support IPv6 allocation.

I left VPC virtualization updates alone. `ETV -> FNN` is the only supported direction, and FNN already accepts every segment type and address family ETV can use; adding reverse-transition guards would make an unsupported path look intentional.

The table tests cover stable IPv4/IPv6 selection, IPv6-safe FQDNs, gateway formatting, and both FNN prefix cutoffs.

This supports NVIDIA#2406

Signed-off-by: Chet Nichols III <chetn@nvidia.com>
@chet

chet commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai full_review, thanks!

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@chet I will perform a complete review of the current changes in #4632.

ᕱᕱ

⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 16 minutes.

@chet
chet enabled auto-merge (squash) August 7, 2026 17:01
@chet
chet merged commit 8fcf14a into NVIDIA:main Aug 7, 2026
64 checks passed
@chet
chet deleted the gh-issue-2406 branch August 7, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Overlay/12 — small type fixes (FQDN, Redfish bracket, capability guard)

3 participants