]> git.proxmox.com Git - mirror_ovs.git/blame - INSTALL.Libvirt
ovs-dev.py: Add option to specify which tests to run.
[mirror_ovs.git] / INSTALL.Libvirt
CommitLineData
8a984481
AA
1 How to Use Open vSwitch with Libvirt
2 ====================================
3
4This document describes how to use Open vSwitch with Libvirt 0.9.11 or
5ca1ba48 5later. This document assumes that you followed INSTALL or installed
8a984481
AA
6Open vSwitch from distribution packaging such as a .deb or .rpm. The Open
7vSwitch support is included by default in Libvirt 0.9.11. Consult
8www.libvirt.org for instructions on how to build the latest Libvirt, if your
9Linux distribution by default comes with an older Libvirt release.
10
11Limitations
12-----------
13Currently there is no Open vSwitch support for networks that are managed
14by libvirt (e.g. NAT). As of now, only bridged networks are supported (those
15where the user has to manually create the bridge).
16
17Setup
18-----
19
20First, create the Open vSwitch bridge by using the ovs-vsctl utility (this
21must be done with administrative privileges):
22
23 % ovs-vsctl add-br ovsbr
24
25Once that is done, create a VM, if necessary, and edit its Domain XML file:
26
27 % virsh edit <vm>
28
29Lookup in the Domain XML file the <interface> section. There should be one
30such XML section for each interface the VM has.
31
32 ...
33 <interface type='network'>
34 <mac address='52:54:00:71:b1:b6'/>
35 <source network='default'/>
36 <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
37 </interface>
38 ...
39
40And change it to something like this:
41
42 ...
43 <interface type='bridge'>
44 <mac address='52:54:00:71:b1:b6'/>
45 <source bridge='ovsbr'/>
46 <virtualport type='openvswitch'/>
47 <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
48 </interface>
49 ...
50
51The interface type must be set to "bridge". The <source> XML element
52specifies to which bridge this interface will be attached to. The
53<virtualport> element indicates that the bridge in <source> element is an
54Open vSwitch bridge.
55
56Then (re)start the VM and verify if the guest's vnet interface is attached to
57the ovsbr bridge.
58
59 % ovs-vsctl show
60
61Troubleshooting
62---------------
63If the VM does not want to start, then try to run the libvirtd process either
64from the terminal, so that all errors are printed in console, or inspect
65Libvirt/Open vSwitch log files for possible root cause.
66
67Bug Reporting
68-------------
69
70Please report problems to bugs@openvswitch.org.