Bug 846326

Summary: ovirt-node: persistent libvirt network definitions do not persist after boot
Product: Red Hat Enterprise Linux 6 Reporter: Dan Kenigsberg <danken>
Component: ovirt-nodeAssignee: Mike Burns <mburns>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.3CC: acathrow, achan, bsarathy, cpelland, cshao, fdeutsch, gouyang, iheim, jboggs, laine, leiwang, lpeer, mburns, ovirt-maint, sgordon
Target Milestone: rcKeywords: ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugzilla.redhat.com/show_bug.cgi?id=826838
Fixed In Version: ovirt-node-2.5.0-5.el6 Doc Type: Bug Fix
Doc Text:
When connected to libvirtd running on an ovirt-node, modified libvirt network definitions were applied correctly to a live host but did not persist after a reboot. The network definitions are now stored in /etc/libvirt/qemu/networks and persists at each reboot of the host.
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-28 11:37:50 EST Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 855363    

Description Dan Kenigsberg 2012-08-07 09:22:04 EDT
Description of problem:
If someone connects to libvirtd running on ovirt-node and issues a

  virsh -c <libvirt.url> net-define bla.xml

a new network definition is created and stored under /var/lib/libvirt/network. `virsh net-info bls` would list the network as persistent. However, after reboot, the network is there no more.

vdsm could theoretically become root, dig into libvirt's internals, and call ovirt_store_config(/var/lib/libvirt/network/bla.xml), but this seems like the wrong solution.

Version-Release number of selected component (if applicable):
Comment 1 Mike Burns 2012-08-07 10:00:38 EDT
Comment 2 Laine Stump 2012-08-07 10:30:42 EDT
I'm pretty sure you're just looking in the wrong place. When you define a network with virsh net-define, its definition is stored in /etc/libvirt. When you start a network, a copy of that definition is place in /var/lib/libvirt. When you reboot the host, the network is still defined (in /etc/libvirt), but is not automatically started, so it is no longer visible in /var/libvirt. As soon as you do virsh net-start, it will once again be visible in /var/libvirt.

If you want a network to be started automatically on boot, you need to call virsh net-autostart (virNetworkSetAutostart) after you've defined it. libvirt will then restart the network automatically when the host reboots.

BTW, please don't look in / use /var/lib/libvirt or /etc/libvirt - every piece of information there should be available via the libvirt API. If there is something you need in there that isn't available in the libvirt API, then we need to enhance the API.

In particular, I don't think you want the patch that Mike has proposed in Comment 1.
Comment 14 errata-xmlrpc 2013-02-28 11:37:50 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.