vcenter-netbox-sync
vcenter-netbox-sync copied to clipboard
Specify a VRF in settings.py
Is your feature request related to a problem? Please describe. I cannot specify a VRF to which ip-addresses will belong.
Describe the solution you'd like I have a lot of tenants with overlap ip-space.
Yes we have the same problem.
Fortunately everything in our vCenter belongs to the same VRF. So my solution at the moment is to declare a default VRF and make sure it is used for every ipam post/get request.
I still have some Problems when looking for existing addresses in Netbox but I can share my code after I fixed those.
Hello @inetman28 and @Haeki!
I too have this need for one of my instances and wrote a function which lookups up the VRF based on the most specific matching parent prefix. As @inetman28 mentioned though, this does not solve the use case of having overlapping IPs thus I've left it out of the main project so far.
Would it be preferable to have an additional key in the vCenter hosts list that allows you to specify the VRF all IPs detected in that vCenter instance should go in to?
Would it be preferable to have an additional key in the vCenter hosts list that allows you to specify the VRF all IPs detected in that vCenter instance should go in to?
exactly. This option must specify in vcenter hosts list because automatically ip-lookup will not work correctly.
Sounds good. I'll test that out and report back.
Yes an additional key in the vCenter hosts list would be perfect. From my testing I can tell that the search_prefix() function needs to be changed. Also when checking in Netbox for existing IPs or prefixes the vrf has to be filtered or else there will be a Problem with multiple objects found.
Got it. Those are all great points. Let me see what I can do.
I created a Pull Request with my Implementation: Specify a VRF in settings.py Implementation We have been using this for the last few weeks without Problems. But I am not sure if this will be enough to deal with Identifying and assigning VRF and tenants problem #114 so maybe you will have to improve this further.