Red Hat Bugzilla – Bug 846326
ovirt-node: persistent libvirt network definitions do not persist after boot
Last modified: 2016-04-26 11:05:44 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):
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.
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.