Skip to content

feat: DHCP every network interface by default when no custom network-config is set#3708

Draft
RajMandaliya wants to merge 10 commits into
NVIDIA:mainfrom
RajMandaliya:feat/default-network-config-all-interfaces
Draft

feat: DHCP every network interface by default when no custom network-config is set#3708
RajMandaliya wants to merge 10 commits into
NVIDIA:mainfrom
RajMandaliya:feat/default-network-config-all-interfaces

Conversation

@RajMandaliya

Copy link
Copy Markdown
Contributor

Addresses #3665.

Draft/stacked on #3392 — this branch is built on top of the network_config/extract_network_config work in #3392, which hasn't merged yet, so this diff currently includes those commits too. Will rebase onto main and clean this up once #3392 lands, at which point this should shrink down to just the new default-config logic below.

Problem

cloud-init's own default behavior (no network-config at all) only DHCPs the first network interface it finds. For multi-NIC hosts (e.g. via qcow-imager) where a tenant hasn't provided a custom network: key, every other interface is left unconfigured.

Fix

Adds DEFAULT_NETWORK_CONFIG, served whenever a tenant hasn't supplied their own network: key, that DHCPs every interface matching either the predictable (en*) or legacy (eth*) naming convention.

Testing

Verified against real cloud-init: confirmed the exact constant string (byte-for-byte, written to a real seed directory) produces the
expected netplan config covering both naming conventions. Three new unit tests cover the decision logic directly (default when absent, custom value used when present, default when no cloud-init at all).

Opening as a draft for early visibility/feedback since #3665 was just filed - happy to adjust the interface-matching approach if there's a preference (e.g. whether to include dhcp6, or a different naming convention assumption) before this is ready to merge.

RajMandaliya and others added 10 commits July 8, 2026 12:58
Keeping Pace with original repo
…tings

NICo seeds NoCloud's user-data and meta-data files, but never seeds
the separate network-config file. A top-level 'network:' key inside
user-data is not a valid user-data format (confirmed via cloud-init's
own schema validator) and is silently ignored, regardless of the
change in NVIDIA#2814 that correctly moved user-data to the canonical
NoCloud seed location.

Adds a new /network-config PXE route that extracts an existing
'network:' key from the tenant's custom_cloud_init (if present) and
serves it as its own document, plus one line in disk_imaging.sh to
fetch it into the seed directory. No API changes needed; existing
'network:' key placement keeps working as-is.

Verified end-to-end against real cloud-init: a populated
network-config applies correctly, and an empty one (the common case,
no custom network settings) falls back cleanly to default DHCP with
no errors.

Addresses NVIDIA#3303.

Signed-off-by: Raj <rajmandaliya2249@gmail.com>
- Avoid cloning the extracted network YAML value before serializing.
- Consolidate the three extract_network_config tests into a single
  table-driven test, moved into the existing tests module.

Signed-off-by: Raj <rajmandaliya2249@gmail.com>
Signed-off-by: RajMandaliya <112234020+RajMandaliya@users.noreply.github.com>
The GitHub web UI merge left an extra closing brace mid-file after
combining the extract_network_config test with the two new metrics
tests from main. All 22 tests pass.

Signed-off-by: RajMandaliya <rajmandaliya2249@gmail.com>
Adds doc comments to get_router and network_config, the functions
touched/added in this PR that were missing them.

Signed-off-by: RajMandaliya <rajmandaliya2249@gmail.com>
Signed-off-by: RajMandaliya <rajmandaliya2249@gmail.com>
…config is set

cloud-init's own default behavior (no network-config at all) only
DHCPs the first network interface it finds. For multi-NIC hosts using
qcow-imager (or any tenant not providing a custom network: key), this
leaves every other interface unconfigured.

Adds DEFAULT_NETWORK_CONFIG, served whenever a tenant hasn't supplied
their own network: key, that DHCPs every interface matching either
the predictable (en*) or legacy (eth*) naming convention.

Verified against real cloud-init: confirmed the exact constant string
(byte-for-byte, written to a real seed directory) produces the
expected netplan config covering both naming conventions.

Addresses NVIDIA#3665.

Signed-off-by: RajMandaliya <rajmandaliya2249@gmail.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 18, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 92cfb66c-b08b-47ae-9444-f3980d0d75d7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

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.

1 participant