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

Enable the import of device types from JSON-formatted definitions #451

Closed
jeremystretch opened this issue Aug 10, 2016 · 13 comments
Closed
Labels
status: accepted This issue has been accepted for implementation
Milestone

Comments

@jeremystretch
Copy link
Member

Currently, each NetBox user must create their own device types. This results in wasted effort because users inevitably end up duplicating work. For instance, ten users who each use Juniper EX4300-48T switches will end up creating identical (or at least exceeding similar) device types.

We don't want to pre-populate device types in NetBox on initial installation, because it's impossible to predict which device types a user will want. Extraneous device types would result in clutter that needs to be deleted.

Ideally, we could begin compiling a library of device type definitions formatted as JSON. A user could select the desired device types from the library and import them into NetBox to create device types.

@fltchr
Copy link

fltchr commented Aug 10, 2016

Is this users per instance (i.e. if I create a device for a Cisco 3560, my boss won't be able to select it), or NetBox users in general (i.e. if I create a device, there is no "device community" to share it with other companies?

If the first point, I haven't noticed yet (haven't tested on more than one user account as of yet), but we'll definitely need that before moving forward., if the second, a user submitted gallery or library would be an awesome resource.

@rgstori
Copy link

rgstori commented Aug 10, 2016

+1 for the user submitted gallery, I think it would be very popular;
even with anybody's particular setting, little tweaks to each device type can
always be done after the import

@jeremystretch jeremystretch changed the title Enable the import of devie types from JSON-formatted definitions Enable the import of device types from JSON-formatted definitions Aug 10, 2016
@jeremystretch
Copy link
Member Author

@fltchr "User" in this context just means an organization using NetBox. Sorry for the confusion.

Here's a scenario. You just got in a shipment of Juniper QFX5100-48S switches that need to be racked up. You've never used these before, so first you need to create a new device type in NetBox. But rather than creating one manually, you can instruct NetBox to import a definition from a GitHub repo, e.g. netbox-devicetypes/juniper/qfx5100-48s.json. NetBox downloads the file and automatically creates a new DeviceType along with its console, power, and interface templates as defined.

I just need to come up with the logic to process JSON and start a library.

@stianvi
Copy link
Contributor

stianvi commented Aug 11, 2016

@jeremystretch There are also modules for devices that need to be taken into consideration.

example:
QFX5100-24Q: 32 ports (with hot-swappable expansion modules)
QFX5100-24Q-AA: 32 ports (with hot-swappable expansion modules)

And then there is the cabling too:
QFX5100-48S: 72 ports (48 10GbE SFP/SFP+ ports + 24 10GbE ports using QSFP+ to SFP+ DAC or QSFP+ to SFP+ fiber splitter cables and optics)

@jeremystretch
Copy link
Member Author

@stianvi Expansion modules aren't part of the device, so they aren't attached to a device type. They may or may not be installed; that's up to the user to define. And cabling isn't modelled at all.

@leandroteleco
Copy link

I'm very interested on this feature.
I'm working at important Service Provider and we are testing Netbox at our Demolab,

Thanks you for to do and to improve NetBox, I think could countribute with the device types submitted gallery. :)

@askbow
Copy link

askbow commented Nov 11, 2016

An export feature for device types might be a good idea too: some of us have already created libraries of devices, sharing them might be useful, given import is implemented.

@tobymccann
Copy link

This would be extremely useful, including some of the ideas already mentioned such as export. I imagine some type of verification mechanism to verify the accuracy of each device type, but that could probably be controlled via Github workflow.

@prolix21
Copy link

prolix21 commented Feb 9, 2017

This would save so much work. We just setup Netbox and the thought of having to create all these device types gives me a headache.

@bellwood
Copy link
Contributor

bellwood commented Apr 19, 2017

@jeremystretch I'm not sure the viability, but, Cisco/Juniper provide Visio stencils for all their hardware.

Providing one could process those VSS files (they are hexadecimal) you might be able to "easily" convert all the Visio stencils to JSON based on the data provided within.

That said, I'm not sure if the stencils include mgmt or con ports but it might be a place to start:

http://www.cisco.com/c/en/us/products/visio-stencil-listing.html
https://www.juniper.net/us/en/products-services/icons-stencils/

If it goes that easily, perhaps also do the linecards so when NAPALM runs inventory it could suggest adding templates for discovered children?

I would also recommend that users with existing devices templates be able to "upgrade" their devices to the new templates as a method of standardization - if they so chose.

@askbow
Copy link

askbow commented Apr 25, 2017

@bellwood probably this can be used to convert VSS files to something more open: https://github.com/kakwa/libvisio2svg

these VSS pictures might be somewhat useful for drawing rack faces (if you want them to look fancy), but I doubt you can export ports or other sticky points.

@bellwood
Copy link
Contributor

bellwood commented Apr 25, 2017 via email

@tb-killa
Copy link
Contributor

tb-killa commented May 2, 2019

@jeremystretch I found this nice library: django-import-export
Maybe we could use this or the implementation logic for working with the json in / export ?
I´m not an django expert to implement this stuff but maybe this would help you ?

@jeremystretch jeremystretch added this to the v2.7 milestone Oct 7, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jan 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants