]> git.proxmox.com Git - ovs.git/blob - Documentation/howto/libvirt.rst
netdev-dpdk: Enable Rx checksum offloading feature on DPDK physical ports.
[ovs.git] / Documentation / howto / libvirt.rst
1 ..
2 Licensed under the Apache License, Version 2.0 (the "License"); you may
3 not use this file except in compliance with the License. You may obtain
4 a copy of the License at
5
6 http://www.apache.org/licenses/LICENSE-2.0
7
8 Unless required by applicable law or agreed to in writing, software
9 distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
10 WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
11 License for the specific language governing permissions and limitations
12 under the License.
13
14 Convention for heading levels in Open vSwitch documentation:
15
16 ======= Heading 0 (reserved for the title in a document)
17 ------- Heading 1
18 ~~~~~~~ Heading 2
19 +++++++ Heading 3
20 ''''''' Heading 4
21
22 Avoid deeper levels because they do not render well.
23
24 =========================
25 Open vSwitch with Libvirt
26 =========================
27
28 This document describes how to use Open vSwitch with Libvirt 0.9.11 or later.
29 This document assumes that you followed :doc:`/intro/install/general` or
30 installed Open vSwitch from distribution packaging such as a .deb or .rpm. The
31 Open vSwitch support is included by default in Libvirt 0.9.11. Consult
32 www.libvirt.org for instructions on how to build the latest Libvirt, if your
33 Linux distribution by default comes with an older Libvirt release.
34
35 Limitations
36 -----------
37
38 Currently there is no Open vSwitch support for networks that are managed by
39 libvirt (e.g. NAT). As of now, only bridged networks are supported (those where
40 the user has to manually create the bridge).
41
42 Setup
43 -----
44
45 First, create the Open vSwitch bridge by using the ovs-vsctl utility (this must
46 be done with administrative privileges)::
47
48 $ ovs-vsctl add-br ovsbr
49
50 Once that is done, create a VM, if necessary, and edit its Domain XML file::
51
52 $ virsh edit <vm>
53
54 Lookup in the Domain XML file the ``<interface>`` section. There should be one
55 such XML section for each interface the VM has::
56
57 <interface type='network'>
58 <mac address='52:54:00:71:b1:b6'/>
59 <source network='default'/>
60 <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
61 </interface>
62
63 And change it to something like this::
64
65 <interface type='bridge'>
66 <mac address='52:54:00:71:b1:b6'/>
67 <source bridge='ovsbr'/>
68 <virtualport type='openvswitch'/>
69 <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
70 </interface>
71
72 The interface type must be set to ``bridge``. The ``<source>`` XML element
73 specifies to which bridge this interface will be attached to. The
74 ``<virtualport>`` element indicates that the bridge in ``<source>`` element is
75 an Open vSwitch bridge.
76
77 Then (re)start the VM and verify if the guest's vnet interface is attached to
78 the ovsbr bridge::
79
80 $ ovs-vsctl show
81
82 Troubleshooting
83 ---------------
84
85 If the VM does not want to start, then try to run the libvirtd process either
86 from the terminal, so that all errors are printed in console, or inspect
87 Libvirt/Open vSwitch log files for possible root cause.
88
89 Bug Reporting
90 -------------
91
92 Report problems to bugs@openvswitch.org.