Child prefix as container - utilization statistics incorrect #1730

Closed
opened 2025-12-29 16:34:47 +01:00 by adam · 4 comments
Owner

Originally created by @lancesdavis on GitHub (May 15, 2018).

Issue type

[ ] Feature request
[x] Bug report
[ ] Documentation

Environment

  • Python version: 3.4.8
  • NetBox version: 2.3.3

Description

A child prefix set to be a container should not be included within the utilization statistics for the parent but only active prefixes within the tree should be included.

To replicate - create a /20 prefix as a container, create a /21 prefix as a container within the 1st prefix - eg same starting ip , utilization of /20 shows as 50% whereas I expected it to be zero

prefix1
prefix2

Originally created by @lancesdavis on GitHub (May 15, 2018). <!-- Before opening a new issue, please search through the existing issues to see if your topic has already been addressed. Note that you may need to remove the "is:open" filter from the search bar to include closed issues. Check the appropriate type for your issue below by placing an x between the brackets. For assistance with installation issues, or for any other issues other than those listed below, please raise your topic for discussion on our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please note that issues which do not fall under any of the below categories will be closed. Due to an excessive backlog of feature requests, we are not currently accepting any proposals which extend NetBox's feature scope. Do not prepend any sort of tag to your issue's title. An administrator will review your issue and assign labels as appropriate. ---> ### Issue type [ ] Feature request <!-- An enhancement of existing functionality --> [x] Bug report <!-- Unexpected or erroneous behavior --> [ ] Documentation <!-- A modification to the documentation --> <!-- Please describe the environment in which you are running NetBox. (Be sure to verify that you are running the latest stable release of NetBox before submitting a bug report.) If you are submitting a bug report and have made any changes to the code base, please first validate that your bug can be recreated while running an official release. --> ### Environment * Python version: <!-- Example: 3.5.4 -->3.4.8 * NetBox version: <!-- Example: 2.1.3 --> 2.3.3 <!-- BUG REPORTS must include: * A list of the steps needed for someone else to reproduce the bug * A description of the expected and observed behavior * Any relevant error messages (screenshots may also help) FEATURE REQUESTS must include: * A detailed description of the proposed functionality * A use case for the new feature * A rough description of any necessary changes to the database schema * Any relevant third-party libraries which would be needed --> ### Description A child prefix set to be a container should not be included within the utilization statistics for the parent but only active prefixes within the tree should be included. To replicate - create a /20 prefix as a container, create a /21 prefix as a container within the 1st prefix - eg same starting ip , utilization of /20 shows as 50% whereas I expected it to be zero ![prefix1](https://user-images.githubusercontent.com/38127506/40053363-dcea3d58-5838-11e8-8221-cf8e06324455.PNG) ![prefix2](https://user-images.githubusercontent.com/38127506/40053365-dcfda834-5838-11e8-8091-6d0211e8bcb9.PNG)
adam closed this issue 2025-12-29 16:34:48 +01:00
Author
Owner

@ktims commented on GitHub (May 15, 2018):

I'm not responsible for making the decision, but i think this is as expected, and I would like to note that I prefer the current behaviour.

@ktims commented on GitHub (May 15, 2018): I'm not responsible for making the decision, but i think this is as expected, and I would like to note that I prefer the current behaviour.
Author
Owner

@DanSheps commented on GitHub (May 16, 2018):

I am sorry but I don't see the bug here. This is working as intended IMO. Your container is using "5/10/50/80%" of the space, which is expected behaviour.

@DanSheps commented on GitHub (May 16, 2018): I am sorry but I don't see the bug here. This is working as intended IMO. Your container is using "5/10/50/80%" of the space, which is expected behaviour.
Author
Owner

@lancesdavis commented on GitHub (May 16, 2018):

Maybe I am missing the point of containers - but it seems a contradiction that an empty container uses up the space ? It doesn't at the top level so why does it when it is a child ?

The attached shows 2 child level containers - utilization of the parent block is 100% - yet there are still 4096 ip addresses available to alllocate ?

container2
container3
container1

@lancesdavis commented on GitHub (May 16, 2018): Maybe I am missing the point of containers - but it seems a contradiction that an empty container uses up the space ? It doesn't at the top level so why does it when it is a child ? The attached shows 2 child level containers - utilization of the parent block is 100% - yet there are still 4096 ip addresses available to alllocate ? ![container2](https://user-images.githubusercontent.com/38127506/40101478-78b19bea-58df-11e8-8c8a-91dab621445c.PNG) ![container3](https://user-images.githubusercontent.com/38127506/40101479-78c570ca-58df-11e8-9de8-f37c4b3afb6f.PNG) ![container1](https://user-images.githubusercontent.com/38127506/40101481-78dc3c9c-58df-11e8-9d31-4ac8c56994f0.PNG)
Author
Owner

@jeremystretch commented on GitHub (May 21, 2018):

This is intended behavior. A container represents an allocation of address space. The only special significance of a container (versus a non-container prefix) is that it may not exist as a real network. For example, you may have multiple "real" /24s configured on interfaces within your network which all belong to a parent /20 container. This /20 might not actually exist in the routing table; it's just an allocation.

@jeremystretch commented on GitHub (May 21, 2018): This is intended behavior. A container represents an allocation of address space. The only special significance of a container (versus a non-container prefix) is that it may not exist as a real network. For example, you may have multiple "real" /24s configured on interfaces within your network which all belong to a parent /20 container. This /20 might not actually exist in the routing table; it's just an allocation.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1730