[ovs-discuss] Openswitch VM to VM traffic switching

Todd Deshane deshantm at gmail.com
Wed May 12 16:43:11 UTC 2010

Hi Praveen,

Comments inline.

On Tue, May 11, 2010 at 2:36 AM, Praveen Reguraman <preguraman at gmail.com> wrote:
> Hi,
>     I am beginner with Openvswitch and am trying to configure VMs and switch
> traffic between them.
> My setup:
>               Ubuntu v 10.0.4 with KVM and virt-manager 0.8.2
>               Openvswitch 0.99.2 - Compiled and installed including kernel
> module. While installing the Openvswitch kernel module, I had disabled linux
> bridge module.
> Config:
>           I have created br0 with Openvswitch using 'ovs-vsctl add-br br0'
> and added eth0 to this bridge. I also created another bridge br1. I used
> 'ifconfig' to configure an IP to the bridge interfaces.
> I am using virt-manager to create two instances of Ubuntu virtual machines.
> While trying to create virtual machine, am trying to associate the virtual
> NICs of the VMs to one of these bridges br0/br1. It consistently fails
> throwing an error,
> 'br0 not a TAP device'. and VM install fails. Is it somehow trying to use
> any user space module? Or anything wrong with the way I create the bridge?

I think the problem that you are running into is with how libvirt
brings up the networking on VMs.

Particularly, with qemu/KVM guests a qemu-ifup or kvm-ifup script is used.

My qemu-ifup and down scripts are below, but I was using 0.99.1, so I
think that you might
want to instead of working with the config file, run the appropriate
ovs-vsctl add-port command.

My guess is that it would be something like:

ovs-vsctl add-port ${switch} $1
(instead of the echo into the config file as I do below).

Similarly, you will need to del-port on qemu-ifdown

You man want to try using kvm directly and passing custom scripts manually

something like:
-net tap,script=custom-qemu-ifup,downscript=custom-qemu-ifdown

 '''sudo''' /sbin/ifconfig $1 up
echo "bridge.${switch}.port=$1" | sudo tee -a /etc/ovs/ovs-vswitchd.conf
exit 0

sed -i "/$1/d" /etc/ovs/ovs-vswitchd.conf
/sbin/ifconfig $1 down

> I would like to create two VMs on bridge br1 and assign IPs to the virtual
> NICs and be able to ping the other VM as a basic test.
> Can someone help me out?

I should be able to test myself soon, but let us know if you get it
working and we can try to help out more.


Todd Deshane

More information about the discuss mailing list