Managing DNS for OpenNebula Managed IP addresses

I can’t figure out what I’m missing. What is the best practice on managing dns entries for the instances on the virtual networks?

I was expecting that I could find info on how OpenNebula could do dynamic DNS updates when instances are deployed and cleaned up. But I don’t see anything like that. Am I missing something?

As far as I know there is no support for DNS.

I’m for example running dnsmasq on the the frontend node and when a VM is created, then I add a new record and reload the DNS. When the VM is deleted, you can trigger some cleaning script.

What I really lack is some pre-create hook so that I can do a proper check whether the hostname is already in use.

So I found the VM Hooks and I can see how a fairly simple script will allow me to tie this into my DNS infrastructure. I just find it surprising that I can’t find any best practices for DNS or anyone really talking about DNS in regard to OpenNebula instance ip address. Maybe the problem is so unique per user that it’s always best to roll your own. But I still would expect the notion of DNS management to me mentioned in the docs.

This might sound like a complaint. but it’s more so to identify a gap in the documentation. (Unless I flat out missed it.)

Hi Jeff,

I agree. In fact there has been some questions in the past regarding DNS
integration. Would you like to share the details of your use case? Maybe we
could build something from there. Probably a generic solution could be
based on a hook adding/removing A/PTR records to the zone DB when the VM is
created/deleted

Thanks

Ruben

Hi Ruben,

My use case is pretty simple. I wanted new instances to have A and PTR records created when new instances were created and removed when they were destroyed. Before using Virtual Networks with IP Addresses I started using OpenNebula with Layer 2 bridges and images configured for DHCP using the send_hostname attribute as this is a how most of our physical resources establish DNS. But now I’m looking into the discovery advantages of using Virtual IP networks. Since I was doing the DHCP thing I already had the FQDN in SET_HOSTNAME like $NAME.lab.example.com

Once I started looking into VM hooks i saw that it fit the bill nicely. I added hooks for CREATE and DONE and threw together this simple script. Having the FQDN in SET_HOSTNAME was convenient for this script as well. The script does currently only set dns for the ETH0_IP contextualization variable. I’ll probably need to extend it to handle additional interfaces. But that will require more forethought and specialization on the naming.

dns.sh (1.6 KB)

1 Like