bb-Ricardo / netbox-sync

Sync objects from VMware or redfish sources to NetBox
MIT License
290 stars 65 forks source link

Exceptions for sync_vm_dummy_interfaces #367

Open Azmodeszer opened 9 months ago

Azmodeszer commented 9 months ago

Is there a way to specify VM/hostname-based exceptions for skipping the virtual interface import? Right now, as far as I can see, the sync_vm_dummy_interfaces option is all or nothing, but we have a few cases where it would be desirable for the virtual interface to show up in Netbox.

bb-Ricardo commented 9 months ago

Hey,

Can you give me some examples? Adding a filter option or changing it into one seems doable.

Azmodeszer commented 9 months ago

We have a couple of virtual DNS servers sharing a pair of (public) anycast IPs for loadbalancing. For each server these two IPs are assigned to dummy interfaces inside the VM. With the flag set to false they are naturally excluded, but needless to say that this information would be useful to have.

bb-Ricardo commented 9 months ago

Mhh, not sure what to base the filer on.

This is an example from my test environment:

2024-02-13 17:21:52,339 - INFO: Created new virtual machine interface object: vNIC Dummy-0000 (abc-9-jj8fs)
2024-02-13 17:21:52,412 - INFO: Created new IP address object: 192.168.5.192/32
2024-02-13 17:21:53,092 - INFO: Created new virtual machine interface object: vNIC Dummy-0000 (abc-9-wwn46)
2024-02-13 17:21:53,167 - INFO: Created new IP address object: 192.168.244.64/32
2024-02-13 17:21:53,554 - INFO: Created new virtual machine interface object: vNIC Dummy-0000 (abc-9-sc57c)
2024-02-13 17:21:53,626 - INFO: Created new IP address object: 192.168.122.0/32

Based on the interface name?

Also have this in my example:

2024-02-13 17:23:30,376 - INFO: Created new virtual machine interface object: vNIC Dummy-ADC6 (abc_www)
2024-02-13 17:23:30,496 - INFO: Created new virtual machine interface object: vNIC Dummy-8049 (abc_www)
2024-02-13 17:23:31,503 - INFO: Created new virtual machine interface object: vNIC Dummy-94F8 (Docker-test)

What do you think?

Azmodeszer commented 9 months ago

It's only a few machines in my use case, so a whitelist of VM names would be enough for me.

Azmodeszer commented 4 months ago

Hi. Any news here? :)

bb-Ricardo commented 4 months ago

I'm really sorry, this project did not get the attention it deserves lately.

Also happy to merge Pull Requests.