netbox-sync icon indicating copy to clipboard operation
netbox-sync copied to clipboard

[FR] Exclude VM's disk sync based on tags or name

Open Littlericket opened this issue 9 months ago • 4 comments

Currently, there is no way of excluding the sync of partial information, for example disks. We can only exclude based on VM name or a VLAN.

For example when running veeam, there are VMs which gets a "Independent-nonpersistent" attachment of the VMs volume disk which is currently being back upped. This causes, upon run of netbox-sync, to get a change log entry for a temporary disk attached to a backup VM. If run again and the backup finished, it creates a new change log entry for removal of the disk, resulting in a large change log set only for adding and removing disks from a particiular set of VMs.

It would be great to have a filter for specific VMs or VM Tags, which excludes them from disk-syncing and/or other information as well. Maybe some kind of "basic information" filter I guess?

Littlericket avatar Mar 18 '25 08:03 Littlericket

Hey, then it would be great if you could create a pull request. This would make it super easy to review and merge.

Thank you.

bb-Ricardo avatar Mar 18 '25 10:03 bb-Ricardo

Hi @Littlericket,

sorry, I didn't want to sound rude. There was another post right under yours which suggested code but this post has then been deleted. Have never seen that.

I can image that it would be better to just exclude the backup drives from being synched.

Is there any common pattern by which the backup drives could be recognised?

bb-Ricardo avatar Mar 20 '25 06:03 bb-Ricardo

@bb-Ricardo no issue here. Seems like the comment was some AI generated cursor-style change. Nevertheless it seems like the feature I've requested is this change somehow.

I think we can not really recognize the drives, since they have no extra information that this disk is attached because of a block backup. The only thing which differes from the disk on the VM is the "Independent-nonpersistent" tag. Image

For the attached disk on the VM it is mounted as "Persistent". Image

I will try to get a PR ready but I am not very confident with python.

Littlericket avatar Mar 21 '25 07:03 Littlericket

Hey @Littlericket,

nonpersistent sounds like good hint to me.

bb-Ricardo avatar Mar 21 '25 08:03 bb-Ricardo