Import Virtual Machines with Interfaces and IP's

3,057 views
Skip to first unread message

Kevin W

unread,
Apr 2, 2018, 3:19:54 PM4/2/18
to NetBox

Hi, I want to import 100+ Virtual machines. I have a CSV which includes all the info for each VM, including IP's. My question is related to, what is the easiest and correct way to import al these VM's, Interfaces with IP's please?

Kind regards.

Brian Candler

unread,
Apr 3, 2018, 5:07:38 AM4/3/18
to NetBox
Sadly, creating or importing VMs does not automatically create interfaces:

and there's no CSV import for interfaces:

I did it by direct SQL import, but the recommended approach is to do it via the REST API, or python shell if you can get to grips with Django's ORM:

Version 2.3.0 recently added support for bulk object creation via the API:
You would have to create all the VMs in one call (to learn the database-assigned IDs), then create all the interfaces in another, and then all the IPs is another.  AFAIK there's no way to import a 'tree' of related objects in a single call.

HTH,

Brian.

Joseph Wegner

unread,
Apr 3, 2018, 12:31:15 PM4/3/18
to NetBox
I made a script to automate synchronization between vCenter and Netbox in PowerCLI: https://github.com/jwegner89/netbox-utilities/blob/master/Sync-Netbox.ps1

Chris Petrolino

unread,
Apr 3, 2018, 9:27:24 PM4/3/18
to NetBox
Great job! This is extremely helpful.....
Reply all
Reply to author
Forward
0 new messages