From e325d99acb63239bd334f02b32779ad97e442bf3 Mon Sep 17 00:00:00 2001
From: Littlericket <1573629+Littlericket@users.noreply.github.com>
Date: Fri, 21 Mar 2025 09:34:25 +0100
Subject: [PATCH 1/2] feat: add filters to exclude disk sync for specific VMs
---
README.md | 12 +-
docs/source_vmware.md | 22 +++
module/sources/vmware/config.py | 36 ++++-
module/sources/vmware/connection.py | 58 ++++---
settings-example.ini | 236 ++++++++++++++++++++++++++++
5 files changed, 344 insertions(+), 20 deletions(-)
diff --git a/README.md b/README.md
index 0430a67..2adefac 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,3 @@
-
# NetBox-Sync
This is a tool to sync data from different sources to a NetBox instance.
@@ -295,6 +294,17 @@ Check out the documentations for the different sources
* [vmware](https://github.com/bb-Ricardo/netbox-sync/blob/main/docs/source_vmware.md)
* [check_redfish](https://github.com/bb-Ricardo/netbox-sync/blob/main/docs/source_check_redfish.md)
+### Filtering
+netbox-sync provides various filtering capabilities to control what objects are synced from sources to NetBox:
+
+1. **General VM filtering**: Use `vm_include_filter` and `vm_exclude_filter` to include or exclude VMs by name.
+2. **Tag-based VM filtering**: Use `vm_exclude_by_tag_filter` to exclude VMs with specific vCenter tags.
+3. **Partial information filtering**:
+ - Use `vm_exclude_disk_sync` to exclude disk synchronization for VMs matching specific name patterns.
+ - Use `vm_exclude_disk_sync_by_tag` to exclude disk synchronization for VMs with specific vCenter tags.
+
+These filters allow for fine-grained control over what information is synchronized, helping to avoid clutter in the change log from temporary or backup-related disk changes.
+
If you have multiple vCenter instances or check_redfish folders just add another source with the same type
in the **same** file.
diff --git a/docs/source_vmware.md b/docs/source_vmware.md
index 11f1d03..4552918 100644
--- a/docs/source_vmware.md
+++ b/docs/source_vmware.md
@@ -107,3 +107,25 @@ Primary IPv4/6 will be determined by interface that provides the default route f
**Note:**
IP address information can only be extracted if guest tools are installed and running.
+
+### Filtering VM Disk Information
+VM disks are synchronized between vCenter and NetBox. Since NetBox 3.7.0, virtual disks are tracked as separate objects
+linked to VMs. In some scenarios, such as when temporary disks are attached to VMs during backup operations
+(e.g., "Independent-nonpersistent" disks from Veeam), you might want to exclude these changes from synchronization
+to avoid cluttering your NetBox change log.
+
+You can use the following filter options to exclude disk synchronization for specific VMs:
+
+1. **`vm_exclude_disk_sync`**: A regex pattern matching VM names where disk synchronization should be excluded.
+ ```ini
+ vm_exclude_disk_sync = backup-.*, veeam-.*
+ ```
+
+2. **`vm_exclude_disk_sync_by_tag`**: A comma-separated list of vCenter tags. VMs with any of these tags will have
+ their disk information excluded from synchronization.
+ ```ini
+ vm_exclude_disk_sync_by_tag = backup-vm, veeam-job
+ ```
+
+When a VM matches these filters, it will still be synchronized to NetBox with all its other information
+(CPU, memory, interfaces, IP addresses, etc.), but changes to disk information will be ignored.
diff --git a/module/sources/vmware/config.py b/module/sources/vmware/config.py
index 7e448a2..640d0cb 100644
--- a/module/sources/vmware/config.py
+++ b/module/sources/vmware/config.py
@@ -116,7 +116,22 @@ def __init__(self):
""",
config_example="tag-a, tag-b"
),
-
+ ConfigOption("vm_exclude_disk_sync",
+ str,
+ description="""defines a comma separated list of VM names (regex) where disk synchronization
+ will be excluded. A VM matching this filter will still be synced to NetBox,
+ but its disk information won't be updated.
+ """,
+ config_example="backup-.*, temp-.*"
+ ),
+ ConfigOption("vm_exclude_disk_sync_by_tag",
+ str,
+ description="""defines a comma separated list of vCenter tags which (if assigned to a VM)
+ will exclude this VM from disk synchronization. A VM with this tag will still be synced
+ to NetBox, but its disk information won't be updated.
+ """,
+ config_example="backup-vm, veeam-job"
+ ),
ConfigOptionGroup(title="relations",
options=[
ConfigOption("cluster_site_relation",
@@ -469,6 +484,25 @@ def validate_options(self):
continue
+ if option.key == "vm_exclude_disk_sync_by_tag":
+
+ option.set_value(quoted_split(option.value))
+
+ continue
+
+ if option.key == "vm_exclude_disk_sync":
+
+ re_compiled = None
+ try:
+ re_compiled = re.compile(option.value)
+ except Exception as e:
+ log.error(f"Problem parsing regular expression for '{self.source_name}.{option.key}': {e}")
+ self.set_validation_failed()
+
+ option.set_value(re_compiled)
+
+ continue
+
if "relation" in option.key and "vlan_group_relation" not in option.key:
relation_data = list()
diff --git a/module/sources/vmware/connection.py b/module/sources/vmware/connection.py
index 9ab8974..88c089f 100644
--- a/module/sources/vmware/connection.py
+++ b/module/sources/vmware/connection.py
@@ -1128,24 +1128,46 @@ def add_device_vm_to_inventory(self, object_type, object_data, pnic_data=None, v
if version.parse(self.inventory.netbox_api_version) >= version.parse("3.7.0") and \
object_type == NBVM and disk_data is not None and len(disk_data) > 0:
- # create pairs of existing and discovered disks.
- # currently these disks are only used within the VM model. that's why we use this simple approach and
- # just rewrite disk as they appear in order.
- # otherwise we would need to implement a matching function like matching interfaces.
- disk_zip_list = zip_longest(
- sorted(device_vm_object.get_virtual_disks(), key=lambda x: grab(x, "data.name")),
- sorted(disk_data, key=lambda x: x.get("name")),
- fillvalue="X")
-
- for existing, discovered in disk_zip_list:
- if existing == "X":
- self.inventory.add_object(NBVirtualDisk, source=self,
- data={**discovered, **{"virtual_machine": device_vm_object}}, )
- elif discovered == "X":
- log.info(f"{existing.name} '{existing.get_display_name(including_second_key=True)}' has been deleted")
- existing.deleted = True
- else:
- existing.update(data=discovered, source=self)
+ # Skip disk updates for VMs that match exclusion filters
+ skip_disk_sync = False
+
+ # Check if VM name matches vm_exclude_disk_sync filter
+ if hasattr(self.settings, 'vm_exclude_disk_sync') and self.settings.vm_exclude_disk_sync is not None:
+ if self.settings.vm_exclude_disk_sync.match(object_data.get("name")):
+ log.debug(f"VM '{object_data.get('name')}' matches vm_exclude_disk_sync filter. "
+ f"Skipping disk synchronization.")
+ skip_disk_sync = True
+
+ # Check if VM has any tags that match vm_exclude_disk_sync_by_tag filter
+ if not skip_disk_sync and hasattr(self.settings, 'vm_exclude_disk_sync_by_tag') and \
+ self.settings.vm_exclude_disk_sync_by_tag is not None:
+ vm_tags = [NetBoxObject.extract_tag_name(tag) for tag in device_vm_object.data.get("tags", list())]
+ for exclude_tag in self.settings.vm_exclude_disk_sync_by_tag:
+ if exclude_tag in vm_tags:
+ log.debug(f"VM '{object_data.get('name')}' has tag '{exclude_tag}' which matches "
+ f"vm_exclude_disk_sync_by_tag filter. Skipping disk synchronization.")
+ skip_disk_sync = True
+ break
+
+ if not skip_disk_sync:
+ # create pairs of existing and discovered disks.
+ # currently these disks are only used within the VM model. that's why we use this simple approach and
+ # just rewrite disk as they appear in order.
+ # otherwise we would need to implement a matching function like matching interfaces.
+ disk_zip_list = zip_longest(
+ sorted(device_vm_object.get_virtual_disks(), key=lambda x: grab(x, "data.name")),
+ sorted(disk_data, key=lambda x: x.get("name")),
+ fillvalue="X")
+
+ for existing, discovered in disk_zip_list:
+ if existing == "X":
+ self.inventory.add_object(NBVirtualDisk, source=self,
+ data={**discovered, **{"virtual_machine": device_vm_object}}, )
+ elif discovered == "X":
+ log.info(f"{existing.name} '{existing.get_display_name(including_second_key=True)}' has been deleted")
+ existing.deleted = True
+ else:
+ existing.update(data=discovered, source=self)
# compile all nic data into one dictionary
if object_type == NBVM:
diff --git a/settings-example.ini b/settings-example.ini
index 432d4c2..53dc9c5 100644
--- a/settings-example.ini
+++ b/settings-example.ini
@@ -405,6 +405,242 @@ password = super-secret
; behavior also applies for VM disk sizes.
;vm_disk_and_ram_in_decimal = True
+; defines a comma separated list of VM names (regex) where disk synchronization will be excluded.
+; A VM matching this filter will still be synced to NetBox, but its disk information won't be updated.
+;vm_exclude_disk_sync = backup-.*, temp-.*
+
+; defines a comma separated list of vCenter tags which (if assigned to a VM) will exclude this VM from
+; disk synchronization. A VM with this tag will still be synced to NetBox, but its disk information won't be updated.
+;vm_exclude_disk_sync_by_tag = backup-vm, veeam-job
+
+; relations options
+
+; This option defines which vCenter cluster is part of a NetBox site.
+; This is done with a comma separated key = value list.
+; key: defines the cluster name as regex
+; value: defines the NetBox site name (use quotes if name contains commas)
+; This is a quite important config setting as IP addresses, prefixes, VLANs
+; and VRFs are site dependent. In order to assign the correct prefix to an IP
+; address it is important to pick the correct site.
+; A VM always depends on the cluster site relation
+; a cluster can be specified as "Cluster-name" or
+; "Datacenter-name/Cluster-name" if multiple clusters have the same name.
+; When a vCenter cluster consists of hosts from multiple NetBox sites,
+; it is possible to leave the site for a NetBox cluster empty. All VMs from
+; this cluster will then also have no site reference.
+; The keyword "" can be used as a value for this.
+;cluster_site_relation = Cluster_NYC = New York, Cluster_FFM.* = Frankfurt, Datacenter_TOKIO/.* = Tokio, Cluster_MultiSite =
+
+; Same as cluster site but on host level. If unset it will fall back to
+; cluster_site_relation
+;host_site_relation = nyc02.* = New York, ffm01.* = Frankfurt
+
+; This option defines which cluster/host/VM belongs to which tenant.
+; This is done with a comma separated key = value list.
+; key: defines a hosts/VM name as regex
+; value: defines the NetBox tenant name (use quotes if name contains commas)
+; a cluster can be specified as "Cluster-name" or
+; "Datacenter-name/Cluster-name" if multiple clusters have the same name
+;cluster_tenant_relation = Cluster_NYC.* = Customer A
+;host_tenant_relation = esxi300.* = Infrastructure
+;vm_tenant_relation = grafana.* = Infrastructure
+
+; This option defines custom platforms if the VMWare created platforms are not suitable.
+; Pretty much a mapping of VMWare platform name to your own platform name.
+; This is done with a comma separated key = value list.
+; key: defines a VMWare returned platform name as regex
+; value: defines the desired NetBox platform name
+;host_platform_relation = VMware ESXi 7.0.3 = VMware ESXi 7.0 Update 3o
+;vm_platform_relation = centos-7.* = centos7, microsoft-windows-server-2016.* = Windows2016
+
+; Define the NetBox device role used for hosts. The default is
+; set to "Server". This is done with a comma separated key = value list.
+; key: defines host(s) name as regex
+; value: defines the NetBox role name (use quotes if name contains commas)
+;host_role_relation = .* = Server
+
+; Define the NetBox device role used for VMs. This is done with a
+; comma separated key = value list, same as 'host_role_relation'.
+; key: defines VM(s) name as regex
+; value: defines the NetBox role name (use quotes if name contains commas)
+;vm_role_relation = .* = Server
+
+; Define NetBox tags which are assigned to a cluster, host or VM. This is
+; done with a comma separated key = value list.
+; key: defines a hosts/VM name as regex
+; value: defines the NetBox tag (use quotes if name contains commas)
+; a cluster can be specified as "Cluster-name" or
+; "Datacenter-name/Cluster-name" if multiple clusters have the same name
+;cluster_tag_relation = Cluster_NYC.* = Infrastructure
+;host_tag_relation = esxi300.* = Infrastructure
+;vm_tag_relation = grafana.* = Infrastructure
+
+; Try to find existing host based on serial number. This can cause issues with blade
+; centers if VMWare does not report the blades serial number properly.
+;match_host_by_serial = True
+
+; Attempt to collect asset tags from vCenter hosts
+;collect_hardware_asset_tag = True
+
+; Attempt to collect serials from vCenter hosts
+;collect_hardware_serial = True
+
+; Perform a reverse lookup for all collected IP addresses. If a dns name was found it will
+; be added to the IP address object in NetBox
+;dns_name_lookup = True
+
+; use custom DNS server to do the reverse lookups
+;custom_dns_servers = 192.168.1.11, 192.168.1.12
+
+; define how the primary IPs should be set
+; possible values:
+;
+; always: will remove primary IP from the object where this address is
+; currently set as primary and moves it to new object
+;
+; when-undefined:
+; only sets primary IP if undefined, will cause ERRORs if same IP is
+; assigned more then once to different hosts and IP is set as the
+; objects primary IP
+;
+; never: don't set any primary IPs, will cause the same ERRORs
+; as "when-undefined"
+;set_primary_ip = when-undefined
+
+; Do not sync notes from a VM in vCenter to the comments field on a VM in netbox
+;skip_vm_comments = False
+
+; Do not sync template VMs
+;skip_vm_templates = True
+
+; Skip virtual machines which are reported as offline.
+; ATTENTION: this option will keep purging stopped VMs if activated!
+;skip_offline_vms = False
+
+; If the VMware Site Recovery Manager is used to can skip syncing placeholder/replicated
+; VMs from fail-over site to NetBox.
+;skip_srm_placeholder_vms = False
+
+; strip domain part from host name before syncing device to NetBox
+;strip_host_domain_name = False
+
+; strip domain part from VM name before syncing VM to NetBox
+;strip_vm_domain_name = False
+
+; tag source options
+
+; sync tags assigned to clusters, hosts and VMs in vCenter to NetBox
+; INFO: this requires the installation of the 'vsphere-automation-sdk',
+; see docs about installation possible values:
+; * object : the host or VM itself
+; * parent_folder_1 : the direct folder this object is organized in (1 level up)
+; * parent_folder_2 : the indirect folder this object is organized in (2 levels up)
+; * cluster : the cluster this object is organized in
+; * datacenter : the datacenter this object is organized in
+; this is a comma separated list of options. example: vm_tag_source = object, cluster
+;
+; Example: vm_tag_source = object, cluster
+;cluster_tag_source =
+;host_tag_source =
+;vm_tag_source =
+
+; sync custom attributes defined for hosts and VMs in vCenter to NetBox as custom fields
+;sync_custom_attributes = False
+
+; custom object attributes options
+
+; add arbitrary host/vm object attributes as custom fields to NetBox.
+; multiple attributes can be defined comma separated.
+; to get a list of available attributes use '-l DEBUG3' as cli param (CAREFUL: output might be long)
+; and here 'https://gist.github.com/bb-Ricardo/538768487bdac4efafabe56e005cb4ef' can be seen how to
+; access these attributes
+;host_custom_object_attributes = summary.runtime.bootTime
+;vm_custom_object_attributes = config.uuid
+
+; this will set the sources name as cluster group name instead of the datacenter. This
+; works if the vCenter has ONLY ONE datacenter configured. Otherwise it will rename all
+; datacenters to the source name!
+;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. Dummy interfaces without
+; an IP address will be skipped.
+;sync_vm_dummy_interfaces = False
+
+; VLAN syncing options
+
+; These options control if VLANs are sync to NetBox or if some VLANs are excluded from sync.
+; The exclude options can contain the site name as well (site-name/vlan). Site names and VLAN
+; names can be regex expressions. VLAN IDs can be single IDs or ranges.
+
+; disables syncing of any VLANs visible in vCenter to NetBox
+;disable_vlan_sync = False
+;vlan_sync_exclude_by_name = New York/Storage, Backup, Tokio/DMZ, Madrid/.*
+;vlan_sync_exclude_by_id = Frankfurt/25, 1023-1042
+
+; adds a relation to assign VLAN groups to matching VLANs by name. Same matching rules as
+; the exclude_by_name option uses are applied. If name and id relations are defined, the
+; name relation takes precedence. Fist match wins. Only newly discovered VLANs which are
+; not present in NetBox will be assigned a VLAN group. Supported scopes for a VLAN group
+; are "site", "site-group", "cluster" and "cluster-group". Scopes are buggy in NetBox
+; https://github.com/netbox-community/netbox/issues/18706
+;vlan_group_relation_by_name = London/Vlan_.* = VLAN Group 1, Tokio/Vlan_.* = VLAN Group 2
+
+; adds a relation to assign VLAN groups to matching VLANs by ID. Same matching rules as
+; the exclude_by_id option uses are applied. Fist match wins. Only newly discovered VLANs
+; which are not present in NetBox will be assigned a VLAN group.
+;vlan_group_relation_by_id = 1023-1042 = VLAN Group 1, Tokio/2342 = VLAN Group 2
+
+; enabling this option will add the ESXi host this VM is running on to the VM details
+;track_vm_host = False
+
+; define if the name of the device interface discovered overwrites the interface name in
+; NetBox. The interface will only be matched by identical MAC address
+;overwrite_device_interface_name = True
+
+; define if the name of the VM interface discovered overwrites the interface name in
+; NetBox. The interface will only be matched by identical MAC address
+;overwrite_vm_interface_name = True
+
+; define if the platform of the device discovered overwrites the device platform in
+; NetBox.
+;overwrite_device_platform = True
+
+; define if the platform of the VM discovered overwrites the VM platform in NetBox.
+;overwrite_vm_platform = True
+
+; set a matching value for ESXi host management interface description (case insensitive,
+; comma separated). Used to figure out the ESXi primary IP address
+;host_management_interface_match = management, mgmt
+
+; define in which order the IP address tenant will be assigned if tenant is undefined.
+; possible values:
+; * device : host or VM tenant will be assigned to the IP address
+; * prefix : if the IP address belongs to an existing prefix and this prefix has a tenant assigned, then this one is used
+; * disabled : no tenant assignment to the IP address will be performed
+; the order of the definition is important, the default is "device, prefix" which means:
+; If the device has a tenant then this one will be used. If not, the prefix tenant will be used if defined
+;ip_tenant_inheritance_order = device, prefix
+
+; Usually netbox-sync grabs the MTU size for the VM interface from the ESXi hosts vSwitch.
+; If this is not fitting or incorrect it is possible to disable the synchronisation by
+; setting this option to 'False'
+;sync_vm_interface_mtu = True
+
+; defines a comma separated list of MAC addresses which should be excluded from sync. Any
+; host NIC with a matching MAC address will be excluded from sync.
+;host_nic_exclude_by_mac_list = AA:BB:CC:11:22:33, 66:77:88:AA:BB:CC
+
+; defines a comma separated list of custom attribute which should be excluded from sync.
+; Any custom attribute with a matching attribute key will be excluded from sync.
+;custom_attribute_exclude = VB_LAST_BACKUP, VB_LAST_BACKUP2
+
+; In NetBox version 4.1.0 and newer the VM disk and RAM values are displayed in power of
+; 10 instead of power of 2. If this values is set to true 4GB of RAM will be set to a
+; value of 4000 megabyte. If set to false 4GB of RAM will be reported as 4096MB. The same
+; behavior also applies for VM disk sizes.
+;vm_disk_and_ram_in_decimal = True
+
[source/my-redfish-example]
; Defines if this source is enabled or not
From 4d222b6e9248698a6890391f1ba283339f3ccafc Mon Sep 17 00:00:00 2001
From: Littlericket <1573629+Littlericket@users.noreply.github.com>
Date: Fri, 21 Mar 2025 09:40:18 +0100
Subject: [PATCH 2/2] fix: remove duplicated config options in
settings-example.ini
---
settings-example.ini | 228 -------------------------------------------
1 file changed, 228 deletions(-)
diff --git a/settings-example.ini b/settings-example.ini
index 53dc9c5..039bd63 100644
--- a/settings-example.ini
+++ b/settings-example.ini
@@ -413,234 +413,6 @@ password = super-secret
; disk synchronization. A VM with this tag will still be synced to NetBox, but its disk information won't be updated.
;vm_exclude_disk_sync_by_tag = backup-vm, veeam-job
-; relations options
-
-; This option defines which vCenter cluster is part of a NetBox site.
-; This is done with a comma separated key = value list.
-; key: defines the cluster name as regex
-; value: defines the NetBox site name (use quotes if name contains commas)
-; This is a quite important config setting as IP addresses, prefixes, VLANs
-; and VRFs are site dependent. In order to assign the correct prefix to an IP
-; address it is important to pick the correct site.
-; A VM always depends on the cluster site relation
-; a cluster can be specified as "Cluster-name" or
-; "Datacenter-name/Cluster-name" if multiple clusters have the same name.
-; When a vCenter cluster consists of hosts from multiple NetBox sites,
-; it is possible to leave the site for a NetBox cluster empty. All VMs from
-; this cluster will then also have no site reference.
-; The keyword "" can be used as a value for this.
-;cluster_site_relation = Cluster_NYC = New York, Cluster_FFM.* = Frankfurt, Datacenter_TOKIO/.* = Tokio, Cluster_MultiSite =
-
-; Same as cluster site but on host level. If unset it will fall back to
-; cluster_site_relation
-;host_site_relation = nyc02.* = New York, ffm01.* = Frankfurt
-
-; This option defines which cluster/host/VM belongs to which tenant.
-; This is done with a comma separated key = value list.
-; key: defines a hosts/VM name as regex
-; value: defines the NetBox tenant name (use quotes if name contains commas)
-; a cluster can be specified as "Cluster-name" or
-; "Datacenter-name/Cluster-name" if multiple clusters have the same name
-;cluster_tenant_relation = Cluster_NYC.* = Customer A
-;host_tenant_relation = esxi300.* = Infrastructure
-;vm_tenant_relation = grafana.* = Infrastructure
-
-; This option defines custom platforms if the VMWare created platforms are not suitable.
-; Pretty much a mapping of VMWare platform name to your own platform name.
-; This is done with a comma separated key = value list.
-; key: defines a VMWare returned platform name as regex
-; value: defines the desired NetBox platform name
-;host_platform_relation = VMware ESXi 7.0.3 = VMware ESXi 7.0 Update 3o
-;vm_platform_relation = centos-7.* = centos7, microsoft-windows-server-2016.* = Windows2016
-
-; Define the NetBox device role used for hosts. The default is
-; set to "Server". This is done with a comma separated key = value list.
-; key: defines host(s) name as regex
-; value: defines the NetBox role name (use quotes if name contains commas)
-;host_role_relation = .* = Server
-
-; Define the NetBox device role used for VMs. This is done with a
-; comma separated key = value list, same as 'host_role_relation'.
-; key: defines VM(s) name as regex
-; value: defines the NetBox role name (use quotes if name contains commas)
-;vm_role_relation = .* = Server
-
-; Define NetBox tags which are assigned to a cluster, host or VM. This is
-; done with a comma separated key = value list.
-; key: defines a hosts/VM name as regex
-; value: defines the NetBox tag (use quotes if name contains commas)
-; a cluster can be specified as "Cluster-name" or
-; "Datacenter-name/Cluster-name" if multiple clusters have the same name
-;cluster_tag_relation = Cluster_NYC.* = Infrastructure
-;host_tag_relation = esxi300.* = Infrastructure
-;vm_tag_relation = grafana.* = Infrastructure
-
-; Try to find existing host based on serial number. This can cause issues with blade
-; centers if VMWare does not report the blades serial number properly.
-;match_host_by_serial = True
-
-; Attempt to collect asset tags from vCenter hosts
-;collect_hardware_asset_tag = True
-
-; Attempt to collect serials from vCenter hosts
-;collect_hardware_serial = True
-
-; Perform a reverse lookup for all collected IP addresses. If a dns name was found it will
-; be added to the IP address object in NetBox
-;dns_name_lookup = True
-
-; use custom DNS server to do the reverse lookups
-;custom_dns_servers = 192.168.1.11, 192.168.1.12
-
-; define how the primary IPs should be set
-; possible values:
-;
-; always: will remove primary IP from the object where this address is
-; currently set as primary and moves it to new object
-;
-; when-undefined:
-; only sets primary IP if undefined, will cause ERRORs if same IP is
-; assigned more then once to different hosts and IP is set as the
-; objects primary IP
-;
-; never: don't set any primary IPs, will cause the same ERRORs
-; as "when-undefined"
-;set_primary_ip = when-undefined
-
-; Do not sync notes from a VM in vCenter to the comments field on a VM in netbox
-;skip_vm_comments = False
-
-; Do not sync template VMs
-;skip_vm_templates = True
-
-; Skip virtual machines which are reported as offline.
-; ATTENTION: this option will keep purging stopped VMs if activated!
-;skip_offline_vms = False
-
-; If the VMware Site Recovery Manager is used to can skip syncing placeholder/replicated
-; VMs from fail-over site to NetBox.
-;skip_srm_placeholder_vms = False
-
-; strip domain part from host name before syncing device to NetBox
-;strip_host_domain_name = False
-
-; strip domain part from VM name before syncing VM to NetBox
-;strip_vm_domain_name = False
-
-; tag source options
-
-; sync tags assigned to clusters, hosts and VMs in vCenter to NetBox
-; INFO: this requires the installation of the 'vsphere-automation-sdk',
-; see docs about installation possible values:
-; * object : the host or VM itself
-; * parent_folder_1 : the direct folder this object is organized in (1 level up)
-; * parent_folder_2 : the indirect folder this object is organized in (2 levels up)
-; * cluster : the cluster this object is organized in
-; * datacenter : the datacenter this object is organized in
-; this is a comma separated list of options. example: vm_tag_source = object, cluster
-;
-; Example: vm_tag_source = object, cluster
-;cluster_tag_source =
-;host_tag_source =
-;vm_tag_source =
-
-; sync custom attributes defined for hosts and VMs in vCenter to NetBox as custom fields
-;sync_custom_attributes = False
-
-; custom object attributes options
-
-; add arbitrary host/vm object attributes as custom fields to NetBox.
-; multiple attributes can be defined comma separated.
-; to get a list of available attributes use '-l DEBUG3' as cli param (CAREFUL: output might be long)
-; and here 'https://gist.github.com/bb-Ricardo/538768487bdac4efafabe56e005cb4ef' can be seen how to
-; access these attributes
-;host_custom_object_attributes = summary.runtime.bootTime
-;vm_custom_object_attributes = config.uuid
-
-; this will set the sources name as cluster group name instead of the datacenter. This
-; works if the vCenter has ONLY ONE datacenter configured. Otherwise it will rename all
-; datacenters to the source name!
-;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. Dummy interfaces without
-; an IP address will be skipped.
-;sync_vm_dummy_interfaces = False
-
-; VLAN syncing options
-
-; These options control if VLANs are sync to NetBox or if some VLANs are excluded from sync.
-; The exclude options can contain the site name as well (site-name/vlan). Site names and VLAN
-; names can be regex expressions. VLAN IDs can be single IDs or ranges.
-
-; disables syncing of any VLANs visible in vCenter to NetBox
-;disable_vlan_sync = False
-;vlan_sync_exclude_by_name = New York/Storage, Backup, Tokio/DMZ, Madrid/.*
-;vlan_sync_exclude_by_id = Frankfurt/25, 1023-1042
-
-; adds a relation to assign VLAN groups to matching VLANs by name. Same matching rules as
-; the exclude_by_name option uses are applied. If name and id relations are defined, the
-; name relation takes precedence. Fist match wins. Only newly discovered VLANs which are
-; not present in NetBox will be assigned a VLAN group. Supported scopes for a VLAN group
-; are "site", "site-group", "cluster" and "cluster-group". Scopes are buggy in NetBox
-; https://github.com/netbox-community/netbox/issues/18706
-;vlan_group_relation_by_name = London/Vlan_.* = VLAN Group 1, Tokio/Vlan_.* = VLAN Group 2
-
-; adds a relation to assign VLAN groups to matching VLANs by ID. Same matching rules as
-; the exclude_by_id option uses are applied. Fist match wins. Only newly discovered VLANs
-; which are not present in NetBox will be assigned a VLAN group.
-;vlan_group_relation_by_id = 1023-1042 = VLAN Group 1, Tokio/2342 = VLAN Group 2
-
-; enabling this option will add the ESXi host this VM is running on to the VM details
-;track_vm_host = False
-
-; define if the name of the device interface discovered overwrites the interface name in
-; NetBox. The interface will only be matched by identical MAC address
-;overwrite_device_interface_name = True
-
-; define if the name of the VM interface discovered overwrites the interface name in
-; NetBox. The interface will only be matched by identical MAC address
-;overwrite_vm_interface_name = True
-
-; define if the platform of the device discovered overwrites the device platform in
-; NetBox.
-;overwrite_device_platform = True
-
-; define if the platform of the VM discovered overwrites the VM platform in NetBox.
-;overwrite_vm_platform = True
-
-; set a matching value for ESXi host management interface description (case insensitive,
-; comma separated). Used to figure out the ESXi primary IP address
-;host_management_interface_match = management, mgmt
-
-; define in which order the IP address tenant will be assigned if tenant is undefined.
-; possible values:
-; * device : host or VM tenant will be assigned to the IP address
-; * prefix : if the IP address belongs to an existing prefix and this prefix has a tenant assigned, then this one is used
-; * disabled : no tenant assignment to the IP address will be performed
-; the order of the definition is important, the default is "device, prefix" which means:
-; If the device has a tenant then this one will be used. If not, the prefix tenant will be used if defined
-;ip_tenant_inheritance_order = device, prefix
-
-; Usually netbox-sync grabs the MTU size for the VM interface from the ESXi hosts vSwitch.
-; If this is not fitting or incorrect it is possible to disable the synchronisation by
-; setting this option to 'False'
-;sync_vm_interface_mtu = True
-
-; defines a comma separated list of MAC addresses which should be excluded from sync. Any
-; host NIC with a matching MAC address will be excluded from sync.
-;host_nic_exclude_by_mac_list = AA:BB:CC:11:22:33, 66:77:88:AA:BB:CC
-
-; defines a comma separated list of custom attribute which should be excluded from sync.
-; Any custom attribute with a matching attribute key will be excluded from sync.
-;custom_attribute_exclude = VB_LAST_BACKUP, VB_LAST_BACKUP2
-
-; In NetBox version 4.1.0 and newer the VM disk and RAM values are displayed in power of
-; 10 instead of power of 2. If this values is set to true 4GB of RAM will be set to a
-; value of 4000 megabyte. If set to false 4GB of RAM will be reported as 4096MB. The same
-; behavior also applies for VM disk sizes.
-;vm_disk_and_ram_in_decimal = True
-
[source/my-redfish-example]
; Defines if this source is enabled or not