Skip to content
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

Add "Inventory Item Type" #3333

Closed
candlerb opened this issue Jul 6, 2019 · 21 comments
Closed

Add "Inventory Item Type" #3333

candlerb opened this issue Jul 6, 2019 · 21 comments
Labels
pending closure Requires immediate attention to avoid being closed for inactivity status: under review Further discussion is needed to determine this issue's scope and/or implementation type: feature Introduction of new functionality to the application

Comments

@candlerb
Copy link
Contributor

candlerb commented Jul 6, 2019

(Factoring this idea out of #3087)

Environment

  • Python version: 3.5.2
  • NetBox version: 2.6.1

Proposed Functionality

Add "Inventory Item Type". The relationship would then be Inventory Item -> Inventory Item Type -> Manufacturer. This is analogous to the relationship Device -> Device Type -> Manufacturer.

I propose making this as similar to Device Type as possible. e.g.

  • Manufacturer: Seagate
  • Model Name: Exos Enterprise 12TB
  • (Slug)
  • PartID: ST12000NM0007
  • Comments: 7200rpm SATA drive

I also propose that the existing "Description" field in Inventory Item would be renamed to "Comments", to be consistent with Device.

Use Case

  • Adding lots of similar inventory items - e.g. power supplies, line cards, hard drives, RAM DIMMs. It would avoid copy-pasting part numbers and ensure they are all consistent.
  • Easier searching for inventory items - "where are all the hard drives of type XYZ located?"
  • Calculating summaries - "how many power supplies of type XYZ do we have installed?" - and validation reports
  • As a hook for additional information about a particular inventory item type (e.g. URL to link to documentation, preferred supplier)

Database Changes

  • Add dcim_inventory_item_type table, with pointer to dcim_manufacturer
  • Unique constraint on (manufacturer, model name)
  • Add pointer from dcim_inventory_item to dcim_inventory_item_type.
  • Remove the existing nullable link from inventory item to manufacturer
  • Rename the "Description" field in inventory item to "Comments"

Note: there will need to be a data migration with automatic creation of inventory item types to support this change. One way to do this would be to automatically create a new inventory item type for each unique combination of "Manufacturer" + "Part ID", using the Part ID for model name as well. If Part ID is null it would have to become model name "Unknown".

(I think it's unlikely that the "Description" field on inventory item has been applied consistently enough to be used as Model Name, but it can be left as "Comments")

Allowing Custom Fields on inventory item types, as they are for device types, would be useful for several different purposes.

External Dependencies

None

Further thoughts

It has been suggested separately that inventory item types should be linked to device types, but I think that's a separate issue and is more complex - it would necessarily be a many-to-many relationship.

It could also be useful to be able to classify inventory item types, e.g. "Hard drive", "RAM", "CPU" etc, making them easier to select. Applying roles to inventory item types, rather than individual inventory items themselves (#3087) might be a way to achieve this. But it could also be done just with a custom field.

@darcynz
Copy link

darcynz commented Oct 9, 2019

2nd this. Although I would leave the description fields as this relates to an field quite often used specifically by the inventory Item. -> Eg Cisco Line cards.

Custom fields would be good solution and this has been discussed -> #1120.

@jeremystretch
Copy link
Member

This seems like it's pushing NetBox too far into asset management territory. Hardware inventory modeling was added with the primary function of allowing the user to locate hardware by serial number. Components were originally intended to be discovered automatically (although that functionality has since been removed).

@jeremystretch jeremystretch added the status: under review Further discussion is needed to determine this issue's scope and/or implementation label Oct 17, 2019
@thannaske
Copy link

Netbox is designed to be a DCIM (yes, also IPAM). In order to properly manage your DC sites you need to track how many and which spare parts you have on-site in order to call remote hands services or to restock your spares. I'm currently looking for a way to achieve this with Netbox and a functionality like this would help.

@darwin67
Copy link

This seems like it's pushing NetBox too far into asset management territory. Hardware inventory modeling was added with the primary function of allowing the user to locate hardware by serial number. Components were originally intended to be discovered automatically (although that functionality has since been removed).

That's an interesting statement. If Netbox is supposed to be a DCIM tool, shouldn't asset management be included in the scope as well?

@jeremystretch
Copy link
Member

@darwin67 For better or worse, this is where we've drawn the line on scope, a necessary delineation to ensure NetBox remains maintainable. It this does not meet your needs, NetBox may not be the tool for you.

@darwin67
Copy link

darwin67 commented Dec 17, 2019

Fair enough. So if I want asset management and other things that are not considered the core functionalities, I should either fork the repo and extend it myself or wait for #3351 and build a plugin for it then?

@lndmnn
Copy link

lndmnn commented Jan 16, 2020

As @thannaske mentioned.. It would be great to give it the ability to create for example Hard Drives and assign them to a Server. If the Hard Drive will be replaced, it would be great to mark the fault drive as broken, so that we can track all broken and active devices in the future.

@netbox-community netbox-community deleted a comment from ozkam Feb 3, 2020
@ibivibiv
Copy link

ibivibiv commented Feb 11, 2020

First off, hello to everyone... I have been living in the shadows here for quite some time. I would think that in the day to day business of keeping devices alive that you would want to track drift of the assets as they get repaired. Also they can change shape a bit over time. Allowing inventory items to be typed and have lifecycle equal to that of devices is quite sensible in my mind. I do see that the primary "delineation" seems to be around resources and maintenance to keep this application reasonable. If that were to be alleviated and I could provide assistance (more than just myself) to bring such features to the table, would that help relax concerns about bringing inventory items features forward? And when I say resources, I am not talking about a drive by dumping of code. I am talking about active members working the project and keeping that code up to date. I'm looking to see if this is just a philosophical concern or more of a scope and resources concern? We really like this application and want to improve it and maintain its place going forward. If we need to "prove ourselves" we can always do a period of bug fixes and enhancements and then revisit this current set of features to get a comfort level with each other as well. I certainly wouldn't expect anything less given this is my first open contact with all of you. :). Let me know what the thinking is here and lets see where we can take this!

@thannaske
Copy link

As far as I understood the main issue with this proposal was that it would be out of scope of netbox. Netbox (aside from the IPAM-functionality) describes itself as DCIM (Datacenter Infrastructure Management) tool. And the reality is that almost everyone that runs some racks in a DC has a storage unit somewhere where drives, RAM or some 3.5"-to-2.5" caddy are stored.

I don't see how this is out of scope. We are fastidiously documenting what is on which height unit and then there is a 3 HE drawer and I just can't keep track of its contents. For me it seems like a clear lack of functionality. I don't have the expectation to track a whole lifecycle for inventory items or server parts, for our personal use case it would be sufficient if we just would know what is current on spare and what not so people don't have to take everything they could possibly need with them, but can look up what's on stock instead. For all the level 1 technicans out there this would be a great benefit and improvement and is clearly in scope of a DCIM imho.

@ibivibiv
Copy link

I would think though if you have them live outside the context of the server they reside in then you would want to know their state? As in lifecycle of "in inventory, in use, broken, etc."? Maybe "lifecycle" was a bad choice of words. Status probably is a better one. I would think minimally; typed, statuses, and locality are important at the minimum.

@ibivibiv
Copy link

I am thinking these are some decent wire frames of what is involved. I am not sure we'd want to get into the business of "locations" just yet. Site is there, but it does beg the question that if you wanted to say place an inventory item in a holding location that site might not suffice there. Anyway just a quick mockup I did. Apologies for the color oddities (its the tool I'm using)

inventory_items_wireframe

@ibivibiv
Copy link

I also started working up a data domain model of what this might end up being as well.

domain_diagram

@ryanmerolle
Copy link
Contributor

v2.8 is coming soon. I would totally be interested in a asset management plugin for spares. Right now I track them via markdown in the comments table of a site.

@ibivibiv
Copy link

FYI, both the typing and the role have been implemented in a fork here:

nmereddi@80943c7

If we can get an actual issue up for this and get it accepted we can get this ball rolling? If we are deadlocked then maybe we build out something else in a companion app? I think it would be better to have this functionality built in rather than having to go around it just to track what a component inside a server is and its role?

@netbox-community netbox-community deleted a comment from adzafar May 28, 2020
@skredder
Copy link

@ibivibiv Would also be very interested in such a functionality here. Glad to help along and dedicate time and resources for it.
As I don't expect anything like this would be accepted in the main Netbox branch anytime soon, a separate plugin would be the most suitable.

@jeremystretch jeremystretch added type: feature Introduction of new functionality to the application needs milestone Awaiting prioritization for inclusion with a future NetBox release and removed status: under review Further discussion is needed to determine this issue's scope and/or implementation labels Jul 24, 2020
@igloo777
Copy link

Hi all)
I created a similar request (for tracking components) in SnipeIT 3 years ago. And this is still not implemented there. I am still getting notifications of SnipeIT users voting to track components. Seems like it highly demanded feature.

@jeremystretch
Copy link
Member

Note: there will need to be a data migration with automatic creation of inventory item types to support this change. One way to do this would be to automatically create a new inventory item type for each unique combination of "Manufacturer" + "Part ID", using the Part ID for model name as well. If Part ID is null it would have to become model name "Unknown".

This seems like it would be the biggest impediment to implementing this proposal. Both the manufacturer and part_id fields are optional: How would we automatically migrate to the new model in scenarios where one or both fields may be undefined?

@jeremystretch jeremystretch added status: under review Further discussion is needed to determine this issue's scope and/or implementation and removed needs milestone Awaiting prioritization for inclusion with a future NetBox release labels Dec 21, 2020
@jeremystretch
Copy link
Member

This issue should be considered in conjunction with #824, as there seems to be potential for overlap.

@candlerb
Copy link
Contributor Author

This seems like it would be the biggest impediment to implementing this proposal. Both the manufacturer and part_id fields are optional: How would we automatically migrate to the new model in scenarios where one or both fields may be undefined?

  • In the case that manufacturer is None, the migration would create a fake manufacturer "Unknown" (unless it already exists)
  • In the case that the part id is None, the migration would create a fake model "Unknown" under the chosen manufacturer
manuf part_id result
foo bar manufacturer "foo" model "bar"
foo None manufacturer "foo" model "unknown"
None bar manufacturer "unknown" model "bar"
None None manufacturer "unknown" model "unknown"

@stale
Copy link

stale bot commented Feb 6, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@stale stale bot added the pending closure Requires immediate attention to avoid being closed for inactivity label Feb 6, 2021
@netbox-community netbox-community deleted a comment from pruiz Feb 7, 2021
@stale stale bot removed the pending closure Requires immediate attention to avoid being closed for inactivity label Feb 7, 2021
@jeremystretch jeremystretch added the pending closure Requires immediate attention to avoid being closed for inactivity label Feb 7, 2021
@stale
Copy link

stale bot commented Mar 5, 2021

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@stale stale bot closed this as completed Mar 5, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pending closure Requires immediate attention to avoid being closed for inactivity status: under review Further discussion is needed to determine this issue's scope and/or implementation type: feature Introduction of new functionality to the application
Projects
None yet
Development

No branches or pull requests

10 participants