Bug 869913 - libvirt doesn't verify the network XML files when creating transient networks and the dnsmasq persistent host file is not created
libvirt doesn't verify the network XML files when creating transient networks...
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Peter Krempa
Virtualization Bugs
: Upstream
Depends On:
  Show dependency treegraph
Reported: 2012-10-25 02:41 EDT by zhenfeng wang
Modified: 2014-04-04 17:00 EDT (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-04-04 17:00:23 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description zhenfeng wang 2012-10-25 02:41:03 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):

How reproducible:

Steps to Reproduce:
1# cat multi-dhcp.xml
  <forward mode='nat'/>
  <bridge name='virbr10' stp='on' delay='0' />
  <ip address='' netmask=''>
      <range start='' end='' />
  <ip address='' netmask=''>
      <range start='' end='' />
  <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
    <interface type='network'>
      <mac address='52:54:00:e5:4e3'/>
      <source network='multi-dhcp'/>
      <model type='virtio'/>
      <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

Actual results:
we can create the network successfully,but it can't allocat mutiple dhcp sections' address

Expected results:
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

Additional info
the log in host
Oct 25 13:34:00 intel-8400-8-1 dnsmasq-dhcp[27175]: DHCPDISCOVER(virbr11) 52:54:00:56:22:67 no address available
Oct 25 13:34:04 intel-8400-8-1 dnsmasq-dhcp[27175]: DHCPDISCOVER(virbr11) 52:54:00:56:22:67 no address available
Oct 25 13:34:12 intel-8400-8-1 dnsmasq-dhcp[27175]: DHCPDISCOVER(virbr11) 52:54:00:56:22:67 no address available
Oct 25 13:34:21 intel-8400-8-1 dnsmasq-dhcp[27175]: DHCPDISCOVER(virbr11) 52:54:00:56:22:67 no address available
Comment 3 Peter Krempa 2012-10-25 11:18:36 EDT
Fix sent for review upstream:

Comment 4 Peter Krempa 2012-10-26 07:58:11 EDT
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.
Comment 5 Peter Krempa 2012-11-02 08:49:08 EDT
This bug was fixed upstream by

commit b6dbbae128ec542965e4477632d2be96cf6f51f8
Author: Peter Krempa <pkrempa@redhat.com>
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.
Comment 10 RHEL Product and Program Management 2014-04-04 17:00:23 EDT
Development Management has reviewed and declined this request.
You may appeal this decision by reopening this request.

Note You need to log in before you can comment on or make changes to this bug.