Skip to content

fix: discover LXC DHCP addresses from runtime interfaces - #277

Closed
MikeTsenatek wants to merge 1 commit into
emersonfelipesp:mainfrom
MikeTsenatek:fix/lxc-dhcp-runtime-ip-sync
Closed

MikeTsenatek wants to merge 1 commit into
emersonfelipesp:mainfrom
MikeTsenatek:fix/lxc-dhcp-runtime-ip-sync

Conversation

@MikeTsenatek

Copy link
Copy Markdown
Contributor

LXC containers configured with ip=dhcp currently sync their interfaces and MAC addresses but no IP addresses: runtime network discovery is restricted to QEMU guest agents, and the configuration fallback skips dhcp.

This change reads GET /nodes/{node}/lxc/{vmid}/interfaces through the existing authenticated Proxmox session and normalizes the response with the pinned SDK models. Full VM network sync and standalone interface/IP stages reuse the existing MAC/name matching, address filtering, and NetBox IP reconciliation. Older inet/inet6 response shapes are supported; unavailable runtime interfaces preserve static configuration fallback and emit a secret-free warning. No Proxmox writes, API changes, migrations, or plugin compatibility-floor changes are introduced.

Validation:

  • 99 focused tests passed, covering LXC normalization, DHCP import, dual-stack primary addresses, QEMU regressions, interface matching, and cross-cluster ownership.
  • The two LXC synchronization regressions fail with the original implementation and pass with this change.
  • Ruff lint and format checks, compileall, import/schema smoke checks, and the repository's prescribed ty targets passed.
  • 11 public-boundary tests passed.

Outstanding validation: the complete core test run did not finish within the local time limit and recorded a failure; the full suite and coverage gate are not claimed as passing. The documented e2e/docker/docker-compose.yml, wait-for-stack.sh, and smoke.sh are absent from this checkout, so Docker E2E qualification is still outstanding. Opening as a draft for review and CI qualification.

@emersonfelipesp emersonfelipesp self-assigned this Nov 21, 2026
@MikeTsenatek
MikeTsenatek marked this pull request as ready for review November 22, 2026 09:46
@emersonfelipesp

Copy link
Copy Markdown
Owner

Thank you @MikeTsenatek for this fix and its tests.

It's now on develop as 0ace61e. It was squashed into a single commit, and you are credited with a Co-authored-by trailer, so GitHub shows you as a co-author. Your runtime discovery, normalization, and tests went in as written, along with these additions made during review:

  • Containers that cluster resources report as not running are skipped without a request. Before, every stopped container caused a failing call and a warning on every sync.
  • PVE 9 inet/inet6 address families are relabelled ipv4/ipv6, to match guest-agent data.
  • The IP-only stage function you touched was refactored into smaller helpers to meet the project's complexity limit, with no change in behavior.
  • Sync docs (English and Portuguese) and release notes were added.

Because the commit was squashed instead of merged from this branch, I'm closing this PR manually. The change ships in the next proxbox-api release.

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.

2 participants