-
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
Enable the association of inventory items with device components #7846
Comments
That would be really useful and closes most of the cases, thank you. |
@jeremystretch Btw, what does "a particular device component installed within the same parent device." mean? |
@hiddenman yes, any of the device component models (except device/module bays). Taking another look at this, I'm not sure what to do about the current nested hierarchy: The recursive I'll give this some more thought. Interested to see what others think. |
Why do we want to mess with the parent field? Could we not use a different field to denote what component we use? |
We could, but does that make sense? Can an inventory item be a child of both a device component and another inventory item? And if so, would users want to model it as such? |
@jeremystretch Actually, i've never used Parent/Child for InventoryItem just because didn't understand the logic behind them. In our case we just can't easily store information about our SFP-modules and their ports, splitter cables and their ports and so on. |
Here's an example hardware inventory from a Juniper switch:
You can see that the CPU, PIC, power supplies, and fans are all children of the FPC item, and the transceivers are all children of the PIC. The |
…ponent Closes #7846: Associate inventory items with device components
I'm a bit late to the party here: but I observe that if you're allowing an inventory item to be associated to an existing device component using a generic FK, then you could also allow it to be associated to a (parent) inventory item using the same generic FK relation. Values in the existing "parent" field can be auto-migrated. In fact, you could still call the association "parent" if you want. Looking at the merged change, it has added
The nested inventory item hierarchy will now be modelled as a standard parent-child rather than a nested tree, but I don't really see any problem with that - the hierarchy is never going to be more than 2 or 3 levels deep in practice. |
Hi there, quick question, would this feature allow me to add an inventory item to a physical interface? We have a very common use case of SFP+ interfaces and transceivers. We don't want them as devices and wouldn't make sense to have them loose on the device. We need it to be part of an interface. |
Yes, a "device component" means an interface, front port, rear port, power port etc. |
Awesome, to get an early preview of this the only way is to compile the feature branch? |
I don't think you should need to "compile" anything; I believe just Whatever you do, don't do this on your production system or database. Make a copy of your database into a separate machine or VM, and do it there. You will have to throw it away before migrating to the final 3.2 release. |
We're starting fresh with NetBox, so there's no loss of data, thanks! |
OK, but remember that any data you put into this instance will also be lost. There is no upgrade path from |
Oh, okay. Thanks for the heads-up. |
I sincerely apologize if this is "just me" but I really struggled to understand how to use this feature. The docs don't clarify the following:
It's possible I'm not fully grasping the interface yet. In any case, maybe adding some clarifications to the docs would help? Thanks! |
NetBox version
v3.0.10
Feature type
New functionality
Proposed functionality
Enable users to associate an inventory item with a particular device component installed within the same parent device. This would be done by adding a GenericForeignKey relationship to the InventoryItem model.
Use case
This would allow users to better model the installation of items such as transceivers or antennas, conveying a relationship to a specific component for each.
Database changes
Add a GenericForeignKey field to the InventoryItem and InventoryItemTemplate models, allowing the associating with device components or component templates respectively.
External dependencies
No response
The text was updated successfully, but these errors were encountered: