guest removes interface from host bonding interface when "infenslave-2.6" is installed in the guest

Bug #1121917 reported by Hanno Hecker
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)
Fix Released
High
Unassigned
Precise
Won't Fix
High
Unassigned

Bug Description

On a host system with bonding interfaces, the LXC guest will remove all interfaces it knows from the bonding interfaces:
When the host's bond0 is made from eth0 and eth2 and the LXC guest has "eth0" and "eth1" configured, it will remove "eth0" from the hosts bond0 interface. This only happens if the guest has the package "infenslave-2.6" installed.

Steps to reproduce:
hyp02:~# grep '^Slave Interface: ' /proc/net/bonding/bond0.
Slave Interface: eth2
Slave Interface: eth0
hyp02:~# cd /data/virt/lxc
hyp02:/data/virt/lxc# cat demo.conf.

lxc.network.type = veth
lxc.network.link = extbr0
lxc.network.flags = up
lxc.network.name = eth0
lxc.network.veth.pair = demo01_ext

lxc.network.type = veth
lxc.network.link = intbr0
lxc.network.flags = up
lxc.network.name = eth1
lxc.network.veth.pair = demo01_int

lxc.cgroup.memory.limit_in_bytes = 8000M

hyp02:/data/virt/lxc# lxc-create -n demo01 -f ./demo.conf -t ubuntu.
[...]
hyp02:/data/virt/lxc# cat demo01/rootfs/etc/network/interfaces.
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 10.7.8.41
        netmask 24

auto eth1
iface eth1 inet static
        address 10.10.33.41
        netmask 24
        gateway 10.10.33.32

hyp02:/data/virt/lxc# virt-install --connect lxc:/// --container --noautoconsole --filesystem /data/virt/lxc/demo01/rootfs/,/ --vcpus=1,maxvcpus=1 --network bridge=extbr0,model=virtio --network bridge=intbr0,model=virtio --ram 8000000 --name demo01

Starting install...
Creating domain... | 0 B 00:00.....
Domain creation completed. You can restart your domain by running:
  virsh --connect lxc:/// start demo01

hyp02:~# grep '^Slave Interface: ' /proc/net/bonding/bond0.
Slave Interface: eth2
Slave Interface: eth0
hyp02:~# virsh -c lxc:/// console demo01

Ubuntu 12.04.2 LTS demo01 tty1

demo01 login: ubuntu
Password:.
Last login: Thu Feb 7 16:17:05 UTC 2013 on pts/0
Welcome to Ubuntu 12.04.2 LTS (GNU/Linux 3.2.0-36-generic x86_64)

 * Documentation: https://help.ubuntu.com/
ubuntu@demo01:~$ sudo su -
[sudo] password for ubuntu:.
root@demo01:~# ifdown eth0

hyp02:~# grep '^Slave Interface: ' /proc/net/bonding/bond0.
Slave Interface: eth2
Slave Interface: eth0
hyp02:~#

root@demo01:~# ifup eth0
root@demo01:~# apt-get install ifenslave-2.6
[...]
root@demo01:~# ifdown eth0

hyp02:~# grep '^Slave Interface: ' /proc/net/bonding/bond0.
Slave Interface: eth2
hyp02:~#

System:
# lsb_release -rd
Description: Ubuntu 12.04.1 LTS
Release: 12.04
# dpkg -l lxc libvirt-bin
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-==============-==============-============================================
ii libvirt-bin 0.9.8-2ubuntu1 programs for the libvirt library
ii lxc 0.7.5-3ubuntu6 Linux containers userspace tools

Revision history for this message
Hanno Hecker (hanno-hecker) wrote :

Opps, now the full versions:

# dpkg -l lxc libvirt-bin | cat
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-================================-============================-==============================================================================
ii libvirt-bin 0.9.8-2ubuntu17.7 programs for the libvirt library
ii lxc 0.7.5-3ubuntu66 Linux containers userspace tools

Revision history for this message
Stéphane Graber (stgraber) wrote :

I'll take a look as I'm the usual maintainer for ifupdown and one of the two lxc maintainers :)

Changed in lxc (Ubuntu):
assignee: nobody → Stéphane Graber (stgraber)
Revision history for this message
Stéphane Graber (stgraber) wrote :

Reading the bug report again, this may be a libvirt-lxc bug. I'll test on plain LXC here and re-assign if I can't reproduce.

Revision history for this message
Stéphane Graber (stgraber) wrote :

Alright, unable to reproduce here.
I used lxc from raring (13.04) on a 3.8 kernel with a machine using a dual-gigabit bond (LACP), created a 13.04 container on that with two network interfaces (eth0 and eth1), configured both with static IPs and installed ifenslave-2.6 in the container.

I then started and stopped the container, bond0 on the host remained untouched.

root@lantea:~# cat /proc/net/bonding/bond0 | grep "Slave Inter"
Slave Interface: eth1
Slave Interface: eth0
root@lantea:~# lxc-start -n p1 -d
root@lantea:~# lxc-attach -n p1
root@p1:~# halt
root@p1:~# exit
root@lantea:~# lxc-wait -s STOPPED -n p1
root@lantea:~# cat /proc/net/bonding/bond0 | grep "Slave Inter"
Slave Interface: eth1
Slave Interface: eth0

affects: lxc (Ubuntu) → libvirt (Ubuntu)
Changed in libvirt (Ubuntu):
importance: Undecided → High
Changed in libvirt (Ubuntu):
assignee: Stéphane Graber (stgraber) → nobody
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

I tried to reproduce this in raring and could not.

Is it possible for you to test in raring?

Please post your full /etc/network/interfaces.

Also, your demo.conf does not specify a custom rootfs, but your virt-install command uses /data/virt/lxc/demo01/rootfs. Is /var/lib/lxc a symlink on your system, or is something else going on?

Changed in libvirt (Ubuntu):
status: New → Incomplete
Revision history for this message
Hanno Hecker (hanno-hecker) wrote :

Yes, /var/lib/lxc is a symlink to /data/virt/lxc.

I've now dist-upgraded a VirtualBox host and one LXC Guest on that host to "raring". Now I cannot reproduce this anymore, not with a "precise" guest and not with a "raring" guest. The old "precise" (lsb_release -sd =>Ubuntu 12.04.1 LTS) system still has this problem.

=> dpkg -l lxc libvirt0 ifenslave-2.6
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-===========================-==================-==================-===========================================================
ii ifenslave-2.6 1.1.0-20ubuntu3 amd64 Attach and detach slave interfaces to a bonding device
ii libvirt0 1.0.2-0ubuntu4 amd64 library for interfacing with different virtualization syste
ii lxc 0.8.0~rc1-4ubuntu5 amd64 Linux Containers userspace tools

=> lsb_release -dr
Description: Ubuntu Raring Ringtail (development branch)
Release: 13.04

=> /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
iface bond0 inet manual
    bond-slaves none
    post-up ifenslave bond0 eth2 eth0
    pre-down ifenslave -d bond0 eth0 eth2

auto eth0
iface eth0 inet manual
        bond-master bond0

auto eth1
iface eth1 inet manual

auto eth2
iface eth2 inet manual
        bond-master bond0

auto intbr0
iface intbr0 inet dhcp
    bridge_ports bond0
    pre-up ifup bond0
    post-down ifdown bond0
    post-up ip addr add 192.168.122.1/24 dev intbr0
    post-up route add -net 192.168.122.0/24 intbr0

auto extbr0
iface extbr0 inet manual
    bridge_ports eth1
    address 192.168.123.1
    netmask 255.255.255.0

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Awesome, thanks for the info. Will have to try and reproduce this on a precise host then.

Changed in libvirt (Ubuntu):
status: Incomplete → Fix Released
Changed in libvirt (Ubuntu Precise):
importance: Undecided → High
Revision history for this message
Steve Langasek (vorlon) wrote :

The Precise Pangolin has reached end of life, so this bug will not be fixed for that release

Changed in libvirt (Ubuntu Precise):
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.