Skip to content

Conversation

@Littlericket
Copy link

@Littlericket Littlericket commented Mar 21, 2025

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:

  1. vm_exclude_disk_sync: A regex pattern to match VM names where disk synchronization should be excluded
  2. vm_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

@Littlericket Littlericket changed the title [FR] Exclude VM's disk sync based on tags or name [FR] Add option to exclude disk sync for specific VMs Mar 21, 2025
@Littlericket
Copy link
Author

@bb-Ricardo any update on this? :) Really need that and I think this would be a great addition.

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