Ubuntu

libvirt can't add host definitions to DHCP without network restart

Reported by Neil Wilson on 2010-05-24
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
libvirt
Unknown
Unknown
libvirt (Ubuntu)
Medium
Unassigned

Bug Description

libvirt networks need to be shutdown and restarted to add ranges and/or static mappings to the dhcp definition sections. This breaks service for those VM guests currently running.

ProblemType: Bug
DistroRelease: Ubuntu 10.04
Package: libvirt-bin 0.7.5-5ubuntu27
ProcVersionSignature: Ubuntu 2.6.32-22.33-server 2.6.32.11+drm33.2
Uname: Linux 2.6.32-22-server x86_64
Architecture: amd64
Date: Mon May 24 11:46:07 2010
InstallationMedia: Ubuntu-Server 10.04 LTS "Lucid Lynx" - Release amd64 (20100427)
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: libvirt

Neil Wilson (neil-aldur) wrote :
C de-Avillez (hggdh2) wrote :

Thank you for adding in the upstream bug reference. I am marking this Confirmed/Medium.

Changed in libvirt (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
Id2ndR (id2ndr) wrote :

Try this that has been working for me when I added a name (in /etc/hosts host's file) to the IP used by the guess: $ sudo kill -HUP `pidof dnsmasq`

Howerver I get a different (related trouble): custom host definition is not honor with my configuration (even after rebooting the host). dnsmasq give a adress from the dhcp range to my VM.
Here is my config /etc/libvirt/qemu/networks/default.xml
<network>
  <name>default</name>
  <bridge name="virbr%d" />
  <forward/>
  <ip address="192.168.122.1" netmask="255.255.255.0">
    <dhcp>
      <range start="192.168.122.100" end="192.168.122.239" />
      <host mac="52:54:00:bf:0f:d0" name="test" ip="192.168.122.10" />
    </dhcp>
  </ip>
</network>

sudo grep 52:54:00:bf:0f:d0 /etc/libvirt/qemu/*.xml
/etc/libvirt/qemu/test.xml: <mac address='52:54:00:bf:0f:d0'/>

Do you have any idea that may explain why this doesn't work ?

Id2ndR (id2ndr) wrote :

Ok in fact I founded why this was not working. I deleted and recreated my VM but there still was an entry corresponding to the old one in /var/lib/libvirt/dnsmasq/default.hostsfile. So I modified the MAC address and now it is working like a charm (after using HUP signal).

graemev (graeme-launchpad) wrote :

On the chance that it helps. I observed the following behavior:

in virsh

net-edit default
 ... add and entry (call this version 1)
net-destroy default
net-start default

/var/lib/libvirt/network/default.xml is changed but /var/lib/libvirt/dnsmasq/default.hostfile is NOT

net-edit default
 ... edit the MAC address on an unrelated (junk) entry (call this version 2)
net-destroy default
net-start default

Now /var/lib/libvirt/dnsmasq/default.hostfile is changed , but it reflects the file called version 1 above.

Seems to lag one version behind.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.