Bug 947385

Summary: libvirtd loses network configuration, bridges remain
Product: Red Hat Enterprise Linux 7 Reporter: hongming <honzhang>
Component: libvirtAssignee: Laine Stump <laine>
Status: CLOSED CURRENTRELEASE QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: acathrow, cwei, dallan, danken, dyuan, gsun, ikke, laine, mzhan, pcfe, ydu
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: libvirt-1.0.5-2.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 819416 Environment:
Last Closed: 2014-06-13 11:42:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 494837, 782183    

Comment 2 Laine Stump 2013-05-07 16:14:58 UTC
I'm not sure why this BZ was cloned from 6.5 to 7.0, since everything fixed in 6.5 will also be fixed in 7.0, but the problem has been fixed as of libvirt-1.0.5 (plus one patch - the 2nd patch listed below) with the following two commits (and several other that precede them):

commit 446dd66b7c7641974d25423c4cb5c48e481a84e4
Author: Peter Krempa <pkrempa>
Date:   Tue Apr 16 18:35:59 2013 +0200

    network: bridge_driver: don't lose transient networks on daemon restart
    
    Until now tranisent networks weren't really useful as libvirtd wasn't
    able to remember them across restarts. This patch adds support for
    loading status files of transient networks (that already were generated)
    so that the status isn't lost.
    
    This patch chops up virNetworkObjUpdateParseFile and turns it into
    virNetworkLoadState and a few friends that will help us to load status
    XMLs and refactors the functions that are loading the configs to use
    them.

commit 2ffd87d8204c209b81610b56ee5161ae71b58b8c
Author: Laine Stump <laine>
Date:   Thu May 2 13:59:52 2013 -0400

    network: fix network driver startup for qemu:///session
    
    This was a regression cause the the prior patch.
    This should resolve https://bugzilla.redhat.com/show_bug.cgi?id=958907

Comment 3 Wayne Sun 2013-05-21 06:33:20 UTC
pkgs:
libvirt-1.0.5-2.el7.x86_64
qemu-kvm-1.4.0-4.el7.x86_64
kernel-3.9.0-0.55.el7.x86_64

steps:
1. create a network with xml
# cat net.xml
<network>
    <name>definebr1</name>
    <uuid>fb09e249-7cce-252e-2417-c47d6d60b3d6</uuid>
    <forward/>
    <bridge name='definebr1' stp='on' forwardDelay='0' />
    <ip address='192.168.111.1' netmask='255.255.255.0'>
      <dhcp>
        <range start='192.168.111.2' end='192.168.111.254' />
      </dhcp>
    </ip>
  </network>

# virsh net-create net.xml 
Network definebr1 created from net.xml

# virsh net-list --all
 Name                 State      Autostart     Persistent
----------------------------------------------------------
 default              active     yes           yes
 definebr1            active     no            no

# brctl show
bridge name	bridge id		STP enabled	interfaces
definebr1		8000.52540088edf3	yes		definebr1-nic
virbr0		8000.029a318189a6	yes		veth1
							veth10
							veth11
							veth2
							veth3
							veth4
							veth5
							veth6
							veth9
							vnet0
2. restart libvirtd
# service libvirtd restart
Redirecting to /bin/systemctl restart  libvirtd.service

3. recheck
# virsh net-list --all
 Name                 State      Autostart     Persistent
----------------------------------------------------------
 default              active     yes           yes
 definebr1            active     no            no

# brctl show
bridge name	bridge id		STP enabled	interfaces
definebr1		8000.52540088edf3	yes		definebr1-nic
virbr0		8000.ce2f60dc3110	yes		veth1
							vnet0

so the created network will not disappear after restart, this is as expected as verified in bug:
https://bugzilla.redhat.com/show_bug.cgi?id=949926

Comment 4 Ludek Smid 2014-06-13 11:42:23 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.