Kees van Reeuwijk
2012-Jun-26 15:18 UTC
[libvirt-users] Can I update the DNS configuration of an existing network?
Hello, As part of a research project on cloud management, I am developing software to create on-demand networks between VMs on different hosts. The deployment of the VMs themselves is done by OpenNebula, but for the management of the networks I have to bypass OpenNebula, and I talk directly with libvirt. One of the features of our network management is that we allow network connections to be created and destroyed at any moment in the life of a VM. This means that we use hotplugging. It also means that we want a VM to discover its network parameters for a particular NIC using DHCP and DNS. I have something that mostly works now: I create an XML for each network, I can hot-plug new NICs in the VM using libvirt, and DHCP on the new interface works. However, DNS does not work properly. I have to create a mapping between the MAC, IP address, and the name of a VM at the moment I create the network XML. Setting the MAC <-> IP mapping at that time is fine, but fixing the mapping between IP address and name at that time is not reasonable. I do not know what name will be used before I add a new machine, and during the lifetime of the network there may even be different names associated with a particular IP address. Is there a way I can change/update the DNS configuration of a network after it has been created? I could simply create a new network XML file and stop/start the network, but I suspect that is too disruptive. Is there a less intrusive way to do this? Another thing I would very much like to do is to talk to libvirt directly from my management software (written in Java), rather than through the command line. I know there is a Java API for libvirt, but I have not been able to find any up-to-date documentation on it. Is the functionality that I need accessible through the Java API? Is there enough documentation of the API for this, and where is it? -- Dr. Ir. Kees van Reeuwijk, Vrije Universiteit Amsterdam