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

Bulk import of device components #822

Closed
dav3860 opened this issue Jan 20, 2017 · 14 comments
Closed

Bulk import of device components #822

dav3860 opened this issue Jan 20, 2017 · 14 comments
Labels
status: accepted This issue has been accepted for implementation
Milestone

Comments

@dav3860
Copy link
Contributor

dav3860 commented Jan 20, 2017

I would to nice to be able to import interfaces in devices in CSV format, like VLANs, etc.

@jeremystretch
Copy link
Member

Could you describe your use case for this? Interfaces can be created in bulk and should typically be inherited at the time of creation from a device's device type.

@dav3860
Copy link
Contributor Author

dav3860 commented Jan 24, 2017

We have a bunch of devices with dozens of VLAN interfaces. It was a pain to add them to netbox as the VLANs were randomly numbered. Indeed, we haven't included the VLAN interfaces to the corresponding device types as these are virtual interfaces, so we had to add them manually.
I have created a PR referencing #821 to support commas in bulk creation. But it doesn't help to create descriptions in bulk too.
So, having a way to import interfaces with descriptions would be nice.

@mike-19
Copy link

mike-19 commented Apr 14, 2017

+1
Interfaces inherits from their device type however their MAC details needs to be manually added per device it becomes tedious for bulk of machines

We will need an API to ADD MAC associated with an interface for a host as well UPDATE MAC for an associated host interface whenever NIC replacement takes place

It should also validate in case duplicate MAC exists at the time of update &add

Most of the vendors like DELL/HP do provide CFI data which includes MAC details associated with the server NIC cards much ahead before they get shipped to the DC . This helps in preparing and planning server allocations , boot strapping

@ankerstal
Copy link

We would also need this. We have 2000 servers in a exisiting DC and need a some way to import "current state" including interfaces, their vlans and mac addresses.

@Grokzen
Copy link
Contributor

Grokzen commented May 9, 2018

I would second this feature but from a much more simple use-case, simply to add the ability to move all data from one netbox installation to another without modify it. Simply put just to export all the data for all Interfaces and to what VM:s they are connected. Then import it again in a new Netbox instance.

@candlerb
Copy link
Contributor

The original counter-argument said:

Interfaces can be created in bulk and should typically be inherited at the time of creation from a device's device type

However, VMs do not have templates or device types, and don't even get a single interface by default (#1492). So bulk import of interfaces would be especially useful for VMs.

@Ricaz
Copy link

Ricaz commented Sep 26, 2018

This would be so helpful! Adding big core routers with many interfaces of different types and statuses can be a pain manually.

@chonty
Copy link

chonty commented Mar 8, 2019

BIG +1 for this. Our use case: several routers terminating hundreds of L2 customer connections as dot1q subinterfaces. Without the ability to import, I need to manually enter these hundreds of connections with unique interface names and descriptions.

I can very easily create a CSV from router output which would turn a day+ long job into a 5 minute job.

@jeremystretch jeremystretch changed the title Interfaces import Bulk import of device comonents May 3, 2019
@jeremystretch
Copy link
Member

Extending the scope from interfaces to all device components.

@jeremystretch jeremystretch added this to the v2.7 milestone May 3, 2019
@DanSheps DanSheps changed the title Bulk import of device comonents Bulk import of device components May 6, 2019
@candlerb
Copy link
Contributor

candlerb commented May 8, 2019

Another use case for importing interfaces is for routers with line cards.

The interfaces on the main Device are only those interfaces on the chassis. When you add a line card (as an inventory item) you don't get any more interfaces, so those interfaces all need to be imported directly against the Device. This is also the point where you choose the appropriate names (e.g. Gi1/0/1..24 vs Gi2/0/1..24)

@rmrf-run
Copy link

rmrf-run commented Nov 21, 2019

i wrote a few python scripts that pull from our monitoring solution's api and updates interfaces in netbox via the api. Mac addresses, descriptions, etc are easily added and updated via python manage.py sync -h. I can see about scrubbing them and sharing if any interest.

@steffann
Copy link
Contributor

i wrote a few python scripts that pull from our monitoring solution's api and updates interfaces in netbox via the api. Mac addresses, descriptions, etc are easily added and updated via python manage.py sync -h. I can see about scrubbing them and sharing if any interest.

I think both an import function and example sync scripts have their place. I'd love to see them!

@steffann
Copy link
Contributor

Hmmm, the only dependency I have to #3564 is for webpages to link to/from, so I rebased my changes and have a clean patch against develop now.

jeremystretch pushed a commit that referenced this issue Dec 5, 2019
Closes #822: CSV import for device components

* Implement CSV import for #822

* Comment out default_return_url until there is a proper target

* Fix the default value of `enabled` when not included in the import

* rear_port is definitely required here

* Power Ports don't have a type (yet)

* Add import for console-ports and console-server-ports

* Add import for device-bays
@jeremystretch
Copy link
Member

The bulk of this work was accomplished by @steffann in #3711, however we still need to link to the import views in the navigation menu. Waiting on #3719 for that.

@lock lock bot locked as resolved and limited conversation to collaborators Mar 10, 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

No branches or pull requests

10 participants