Bulk import of device components #644

Closed
opened 2025-12-29 16:24:13 +01:00 by adam · 14 comments
Owner

Originally created by @dav3860 on GitHub (Jan 20, 2017).

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

Originally created by @dav3860 on GitHub (Jan 20, 2017). I would to nice to be able to import interfaces in devices in CSV format, like VLANs, etc.
adam added the status: accepted label 2025-12-29 16:24:13 +01:00
adam closed this issue 2025-12-29 16:24:13 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jan 23, 2017):

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.

@jeremystretch commented on GitHub (Jan 23, 2017): 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.
Author
Owner

@dav3860 commented on GitHub (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.

@dav3860 commented on GitHub (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.
Author
Owner

@mike-19 commented on GitHub (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

@mike-19 commented on GitHub (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
Author
Owner

@ankerstal commented on GitHub (May 8, 2018):

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.

@ankerstal commented on GitHub (May 8, 2018): 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.
Author
Owner

@Grokzen commented on GitHub (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.

@Grokzen commented on GitHub (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.
Author
Owner

@candlerb commented on GitHub (Jun 23, 2018):

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.

@candlerb commented on GitHub (Jun 23, 2018): 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.
Author
Owner

@Ricaz commented on GitHub (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.

@Ricaz commented on GitHub (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.
Author
Owner

@leec-666 commented on GitHub (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.

@leec-666 commented on GitHub (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.
Author
Owner

@jeremystretch commented on GitHub (May 3, 2019):

Extending the scope from interfaces to all device components.

@jeremystretch commented on GitHub (May 3, 2019): Extending the scope from interfaces to all device components.
Author
Owner

@candlerb commented on GitHub (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)

@candlerb commented on GitHub (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`)
Author
Owner

@rmrf-run commented on GitHub (Nov 22, 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.

@rmrf-run commented on GitHub (Nov 22, 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.
Author
Owner

@steffann commented on GitHub (Nov 22, 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.

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

@steffann commented on GitHub (Nov 22, 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. I think both an import function and example sync scripts have their place. I'd love to see them!
Author
Owner

@steffann commented on GitHub (Nov 23, 2019):

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.

@steffann commented on GitHub (Nov 23, 2019): 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.
Author
Owner

@jeremystretch commented on GitHub (Dec 5, 2019):

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.

@jeremystretch commented on GitHub (Dec 5, 2019): 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#644