Public bug reported:

i'm seeing poor/intermittent/degrading network connectivity for guests,
when the host is using a bonded interface.

in a nutshell, the network configuration is as follows:  the physical
interfaces [eth0 and eth1] are bonded together as bond0 [i've tried
various bond modes - see below].  a bridge interface [br0] is configured
with bond0 attached to it.  all guests use br0 as their "forward"
interface.  my tests have generally included a single host, with two
guests running on it.  both guests are running ubuntu 12.10.

it depends slightly on the particulars of the configuration, but the
most prevalent symptom is that a newly booted guest will at first
respond to pings [with little to no loss], and the guest will be able to
ping other hosts on the network, but as time passes, more and more
packets are dropped.  eventually, virtually all ping requests go
unanswered.  in some cases, it appears that restarting networking on the
guest will fix this, partially and temporarily.  the guest will begin to
reply 4-5 packets after restarting networking, but does not respond
consistently, eventually failing again as before.  i've also noticed
that in some cases where ping against the guest has not yet begun to
fail, if i ping something else on the network from the guest, this
causes the pings against the guest to abruptly fail.

i know this is all quite abstract - i've spent quite a bit a time trying
to isolate various variables, and while i've made some progress, i think
some guidance would be helpful.

what i have noticed specifically is if i attach a physical device [e.g.
eth0 or eth1] to the bridge [instead of bond0], things seem to work ok.
also, if i use active-backup as the bonding mode, things seem to work
ok.  i was initially using balance-alb as the bonding mode, and have
also tested balance-rr as the bonding mode.  both exhibit the above
symptoms.  i've also tried various network card models for the guests
[realtek, e1000, and virtio].  this has not had any impact on the
symptoms.  lastly,  the two guests have been able to ping each other,
with no issues, regardless of the various network settings.  at the
moment, i have switched back to active-backup, so this is reflected in
the below information.

here is a bit of configuration info:

host os/package info:
>lsb_release -rd
Description:    Ubuntu 12.10
Release:        12.10

>apt-cache policy qemu-kvm
qemu-kvm:
  Installed: 1.2.0+noroms-0ubuntu2.12.10.3
  Candidate: 1.2.0+noroms-0ubuntu2.12.10.3
  Version table:
 *** 1.2.0+noroms-0ubuntu2.12.10.3 0
        500 http://us.archive.ubuntu.com/ubuntu/ quantal-updates/main amd64 
Packages
        100 /var/lib/dpkg/status
     1.2.0+noroms-0ubuntu2.12.10.2 0
        500 http://security.ubuntu.com/ubuntu/ quantal-security/main amd64 
Packages
     1.2.0+noroms-0ubuntu2 0
        500 http://us.archive.ubuntu.com/ubuntu/ quantal/main amd64 Packages

>dpkg -l | grep -i virt
ii  libvirt-bin                        0.9.13-0ubuntu12.2                       
 amd64        programs for the libvirt library
ii  libvirt0                           0.9.13-0ubuntu12.2                       
 amd64        library for interfacing with different virtualization systems
ii  python-libvirt                     0.9.13-0ubuntu12.2                       
 amd64        libvirt Python bindings
ii  qemu-kvm                           1.2.0+noroms-0ubuntu2.12.10.3            
 amd64        Full virtualization on supported hardware
ii  virtinst                           0.600.2-1ubuntu1                         
 all          Programs to create and clone virtual machines

>dpkg -l | grep -i qemu
ii  qemu-common                        1.2.0+noroms-0ubuntu2.12.10.3            
 all          qemu common functionality (bios, documentation, etc)
ii  qemu-kvm                           1.2.0+noroms-0ubuntu2.12.10.3            
 amd64        Full virtualization on supported hardware
ii  qemu-utils                         1.2.0+noroms-0ubuntu2.12.10.3            
 amd64        qemu utilities
ii  vgabios                            0.7a-3ubuntu2                            
 all          VGA BIOS software for the Bochs and Qemu emulated VGA card


host network config:
>egrep -v '(^[[:space:]]*#|^[[:space:]]*$)' /etc/network/interfaces 
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet manual
        bond-master bond0

auto eth1
iface eth1 inet manual
        bond-master bond0

auto bond0
iface bond0 inet manual
        bond-mode active-backup
        bond-slaves eth0 eth1
        bond-primary eth0
        bond-primary_reselect better

auto br0
iface br0 inet static
        bridge_ports bond0
        bridge_stp off
        bridge_waitport 0
        bridge_maxwait 0
        bridge_maxage 0
        bridge_fd 0     
        bridge_ageing 0
        address 192.168.1.60
        netmask 255.255.255.0
        gateway 192.168.1.1

>brctl show
bridge name     bridge id               STP enabled     interfaces
br0             8000.0019b9ec43f3       no              bond0
                                                        vnet0

>ifconfig
bond0     Link encap:Ethernet  HWaddr 00:19:b9:ec:43:f3  
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:2527 errors:0 dropped:146 overruns:0 frame:0
          TX packets:2129 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:765773 (765.7 KB)  TX bytes:1071088 (1.0 MB)

br0       Link encap:Ethernet  HWaddr 00:19:b9:ec:43:f3  
          inet addr:192.168.1.60  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::219:b9ff:feec:43f3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2189 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1643 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:669115 (669.1 KB)  TX bytes:1026954 (1.0 MB)

eth0      Link encap:Ethernet  HWaddr 00:19:b9:ec:43:f3  
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:146 errors:0 dropped:146 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:10568 (10.5 KB)  TX bytes:0 (0.0 B)

eth1      Link encap:Ethernet  HWaddr 00:19:b9:ec:43:f3  
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:2381 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2129 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:755205 (755.2 KB)  TX bytes:1071088 (1.0 MB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:3704 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3704 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1256952 (1.2 MB)  TX bytes:1256952 (1.2 MB)

vnet0     Link encap:Ethernet  HWaddr fe:54:00:f3:b2:32  
          inet6 addr: fe80::fc54:ff:fef3:b232/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:133 errors:0 dropped:0 overruns:0 frame:0
          TX packets:723 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:12368 (12.3 KB)  TX bytes:546331 (546.3 KB)

>virsh net-list --all
Name                 State      Autostart
-----------------------------------------
host-bridge          active     no        
direct-macvtap       inactive   no

>virsh net-info host-bridge
Name            host-bridge
UUID            ecb96001-1aaa-0643-6ad3-bcdf7a43775a
Active:         yes
Persistent:     yes
Autostart:      no
Bridge:         br0

>virsh net-dumpxml host-bridge
<network>
  <name>host-bridge</name>
  <uuid>ecb96001-1aaa-0643-6ad3-bcdf7a43775a</uuid>
  <forward mode='bridge'/>
  <bridge name='br0' />
</network>

guest config:
>virsh list --all
 Id    Name                           State
----------------------------------------------------
 1     aurora                         running
 -     ecto                           shut off
 -     proto                          shut off

>virsh dominfo aurora
Id:             1
Name:           aurora
UUID:           542c39da-f539-6014-6f91-36575f0aef4e
OS Type:        hvm
State:          running
CPU(s):         1
CPU time:       26.8s
Max memory:     1048576 KiB
Used memory:    1048576 KiB
Persistent:     yes
Autostart:      disable
Managed save:   no
Security model: apparmor
Security DOI:   0
Security label: libvirt-542c39da-f539-6014-6f91-36575f0aef4e (enforcing)

>virsh dumpxml aurora --security-info
<domain type='kvm' id='1'>
  <name>aurora</name>
  <uuid>542c39da-f539-6014-6f91-36575f0aef4e</uuid>
  <description>software builder [64-bit]</description>
  <memory unit='KiB'>1048576</memory>
  <currentMemory unit='KiB'>1048576</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <os>
    <type arch='x86_64' machine='pc-1.0'>hvm</type>
    <boot dev='hd'/>
  </os>
  <features>
    <acpi/>
    <apic/>
    <pae/>
  </features>
  <cpu mode='custom' match='exact'>
    <model fallback='allow'>core2duo</model>
    <vendor>Intel</vendor>
    <feature policy='require' name='pbe'/>
    <feature policy='require' name='tm2'/>
    <feature policy='require' name='est'/>
    <feature policy='require' name='ds'/>
    <feature policy='require' name='ss'/>
    <feature policy='require' name='ht'/>
    <feature policy='require' name='dca'/>
    <feature policy='require' name='lahf_lm'/>
    <feature policy='require' name='tm'/>
    <feature policy='require' name='cx16'/>
    <feature policy='require' name='vmx'/>
    <feature policy='require' name='ds_cpl'/>
    <feature policy='require' name='xtpr'/>
    <feature policy='require' name='acpi'/>
  </cpu>
  <clock offset='utc'/>
  <on_poweroff>destroy</on_poweroff>
  <on_reboot>restart</on_reboot>
  <on_crash>restart</on_crash>
  <devices>
    <emulator>/usr/bin/kvm</emulator>
    <disk type='file' device='disk'>
      <driver name='qemu' type='qcow2'/>
      <source file='/srv/vc/disks/aurora'/>
      <target dev='sda' bus='sata'/>
      <alias name='sata0-0-0'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='cdrom'>
      <driver name='qemu' type='raw'/>
      <target dev='sdb' bus='sata'/>
      <readonly/>
      <alias name='sata0-0-1'/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <controller type='sata' index='0'>
      <alias name='sata0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x04' 
function='0x0'/>
    </controller>
    <controller type='usb' index='0'>
      <alias name='usb0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x01' 
function='0x2'/>
    </controller>
    <interface type='network'>
      <mac address='52:54:00:f3:b2:32'/>
      <source network='host-bridge'/>
      <target dev='vnet0'/>
      <model type='virtio'/>
      <driver name='vhost' txmode='iothread'/>
      <alias name='net0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' 
function='0x0'/>
    </interface>
    <input type='mouse' bus='ps2'/>
    <graphics type='vnc' port='5900' autoport='yes' listen='0.0.0.0'>
      <listen type='address' address='0.0.0.0'/>
    </graphics>
    <video>
      <model type='cirrus' vram='9216' heads='1'/>
      <alias name='video0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' 
function='0x0'/>
    </video>
    <memballoon model='virtio'>
      <alias name='balloon0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x05' 
function='0x0'/>
    </memballoon>
  </devices>
  <seclabel type='dynamic' model='apparmor' relabel='yes'>
    <label>libvirt-542c39da-f539-6014-6f91-36575f0aef4e</label>
    <imagelabel>libvirt-542c39da-f539-6014-6f91-36575f0aef4e</imagelabel>
  </seclabel>
</domain>

guest os networking config:
>hostname
aurora

>ifconfig
eth0      Link encap:Ethernet  HWaddr 52:54:00:f3:b2:32  
          inet addr:192.168.1.70  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::5054:ff:fef3:b232/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2397 errors:0 dropped:8 overruns:0 frame:0
          TX packets:544 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1576649 (1.5 MB)  TX bytes:54356 (54.3 KB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

thanks
-ben

** Affects: qemu-kvm (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to qemu-kvm in Ubuntu.
https://bugs.launchpad.net/bugs/1153364

Title:
  trouble with guest network connectivity when host is using a bonded
  interface

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/1153364/+subscriptions

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs

Reply via email to