DevBlog #9 - Netbox synchronization with XO

When you start to have a lot of virtual machines and IP addresses, you might need to organize a bit with an IPAM. Netbox is such a thing.

DevBlog #9 - Netbox synchronization with XO

When you start to have a lot of virtual machines and IP addresses, you might need to organize everything with an IPAM. Check how Xen Orchestra can help you to enjoy your IPAM (Netbox) without having to do any manual input!

Netbox

netbox_logo

NetBox is an open source web application designed to help manage and document computer networks. Initially conceived by the network engineering team at DigitalOcean, NetBox was developed specifically to address the needs of network and infrastructure engineers. It encompasses the following aspects of network management:

  • IP address management (IPAM) - IP networks and addresses, VRFs, and VLANs
  • Equipment racks - Organized by group and site
  • Devices - Types of devices and where they are installed
  • Connections - Network, console, and power connections among devices
  • Virtualization - Virtual machines and clusters
  • Data circuits - Long-haul communications circuits and providers
  • Secrets - Encrypted storage of sensitive credentials

The problem

Having an IPAM is great, but if you are doing a lot of operations in your infrastructure (adding/remove VMs, same for IP addresses and so on), you'll have to make any modifcation twice: once in your Xen Orchestra and VMs, and once in your IPAM. This means more work and potential input typos.

And bigger your infrastructure, harder it is to get accurate and up-to-date information between the reality and your IPAM. This might even lead to dangerous situations where you might use an IP address that's… already in use but not documented as such!

The solution

The solution is to synchronize Xen Orchestra data we have on your pools and VMs, directly to your Netbox! This way, every time you change an IP address in your VM or add new ones, no need to fill that in your Netbox instance.

hexagon-synchronize--1

Indeed, as a central point to managed your whole infrastructure, XO already got everything we need:

  • all your VMs and pools UUIDs, names, descriptions and resources (vCPUs, memory, disk space)
  • VMs IP addresses (reported by xen tools)
  • VM status (active/offline)

Basically, we'll sync that to your Netbox instance, to keep it entirely up-to-date.

How it works

Thanks to a new XO plugin, you can select which pools will be sync to your Netbox instance, but also how often (in hours) *if you want a full auto-sync solution:

netboxplugin

At some point, you might want to trigger a manual sync, now you can do that in the pool view, advanced tab:

netboxtriggersync

Now, all the VMs on the selected pools will be visible in Netbox, with their detailed information (and modification history!). Here is some screenshots:

vmlist

vmobject

ipprefix

You can even monitor the IP prefix usage:

prefixusage

Documentation

The whole setup is already described in our documentation.

This feature will be available in our May release, for XOA 5.59 version on latest channel.