Skip to content

vmware: keep IPs when guest tools report no interface at all - #567

Merged
semx merged 2 commits into
developmentfrom
feature/vmware-guest-net-guard
Sep 10, 2026
Merged

semx merged 2 commits into
developmentfrom
feature/vmware-guest-net-guard

Conversation

@semx

@semx semx commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Taken from #509 by @dirtycache, his commit is the first one here.

The bug is real and generic: when VMware Tools answer "running" but hand back an empty guest.net, the sync reads that as "this VM has no addresses any more" and strips every IP-to-interface assignment it has in NetBox, every run. He saw it on old TMOS releases.

I moved the guard, though. As written it set skip_ip_handling, which also stops addresses being assigned, and it treated a missing guest.net the same as an empty one - that broke four existing tests, where the caller passes the addresses in explicitly and the fake VM object has no guest.net at all. It now only suppresses the removal, and only when guest.net is actually present and actually empty. A genuine removal still reports the interface without an address, so that path is untouched.

tests/test_vmware_empty_guest_net.py has both sides: broken tools keep the address, an interface that really is empty still drops it. The first fails without the guard. Suite 143, and a sync against a real NetBox 4.7 is unchanged, 0 errors and a second run with 0 changes.

The rest of #509 is a different matter - it has grown to 28 commits with vendor-specific handling for ACOS, TMOS and Alteon, plus DNS-based primary IP selection and VCSA metadata. I'll comment there separately.

Lab Admin and others added 2 commits September 10, 2026 13:27
…tive IP removal

Old TMOS builds (e.g. BIG-IP 11.5.0, 12.1.4.1) report VMware Tools as
running but never populate per-NIC guest.net data. That caused every
interface's NetBox IP assignment on those VMs to look "removed" on
each sync cycle and get deleted, even though the guest is up and the
IP is still live. Skip IP handling for a VM when guest.net comes back
completely empty while tools report running; a real per-NIC removal
still reports the NIC (just without an IP), so that case is unaffected.

(cherry picked from commit 261e338)
@semx
semx requested a review from bb-Ricardo as a code owner September 10, 2026 09:34
@semx
semx merged commit e7edb96 into development Sep 10, 2026
1 check passed
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