[ovs-discuss] LXC and Open Vswitch compatibility...

Jose A. Posada joseaporo at gmail.com
Wed Apr 10 19:03:37 UTC 2013


root at ubuntu:~# nano /etc/default/lxc
...
# Leave USE_LXC_BRIDGE as "true" if you want to use lxcbr0 for your
# containers.  Set to "false" if you'll use virbr0 or another existing
# bridge, or mavlan to your host's NIC.
USE_LXC_BRIDGE="false"
...

lxcbr0
When USE_LXC_BRIDGE is set to true in /etc/default/lxc (as it is by
default), a bridge called lxcbr0 is created at startup. This bridge is given
the private address 10.0.3.1, and containers using this bridge will have a
10.0.3.0/24 address. A dnsmasq instance is run listening on that bridge, so
if another dnsmasq has bound all interfaces before the lxc-net upstart job
runs, lxc-net will fail to start and lxcbr0 will not exist.
If you have another bridge - libvirt's default virbr0, or a br0 bridge for
your default NIC - you can use that bridge in place of lxcbr0 for your
containers.

root at ubuntu:~# ovs-vsctl show
9f8d8e81-8060-4555-a7d2-b0887f5cc376
    Bridge "br0"
        Port "ubuntu4"
            Interface "ubuntu4"
                type: internal
        Port "ubuntu2"
            Interface "ubuntu2"
                type: internal
        Port "ubuntu3"
            Interface "ubuntu3"
                type: internal
        Port "d2"
            Interface "d2"
                type: internal
        Port "ubuntu1"
            Interface "ubuntu1"
                type: internal
        Port "d1"
            Interface "d1"
                type: internal
        Port "br0"
            Interface "br0"
                type: internal
        Port "eth0"
            Interface "eth0"
    ovs_version: "1.4.0+build0"
	
root at ubuntu:~# brctl show
bridge name     bridge id               STP enabled     interfaces
br0             0000.000c29eac889       	no              d1
 
d2
 
eth0
 
ubuntu1
 
ubuntu2
 
ubuntu3
 
ubuntu4

root at ubuntu:~# nano /var/lib/lxc/u5/config
lxc.utsname = u5
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.ipv4 = 10.0.10.15/24
...

root at ubuntu:~# lxc-start -n u5
lxc-start: failed to attach 'veth8yxLdO' to the bridge 'br0' : Operation not
supported
lxc-start: failed to create netdev
lxc-start: failed to create the network
lxc-start: failed to spawn 'u5'
lxc-start: No such file or directory - failed to remove cgroup
'/sys/fs/cgroup/cpuset//lxc/u5'


...........................................


If I only use LXC bridge (lxcbr0): the container (name: u5) run without
problem...:

root at ubuntu:~# nano /etc/default/lxc
...
# Leave USE_LXC_BRIDGE as "true" if you want to use lxcbr0 for your
# containers.  Set to "false" if you'll use virbr0 or another existing
# bridge, or mavlan to your host's NIC.
USE_LXC_BRIDGE="true"
...

With 0 machines running:
root at ubuntu:~# brctl show
bridge name     bridge id               STP enabled     interfaces
br0             0000.000c29eac889       no             	 d1
 
d2
 
eth0
 
ubuntu1
 
ubuntu2
 
ubuntu3
 
ubuntu4
lxcbr0          8000.000000000000       no

With 4 machines (ubuntu1,ubuntu2, ubuntu3, ubuntu4) running:
root at ubuntu:~# brctl show
bridge name     bridge id               STP enabled     interfaces
br0             0000.000c29eac889       no              	d1
 
d2
 
eth0
 
ubuntu1
 
ubuntu2
 
ubuntu3
 
ubuntu4
lxcbr0          8000.82984682d47c       no             	vethHztbk8
 
vethKxzP2d
 
vethcMi8LY
 
vethdc2FKz
	

root at ubuntu:~# nano /var/lib/lxc/u5/config
lxc.utsname = u5
lxc.network.type = veth
lxc.network.link = lxcbr0
lxc.network.flags = up

...

root at ubuntu:~# lxc-start -n u5
Ubuntu 12.04.2 LTS u5 console

u5 login:
....

Best Regards
.................................................



-----Mensaje original-----
De: Ben Pfaff [mailto:blp at nicira.com] 
Enviado el: martes, 09 de abril de 2013 11:17 AM
Para: Jose A. Posada
CC: discuss at openvswitch.org
Asunto: Re: [ovs-discuss] LXC and Open Vswitch compatibility...

Please don't drop the list.

What is lxc-start doing, more specifically?  The message that you passed
along does not give us enough information to tell what the problem is,
so we will need more information.  This means that you will have to
investigate to find out more, since the rest of us don't use LXC and
don't know what it does.  Providing obvious two-word answers only wastes
time.

On Mon, Apr 08, 2013 at 07:21:49PM -0400, Jose A. Posada wrote:
> Starting lxc-container...
> 
> -----Mensaje original-----
> De: Ben Pfaff [mailto:blp at nicira.com] 
> Enviado el: lunes, 08 de abril de 2013 11:38 AM
> Para: Jose A. Posada
> CC: discuss at openvswitch.org
> Asunto: Re: [ovs-discuss] LXC and Open Vswitch compatibility...
> 
> On Mon, Apr 08, 2013 at 10:40:39AM -0400, Jose A. Posada wrote:
> > I'm trying to set up some LXC containers combined with OVS on a Ubuntu 
> > 12.04 Desktop, in veth configuration.
> > 
> > lxc-start: failed to attach 'veth1KDOho' to the bridge 'br0' : 
> > Operation not supported
> 
> What is lxc-start doing when it prints this message?
> 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: LXC - OVS.txt
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20130410/b6e94775/attachment-0002.txt>


More information about the discuss mailing list