[FR] Add option to exclude disk sync for specific VMs #450
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Feature: Add option to exclude disk sync for specific VMs #449
Problem
Currently, there's no way to exclude specific parts of VM information from synchronization. When VMs are backed up with tools like Veeam, temporary "Independent-nonpersistent" disks are attached, causing unnecessary entries in the NetBox change log when netbox-sync runs during a backup. Each backup creates two changelog entries - one for adding the disk and one for removing it.
Solution
This PR adds two new configuration options:
vm_exclude_disk_sync: A regex pattern to match VM names where disk synchronization should be excludedvm_exclude_disk_sync_by_tag: A list of vCenter tags which, when assigned to a VM, will exclude it from disk synchronizationWith these options, VMs will still be synchronized to NetBox with all other information (CPU, memory, interfaces, IP addresses), but changes to disk information will be ignored.
Implementation Details
module/sources/vmware/config.pymodule/sources/vmware/connection.pyExample Usage