In Fedora 15 I'm trying to set up statically-assigned DHCP addresses for virtual machine domains, but libvirt does not pass this on to dnsmasq.
I tried to edit the network xml definition file using
# virsh -c qemu:///system net-edit vmnet
I changed it from this:
<network> <name>vmnet</name> <uuid>d27e8fa9-d358-b505-fc7b-4fb0ec0e7c4f</uuid> <forward dev='eth0' mode='nat'/> <bridge name='virbr1' stp='on' delay='0' /> <ip address='192.168.4.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.4.128' end='192.168.4.254' /> </dhcp> </ip> </network>
by adding a couple <host> elements, into this:
<network> <name>vmnet</name> <uuid>d27e8fa9-d358-b505-fc7b-4fb0ec0e7c4f</uuid> <forward dev='eth0' mode='nat'/> <bridge name='virbr1' stp='on' delay='0' /> <ip address='192.168.4.1' netmask='255.255.255.0'> <dhcp> <range start='192.168.4.128' end='192.168.4.254' /> <host mac='52:54:00:e8:dc:ee' name='aaa.example.com' ip='192.168.4.32' /> <host mac='52:54:00:22:6c:5c' name='bbb.example.com' ip='192.168.4.33' /> </dhcp> </ip> </network>
After saving the file I do get the message "Network vmnet XML configuration edited."
However, if I immediately net-edit it again, the <host> elements are not there as if I had not changed it.
This also has the effect that the dnsmasq daemon is started without having any of the command line options of "--dhcp-host" or "--dhcp-hostsfile". Which means that the virtual domains do not receive static IP addresses.
Also of note, when using net-edit if I also try to change anything else, such as the dhcp start ip address, it too will get reverted back after I save it.
Does anybody know what I may be doing wrong?
The package version is libvirt-0.8.8-4.fc15.x86_64
Thanks.
On Wed, Jun 29, 2011 at 1:25 PM, Deron Meranda deron.meranda@gmail.com wrote:
In Fedora 15 I'm trying to set up statically-assigned DHCP addresses for virtual machine domains, but libvirt does not pass this on to dnsmasq.
I think I solved this myself. You need to shut down the virtual network before you can edit it. Thus editing static DHCP addresses must be done as follows:
# virsh -c qemu:///system net-destroy vmnet # virsh -c qemu:///system net-edit vmnet # virsh -c qemu:///system net-start vmnet