From caa70a1aabd90b1c670520dd3b71fc97bad35fb3 Mon Sep 17 00:00:00 2001 From: "ricardo.bartels@telekom.de" Date: Mon, 27 Jun 2022 16:44:34 +0200 Subject: [PATCH] skip dummy interfaces without ip addresses #181 --- module/sources/vmware/connection.py | 4 ++++ settings-example.ini | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/module/sources/vmware/connection.py b/module/sources/vmware/connection.py index daf7722..49654db 100644 --- a/module/sources/vmware/connection.py +++ b/module/sources/vmware/connection.py @@ -2414,6 +2414,10 @@ class VMWareHandler(SourceBase): "enabled": grab(guest_nic, "connected", fallback=False), } + if len(nic_ips.get(int_full_name, list())) == 0: + log.debug(f"Dummy network interface '{int_full_name}' has no IP addresses assigned. Skipping") + continue + nic_data[int_full_name] = vm_nic_data # add VM to inventory diff --git a/settings-example.ini b/settings-example.ini index eb3bd4d..0a8c28f 100644 --- a/settings-example.ini +++ b/settings-example.ini @@ -285,7 +285,7 @@ permitted_subnets = 172.16.0.0/12, 10.0.0.0/8, 192.168.0.0/16, fd00::/8 #set_source_name_as_cluster_group = False # activating this option will also include "dummy/virtual" interfaces which are only visible inside the VM -# and are exposed through VM guest tools. +# and are exposed through VM guest tools. Dummy interfaces without an IP address will be skipped. #sync_vm_dummy_interfaces = False # disables syncing of any VLANs visible in vCenter to NetBox