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