Andreas Ntaflos
2010-Apr-18 01:38 UTC
[libvirt-users] Restarting network on host completely cuts off guests. Why? How to prevent?
Hi list, this probably isn't a completely libvirt-specific question but I'll try anyway. Please ignore if it is too much off-topic. On an Ubuntu (9.10) virtualisation host, running KVM and libvirt and several guests (Debian, Ubuntu, Windows Server 2003) in a bridged network fashion [1,2] I noticed that performing /etc/init.d/networking restart on the host completely cuts off all guests from the network. I have to manually shutdown and restart (virsh shutdown GUEST && virsh start GUEST, a mere reboot doesn't suffice) them to get them onto the network again. Obviously that's not ideal. Is this the expected behaviour? Can I somehow re-establish guest network connectivity without shutting down the guest first? Is my setup somehow wrong or do I expect too much? Any insight, explanation or pointers would be much appreciated! Thanks, Andreas [1] http://wiki.libvirt.org/page/Networking#Debian.2FUbuntu_Bridging [2] http://wiki.libvirt.org/page/Networking#Guest_configuration_2 -- Andreas Ntaflos GPG Fingerprint: 6234 2E8E 5C81 C6CB E5EC 7E65 397C E2A8 090C A9B4 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part. URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20100418/84056553/attachment.sig>
Francesco Pretto
2010-Apr-18 09:52 UTC
[libvirt-users] Restarting network on host completely cuts off guests. Why? How to prevent?
2010/4/18 Andreas Ntaflos <daff at pseudoterminal.org>:> On an Ubuntu (9.10) virtualisation host, running KVM and libvirt and > several guests (Debian, Ubuntu, Windows Server 2003) in a bridged > network fashion [1,2] I noticed that performing > > /etc/init.d/networking restart > > on the host completely cuts off all guests from the network. I have to > manually shutdown and restart (virsh shutdown GUEST && virsh start > GUEST, a mere reboot doesn't suffice) them to get them onto the network > again. Obviously that's not ideal. > >Confirmed, I have the same problem. Even with bridged configuration, do you have dnsmasq running elsewhere (maybe with --bind-inferfaces flag)? If i got it right, an application can bind to an "handle" of an ethernet device and not its name, so when you restart networking, the handle will change and apps binded to the previous handle will stop working. Maybe it's the hypervisor itself (the ubuntu default is kvm) to bind to the interface, so it maybe not be related at all with libvirt. Another thing I have observerd in a NAT configuration is that there are problems in setting port forwarding from the host to guests when libvirt is not yet started (= default network "libvirt0" bridge not created and proper route to the NATed subnetwork not added). It seems it just doesn't work, and it seems strange to me because I thought iptables rules should have held even devices or hosts/networks didn't exist. I "sorted" editing libvirt-bin init script adding a line that adds port forwarding after libvirt have been started. This is the kind of "ugly workarounds" I hate, but at the time it was the quicker working (and safe) solution and din't have time to do a proper reporting. Maybe it does worth report this to ubuntu and/or kvm. Greetings, Francesco
Chris Lalancette
2010-Apr-19 13:02 UTC
[libvirt-users] Restarting network on host completely cuts off guests. Why? How to prevent?
On 04/17/2010 09:38 PM, Andreas Ntaflos wrote:> Hi list, > > this probably isn't a completely libvirt-specific question but I'll try > anyway. Please ignore if it is too much off-topic. > > On an Ubuntu (9.10) virtualisation host, running KVM and libvirt and > several guests (Debian, Ubuntu, Windows Server 2003) in a bridged > network fashion [1,2] I noticed that performing > > /etc/init.d/networking restart > > on the host completely cuts off all guests from the network. I have to > manually shutdown and restart (virsh shutdown GUEST && virsh start > GUEST, a mere reboot doesn't suffice) them to get them onto the network > again. Obviously that's not ideal. > > Is this the expected behaviour? Can I somehow re-establish guest network > connectivity without shutting down the guest first? Is my setup somehow > wrong or do I expect too much?Unfortunately, that is the expected behavior. If you do: # brctl show # /etc/init.d/networking restart # brctl show You'll see that the list of interfaces attached to the bridge is different before and after. The problem is that as libvirt starts a guest, it plugs the virtual interface into the bridge device. When you do a networking restart, all of those interfaces are lost from the bridge, and there is no way currently to re-attach them. It's probably fix-able, but non-trivial; libvirt would have to be notified by the system (via D-bus?) that the bridge was restarted, and then it would have to re-plug the interfaces on the "new" bridge. -- Chris Lalancette