NEW! Mirantis Academy -   Learn confidently with expert guidance and On-demand content.   Learn More

< BLOG HOME

Working through DNS and DHCP service configuration issues in OpenStack Nova

Yury Taraday - November 26, 2012

In a previous post about integrating Infoblox address management with OpenStack, we described a challenge we faced in storing all DHCP and DNS data on an Infoblox appliance to provide enterprise-level DHCP service for internal VMs and DNS for external clients. While DNS driver implementation was pretty straightforward, this integration exposed an interesting problem: DHCP in Nova was hardcoded to only use dnsmasq.

DNS

Nova's DNS driver abstraction did not work properly in VlanManager, so we had to fix this. The fix has been merged into Openstack with two separate changes: first is here; second is here.

Our driver adds and removes domains to/from the Infoblox appliance using the ibcli Perl tool. Note that Nova has to be properly configured to use this (see this README). The desired parent domain for all instances should be specified in the instance_dns_domain variable and the domain will be created on Infoblox automatically. Every time a new instance is created, two new DNS records will be added to that domain: one with its hostname and one with its UUID. When an instance is destroyed, these records are removed.

DHCP service in OpenStack Nova

As I said earlier, Nova never had a way to use a DHCP service provider other than dnsmasq. It took some effort to cut and abstract out all dnsmasq calls into a separate driver. We’ve filed a change request that allows someone to write their own driver to any DHCP service out there. The change request is currently under discussion. With this change, every time a network or a virtual interface is created or destroyed, Nova calls the DHCP driver to do the proper adjustments in the DHCP backend. The default dnsmasq driver just regenerates dnsmasq config and restarts it with each request just as it was done earlier. The Infoblox driver creates a network on Infoblox and then provides it with a static configuration for specific MAC-IP pairs for each virtual interface. The DHCP driver works through the same ibcli tool and uses the same configuration variables as the DNS driver.

Code

Both drivers are in the same module published at this GAP Inc. GitHub account and can be easily installed on your system with standard Python tools. Be aware that to use these drivers you have to install not only ibcli and its Perl requirements from CPAN, but also the Infoblox Perl API module from the appliance itself. (The process is described in detail in the Infoblox appliance’s documentation.)

Choose your cloud native journey.

Whatever your role, we’re here to help with open source tools and world-class support.

GET STARTED
NEWSLETTER

Subscribe to our bi-weekly newsletter for exclusive interviews, expert commentary, and thought leadership on topics shaping the cloud native world.

JOIN NOW