Red Hat Bugzilla – Bug 869913
libvirt doesn't verify the network XML files when creating transient networks and the dnsmasq persistent host file is not created
Last modified: 2014-04-04 17:00:23 EDT
Description of problem:
The network xml with mutiple dhcp sections can be created successfully although the guest can't get the address from the different sections
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1# cat multi-dhcp.xml
<bridge name='virbr10' stp='on' delay='0' />
<ip address='192.168.201.1' netmask='255.255.255.0'>
<range start='192.168.201.2' end='192.168.201.2' />
<ip address='192.168.202.1' netmask='255.255.255.0'>
<range start='192.168.202.2' end='192.168.202.2' />
<ip family='ipv6' address='2003b8:ac10:fe01::1' prefix='64'>
2 # virsh net-create multi-dhcp.xml
Network multi-dhcp created from multi-dhcp.xml
# virsh net-list
Name State Autostart Persistent
default active yes yes
multi-dhcp active no no
3 prepare two guests,and the guest should have the network interface like this
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
4 start the guests,then login the guests ,and found that the guest can only got the address from the first section,
can't got ip address from another one,so one of the guests can't get the ip address
5 The libvirtd didn't support define the multiple dhcp sections ,refer to bug 735950
# virsh net-define muti-dhcp.xml
error: Failed to define network from muti-dhcp.xml
error: unsupported configuration: Multiple dhcp sections found. dhcp is supported only for a single IPv4 address on each network
we can create the network successfully,but it can't allocat mutiple dhcp sections' address
From step 5 ,wo knew that the libvirtd didn't support multiple dhcp sections with "virsh net-define" command ,so I think we shouldn't create the netork with the "virsh net-create"command too. And it should report an error as the "virsh net-define" command
the log in host
Oct 25 13:34:00 intel-8400-8-1 dnsmasq-dhcp: DHCPDISCOVER(virbr11) 192.168.122.252 52:54:00:56:22:67 no address available
Oct 25 13:34:04 intel-8400-8-1 dnsmasq-dhcp: DHCPDISCOVER(virbr11) 192.168.122.252 52:54:00:56:22:67 no address available
Oct 25 13:34:12 intel-8400-8-1 dnsmasq-dhcp: DHCPDISCOVER(virbr11) 192.168.122.252 52:54:00:56:22:67 no address available
Oct 25 13:34:21 intel-8400-8-1 dnsmasq-dhcp: DHCPDISCOVER(virbr11) 192.168.122.252 52:54:00:56:22:67 no address available
Fix sent for review upstream:
I changed the summary to reflect the issue:
When creating transient networks in libvirt the code doesn't check if the definition contains multiple DHCP sections that are not supported by design and also fails to create the dnsmasq host file that stores configuration of persistently configured guest leases.
This bug was fixed upstream by
Author: Peter Krempa <firstname.lastname@example.org>
Date: Thu Oct 25 16:27:07 2012 +0200
net: Re-use checks when creating transient networks
When a transient network was created some of the checks weren't run on
the definition allowing to start invalid networks.
This patch splits out code to the network validation function and
re-uses that code when creating transient networks.
that is a part of a series fixing various issues with transient networks.
Moving to POST as it should be picked up automatically.
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.