Skip to content
This repository has been archived by the owner on Jan 8, 2021. It is now read-only.

Specify a VRF in settings.py #101

Open
inetman28 opened this issue May 6, 2020 · 7 comments
Open

Specify a VRF in settings.py #101

inetman28 opened this issue May 6, 2020 · 7 comments

Comments

@inetman28
Copy link

inetman28 commented May 6, 2020

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.

@Haeki
Copy link

Haeki commented May 6, 2020

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.

@synackray
Copy link
Owner

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?

@inetman28
Copy link
Author

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.

@synackray synackray changed the title Spicify a VRF in settings.py Specify a VRF in settings.py May 7, 2020
@synackray
Copy link
Owner

Sounds good. I'll test that out and report back.

@Haeki
Copy link

Haeki commented May 7, 2020

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.

@synackray
Copy link
Owner

Got it. Those are all great points. Let me see what I can do.

@Haeki
Copy link

Haeki commented Jun 23, 2020

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants