-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include VRF-assigned child prefixes when viewing a global container prefix #1073
Comments
I think you're conflating uniqueness with address space. Whether or not a prefix is unique is dependent entirely upon whether it has been defined multiple times within a table, regardless of how many instances there are of it across different tables. The concern you brought up in #1067 was that child prefixes in VRFs that are covered by a container prefix in the global table were not being displayed as children. For example, if you had:
When you view 10.0.0.0/8, you want to see the children from all VRFs as well, correct? There are inevitably going to be contexts where this is and is not desirable, but I think making the exception for prefixes defined as containers is a good compromise. |
True maybe i was trying to package too much into a single feature. However to be more precise I would also expect given the following:
That a container in Global is encapsulating al sub-prefixes regardless of sub-prefix VRF where as containers belonging to a named VRF is only in relation to sub-prefixes in his own VRF.
So the point i was trying to make was the question if the combination Global + Container Type Container + Flag unique: Shows all sub-prefixes in any VRF as child. For the second example the question would be shall any sub-prefix of a globally unique prefix be automatically treated as globally unique? For my specific use-case which was affected by the recent change i would be |
As I said, this has nothing to do with uniqueness. There's no need to add a flag to the model for this. The question is simply whether to include VRF-assigned prefixes when displaying the children of a container prefix in the global table. |
Hi @jeremystretch thanks for taking a look into the issue. In the latest version (2.2.9) i can now correctly see all children regardless of the VRF in the child prefixes tab. As far as i can see there |
* Fixes netbox-community#1765: Improved rendering of null options for model choice fields in filter forms * Fixes netbox-community#1802: Typo in ldap.md * Fixes netbox-community#1621: Tweaked LLDP interface name evaluation logic * Fixes netbox-community#1807: Populate VRF from parent when creating a new prefix * Fixes netbox-community#1809: Populate tenant assignment from parent when creating a new prefix * Closes netbox-community#1824: Add virtual machine count to platforms list * Fixes netbox-community#1818: InventoryItem API serializer no longer requires specifying a null value for items with no parent * Evaluate device_id rather than pulling entire device (DB optimization) * added statement and exaple for using ForeignKey ID's in write actions * Closes netbox-community#1828: Added warning about media directory permissions * fixed duplicate api docs example and grammar * Closes netbox-community#1835: Consistent position of previous/next rack buttons * Fixes netbox-community#1845: Correct display of VMs in list with no role assigned * Closes netbox-community#1406: Display tenant description as title text in object tables * Closes netbox-community#1366: Enable searching for regions by name/slug * Cleaned up InventoryItem add/edit/delete links and return URL * Closes netbox-community#1073: Include prefixes/IPs from all VRFs when viewing the children of a container prefix in the global table * Closes netbox-community#144: Implemented list and bulk edit/delete views for InventoryItems * Added report results to the home page * Fixes netbox-community#1850: Fix TypeError when attempting IP address import if only unnamed devices exist * Added warning message about automatically deleting child inventory items * Release v.2.2.9
Hi @jeremystretch and @martink2 I made some minor changes based on issue-1073 and pushed them recently which you can see here sapcc@a5f6149 It has solved the utilization problem and now prefixes are ordered in the prefix list view on the basis of parent child relationship. Here I wanted to add one more functionality in the Prefix list view which should be similar to what we see once we click on an individual parent prefix which in case of VRF 'Global' and status 'Container' shows all the child prefixes irrespective of their VRF's by taking its primary key. And in case of parent prefix with VRF 'A' and status 'Container' shows only child prefixes associated to that VRF only which is 'A' in this case. I found two ways to implement it either we could make the change in IPAM/querysets.py which is currently using stack.pop() to remove the last element from the list in the while loop which I found a bit cumbersome and I need @jeremystretch advice or either if we could find a way to apply conditional expressions in class Meta in ordering in IPAM/models.py under class Prefix which I couldn't find in Django's documentation. I found we can use 'when' 'then' in filtering the queryset for instance but not inside Class Meta ordering. Please look into the matter. Thanks. |
…rdering to allow allow for proper matching of heirarchy for IP address space
Going to close this out, discussion can continue under #2562 |
The recent change introduced a behavioral change in the way GLOBAL
prefixes relate to child prefixes in named VRF's.
Before the change sub-prefixes in any VRF were treated as child from the global parent.
After the change only child prefixes from within the same VRF (Global and named) are considered child prefixes.
From a pure technical routing table perspective the global VRF is only normal VRF
without a name. But from a ipam perspective there is a different definition of Global
in the sense of globally unique prefix.
Especially for the type container, which is not a "real" routable entity but a bucket for
organisational purposes the pure routing table interpretation is maybe too strict.
Valid use-cases for globally unique prefixes are buckets for sub-allocations
like Router-ID's or Transit Networks, where the bucket is created to group a larger
range for the purpose of sub-allocating as needed across VRF's while maintaining
an overview of the bucket usage. Another reason
would be BGP-L3VPN route-leaking where prefixes are expected to be present
in multiple VRF's, which should be reflected in the IPAM, since they are not the same
range in different VRF's but truly the same entity in all VRF's.
Except of simply reverting to the old behavior I could imagine the following
approaches to the problem:
My personal vote would go to 2. As 1. would introduce a major behavioral change based
on an attribute combination for only a single combination of attributes. 3. would remove
the ability to have a container which is on purpose only valid within a given VRF.
The text was updated successfully, but these errors were encountered: