Skip to content

feat(check_redfish): add option to skip OS reported IP addresses - #583

Merged
semx merged 1 commit into
bb-Ricardo:developmentfrom
tfoks:feature/redfish-skip-os-reported-ips
Oct 8, 2026
Merged

semx merged 1 commit into
bb-Ricardo:developmentfrom
tfoks:feature/redfish-skip-os-reported-ips

Conversation

@tfoks

@tfoks tfoks commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Adds the check_redfish option skip_os_reported_ips (default False, so existing setups behave as before). When it's enabled, only the IP addresses of BMC ports are synced. The IPs that a BMC such as HPE iLO with AMS reports for the server's own NICs are skipped.

This stops the check_redfish source and the VMware source from moving an ESXi host's IPs between the VMkernel interface and the physical NIC on every run, which also unset the device's primary IP each time.

Changes:

  • module/sources/check_redfish/config.py: the new option
  • module/sources/check_redfish/import_inventory.py: skip the IPs of non-BMC ports when the option is enabled
  • settings-example.ini: regenerated with -g; the only change is the new option
  • tests/test_check_redfish_interface_ips.py: one test with the option off (all IPs synced) and one with it on (only BMC IPs synced)

Tested against NetBox 4.7.2 with 59 HPE/Lenovo inventory files and a vCenter 8.0.3 source: the host IPs stay on vmk0 and the primary IP is kept. pytest: 217 passed, 42 skipped (vcsim not installed).

Fixes #582

🤖 Generated with Claude Code

Some BMCs (i.e. HPE iLO with AMS) report the IP addresses of the
operating system on the physical NICs. If the same server is also synced
by another source (i.e. as an ESXi host by the VMware source), both
sources move these IPs back and forth between the VMkernel interface and
the physical NIC on every run, and the primary IP of the device gets
unset each time.

The new option 'skip_os_reported_ips' (default: False) syncs only the IP
addresses of the BMC ports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tfoks
tfoks requested review from bb-Ricardo and semx as code owners October 7, 2026 13:02
@semx
semx changed the base branch from main to development October 8, 2026 11:27

@semx semx left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reproduced #582 on a NetBox 4.7.2 with vcsim and a check_redfish inventory that reports the vmk0 address on a physical NIC port of the same host: with the option off the one IP object moves between vmk0 and the NIC on every run; with it on, the VMware source moves it back to vmk0 once and the next two runs change nothing, primary_ip4 stays. The suite is green with this merged onto development, and settings-example.ini regenerated there is identical to yours.

Three things, none blocks:

  • The PR targets main, which only receives releases. I'll switch the base to development; the diff stays the same.
  • "i.e." in the option description should be "e.g.", iLO with AMS is one example.
  • The part that makes this converge is keep_undiscovered_ips=True on the check_redfish call: the source does not remove IPs it no longer reports, the other source moves them. The new tests start from interfaces without IPs, so flipping that flag to False still passes them. A case that seeds the NIC with an IP, enables the option and asserts the IP is neither moved nor unassigned would pin it. And a sentence in the option description that OS IPs synced by earlier runs stay where they are until another source moves them would save the next person a question.

Whether it ships in 1.9.1 or waits for the next minor is @bb-Ricardo's call: it is a new option rather than a fix. I'll merge into development once CI has run.

@semx
semx merged commit aceaccc into bb-Ricardo:development Oct 8, 2026
3 checks passed
@semx semx mentioned this pull request Oct 8, 2026
@tfoks
tfoks deleted the feature/redfish-skip-os-reported-ips branch October 12, 2026 05:08
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.

check_redfish: OS IPs reported by the BMC (HPE iLO/AMS) conflict with the VMware source and unset the primary IP

2 participants