]> git.proxmox.com Git - ovs.git/blame - INSTALL.Libvirt.md
ovn: Fix receive from vxlan in ovn-controller.
[ovs.git] / INSTALL.Libvirt.md
CommitLineData
542cc9bb
TG
1How to Use Open vSwitch with Libvirt
2====================================
8a984481
AA
3
4This document describes how to use Open vSwitch with Libvirt 0.9.11 or
9feb1017
TG
5later. This document assumes that you followed [INSTALL.md] or installed
6Open vSwitch from distribution packaging such as a .deb or .rpm. The Open
8a984481
AA
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
542cc9bb 23 % ovs-vsctl add-br ovsbr
8a984481
AA
24
25Once that is done, create a VM, if necessary, and edit its Domain XML file:
26
542cc9bb 27 % virsh edit <vm>
8a984481 28
542cc9bb 29Lookup in the Domain XML file the `<interface>` section. There should be one
8a984481
AA
30such XML section for each interface the VM has.
31
542cc9bb 32```
8a984481
AA
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>
542cc9bb 38```
8a984481
AA
39
40And change it to something like this:
41
542cc9bb 42```
8a984481
AA
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>
542cc9bb 49 ```
8a984481 50
542cc9bb 51The interface type must be set to "bridge". The `<source>` XML element
8a984481 52specifies to which bridge this interface will be attached to. The
542cc9bb 53`<virtualport>` element indicates that the bridge in `<source>` element is an
8a984481
AA
54Open vSwitch bridge.
55
56Then (re)start the VM and verify if the guest's vnet interface is attached to
57the ovsbr bridge.
58
542cc9bb 59 % ovs-vsctl show
8a984481
AA
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.
9feb1017
TG
71
72[INSTALL.md]:INSTALL.md