Skip to content

vmware: no error for a host vmk without an IPv4 address - #620

Open
tyderian1978 wants to merge 1 commit into
bb-Ricardo:developmentfrom
tyderian1978:fix/vmk-without-ipv4
Open

tyderian1978 wants to merge 1 commit into
bb-Ricardo:developmentfrom
tyderian1978:fix/vmk-without-ipv4

Conversation

@tyderian1978

Copy link
Copy Markdown

Disclaimer: AI generated, based off the work we're doing with Netbox.

What happens

A VMkernel interface can have no IPv4 address. On Dell VxRail hosts, for example, vmk0 is on VxRail's management network and has only an IPv6 link-local address. vCenter reports its IPv4 address and subnet mask as empty strings, so every run logs, for every such host:

ERROR: IP address '/' for vmk0 invalid!

The address is skipped either way; the error only hides real ones, in the log and in anything that counts a run's errors. (vcsim reports the fields as absent, which gives None/None.)

Fix

Skip a vmk's IPv4 entry when it reports no IPv4 address, before the permitted_subnets check. The interface itself is synced as before.

Tests

tests/test_vmware_host_vmk_without_ipv4.py loads tests/fixtures/vcsim/vc001 with one host's vmk0 IPv4 address blanked (vcsim has no UpdateVirtualNic), runs the VMware source and checks that nothing is logged as an error for vmk0, that every host still has its vmk0, and that no empty or stale IPv4 address was added. It fails on development without the change. Full suite: 608 passed, 8 skipped.

A VMkernel interface can have no IPv4 address at all; Dell VxRail hosts'
vmk0, for one, carries IPv6 link-local addresses only. vCenter then reports
an empty address and subnet mask (vcsim reports none), which became "/" (or
"None/None") and logged

  ERROR: IP address '/' for vmk0 invalid!

for every such host on every run. The address was skipped either way; now
it is skipped without the error, so a run's errors only show real problems.
The interface itself is synced as before.
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