Bug 467687 - Virtual network won't work until restart
Summary: Virtual network won't work until restart
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: libvirt
Version: 10
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Daniel Veillard
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 463298 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-10-20 09:24 UTC by Julian Sikorski
Modified: 2009-02-25 10:21 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2009-02-24 18:26:58 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Output of requested commands before restart (6.80 KB, text/plain)
2009-01-21 09:46 UTC, Julian Sikorski
no flags Details
Output of requested commands after restart (6.83 KB, text/plain)
2009-01-21 09:46 UTC, Julian Sikorski
no flags Details
Differences between the two (7.74 KB, patch)
2009-01-21 09:47 UTC, Julian Sikorski
no flags Details | Diff

Description Julian Sikorski 2008-10-20 09:24:29 UTC
Description of problem:
I have a fullvirt i386 rawhide running inside a Fedora 9 x86_64 host. The problem is that the guest's network will not work until I go to virt-manager, qemu, details, virtual networks and then restart it by hitting stop followed by run. It is interesting that the guest seems to be able to resolve names, looks like it just cannot connect to anything.

Version-Release number of selected component (if applicable):
libvirt-0.4.6-2.fc9.x86_64
virt-manager-0.5.4-4.fc9.x86_64

How reproducible:
always

Steps to Reproduce:
1. Install a fully virtualised rawhide guest
2. Run it
3. Attempt to access network from within a guest
  
Actual results:
Network is not working.

Expected results:
Network is working without the need for restart.

Additional info:
Please let me know what additional useful data I could provide.

Comment 1 Julian Sikorski 2008-12-12 15:43:29 UTC
This is still the case with Fedora 10 and libvirt-0.5.0-1.fc10.x86_64.

Comment 2 Mark McLoughlin 2009-01-21 09:29:08 UTC
Julian: do you have any special iptables scripts or configuration?

Try running these commands before and after the restart and attach the output here:

  $> brctl show
  $> iptables -L -v -n
  $> ps -ef | grep dnsmasq
  $> ifconfig -a
  $> cat /proc/sys/net/ipv4/ip_forward

Comment 3 Julian Sikorski 2009-01-21 09:46:23 UTC
Created attachment 329572 [details]
Output of requested commands before restart

Nothing that I'm aware of.

Comment 4 Julian Sikorski 2009-01-21 09:46:58 UTC
Created attachment 329573 [details]
Output of requested commands after restart

Comment 5 Julian Sikorski 2009-01-21 09:47:55 UTC
Created attachment 329574 [details]
Differences between the two

Comment 6 Mark McLoughlin 2009-01-21 10:19:21 UTC
There's the problem:

  [root@snowball jsikorski]# cat /proc/sys/net/ipv4/ip_forward
  -0
  +1

See also bug #240922

Could try and figure out what's loading /etc/sysctl.conf at boot after libvirtd is started ?

danpb's theory was that it's NetworkManager, but on F10 with NetworkManager after boot I see:

  $> grep ip_forward /etc/sysctl.conf 
  net.ipv4.ip_forward = 0
  $> cat /proc/sys/net/ipv4/ip_forward 
  1

Comment 7 Daniel Berrangé 2009-01-21 10:27:29 UTC
On my F10 hosts I see 2 init scripts which either load all sysctl.conf settings, or explicitly set ip_forward - the 'network' script or the 'NetworkManager' script

network:        sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1
network:        sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1
network:                        action $"Disabling IPv4 packet forwarding: " sysctl -w net.ipv4.ip_forward=0
network:                        action $"Disabling IPv4 automatic defragmentation: " sysctl -w net.ipv4.ip_always_defrag=0
NetworkManager: sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1

The priority of both of these initscripts means that libvirtd should always be started after they are run.

A non-initscript possibility could be that NetworkManager C code has something which sets ip_forward upon connecting to a wifi network ?  This could conceivably happen after libvirtd has started, thus breaking connectivity ?

Comment 8 Julian Sikorski 2009-01-21 10:38:06 UTC
It's possible since I'm using wifi here. Will check that later today.

Comment 9 Julian Sikorski 2009-01-21 12:15:15 UTC
ip_forward is set to 0 at the time gdm starts, before logging in to the desktop (checked on tty2). But, if the messages appearing during boot-up are right, NM starts after libvirtd, so that should probably explain everything.

Comment 10 Mark McLoughlin 2009-02-02 17:58:46 UTC
*** Bug 463298 has been marked as a duplicate of this bug. ***

Comment 11 Julian Sikorski 2009-02-24 17:49:42 UTC
The priority is clearly wrong here. How can I assure libvirt gets started after NM?

Comment 12 Julian Sikorski 2009-02-24 18:26:58 UTC
OK, got it. I had old priorities lying around.

Comment 13 Mark McLoughlin 2009-02-25 09:41:38 UTC
(In reply to comment #12)
> I had old priorities lying around.

Julian: could you provide a little more info as to what the problem was?

e.g. did you have the priority overridden in /etc/chkconfig.d, or had you manually modified the initscripts, or had you manually changed runlevel symlinks?

I've added some info to:

  https://fedoraproject.org/wiki/Reporting_virtualization_bugs#Networking

Please make sure that would have helped you resolve the issue. Thanks.

Comment 14 Julian Sikorski 2009-02-25 10:21:44 UTC
I had old runlevel symlinks lying around, probably from the times when NM wasn't yet moved up in the boot process (S99NetworkManager). It seems that the priorities are not reset during upgrades.
Looking at the wiki page, indeed the
#chkconfig NetworkManager resetpriorities
command was what solved the problem. I *think* I had to reset haldaemon as well so that it starts before NM. Hope that helps.


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