Bug 819416
Summary: | libvirtd looses network configuration, bridges remain | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 6 | Reporter: | Ilkka Tengvall <ikke> | |
Component: | libvirt | Assignee: | Laine Stump <laine> | |
Status: | CLOSED WONTFIX | QA Contact: | Virtualization Bugs <virt-bugs> | |
Severity: | unspecified | Docs Contact: | ||
Priority: | unspecified | |||
Version: | 6.2 | CC: | acathrow, cwei, dallan, danken, dyuan, laine, mzhan, pcfe, shyu, ydu | |
Target Milestone: | rc | Keywords: | Upstream | |
Target Release: | --- | |||
Hardware: | x86_64 | |||
OS: | Linux | |||
Whiteboard: | ||||
Fixed In Version: | Doc Type: | Bug Fix | ||
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 947385 (view as bug list) | Environment: | ||
Last Closed: | 2014-04-04 21:01:08 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 |
Description
Ilkka Tengvall
2012-05-07 07:32:55 UTC
I forgot to mention, the same happens on up to date F16. The problem here is that the networks are transient (virsh net-create was used, rather than net-define), and the bridge driver doesn't properly account for active transient networks when it is being restarted - it only reads the persistent networks from /etc/libvirt. This is different behavior from, e.g., the qemu driver, which reads in all active domains from /var/lib/libvirt, then determines which are *really* active by attempting to connect to their monitors. The restart code in the bridge drive should do something similar - read the active networks from /var/lib/libvirt, then so some sort of sanity check to see which are really still there (at the very least checking for the bridge device and dummy tap device, and verifying that the process(es) with pidfiles in /var/run/libvirt/network are running). This still isn't perfect, since some networks may not have an associated dnsmasq or radvd process, but it's better than just dropping all the transient networks, or assuming they're all still active. This problem has been around for a very long time, btw. I guess nobody has seriously used transient networks before. Illka - my suspicion is that you don't actually want a transient network (since it would cease to exist the first time you rebooted the host), but instead want a persistent (i.e. permanent) network - is that correct? (I suspect this because you are defining persistent guests with virt-install, and it would not make sense to have a persistent guest definition referencing a transient network; this could very easily lead to a situation where the network referenced by the guest didn't exist at the time the guest was started (even once the bug uncovered in this BZ is fixed). There may be a situation where a transient network is the correct tool for the job, but I don't think this is one of those situations. You are right in this case. That's what I want for now. But the transient networks were aimed for another goal I'm doing this for. We'll setup a network of hosts that we run tests on using KVM guests as test targets. So the hosts will not be rebooted frequently, where as guests come and go all the time. For that I was planning to use just virsh commands to create the nets and the guests. And if guests would remain over boot, it would be just a bug in the env. But like said, it's no biggie. Now that I know there is such a bug in libvirt, I can as well go around it using the persistent configurations, and do some clean-up routines for guests after rebooting the host, in case of accidental reboot or host crash. I'm pretty certain this is fixed by the following commit (and *many* others in the past few months; this is only the last piece of the puzzle): 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. To anyone attempting to backport the patches that fix this bug - the above patch caused a regression in behavior of qemu:///session that was fixed by the following commit (post-1.0.5): Author: Laine Stump <laine> Date: Thu May 2 13:59:52 2013 -0400 network: fix network driver startup for qemu:///session This should resolve https://bugzilla.redhat.com/show_bug.cgi?id=958907 Oops. Missed the commit ID in the paste: commit 2ffd87d8204c209b81610b56ee5161ae71b58b8c Author: Laine Stump <laine> Date: Thu May 2 13:59:52 2013 -0400 network: fix network driver startup for qemu:///session Development Management has reviewed and declined this request. You may appeal this decision by reopening this request. |