[FR] Add option to exclude disk sync for specific VMs
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 synchronization
With 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
- Added new configuration options in
module/sources/vmware/config.py - Added logic to skip disk synchronization in
module/sources/vmware/connection.py - Updated documentation in README.md and docs/source_vmware.md
Example Usage
# Exclude backup VMs from disk synchronization by name pattern
vm_exclude_disk_sync = backup-.*, temp-.*
# Exclude VMs with specific tags from disk synchronization
vm_exclude_disk_sync_by_tag = backup-vm, veeam-job
@bb-Ricardo any update on this? :) Really need that and I think this would be a great addition.