]> git.proxmox.com Git - mirror_ovs.git/blame - INSTALL.Libvirt.rst
dpctl: Fix usage for most dpctl commands.
[mirror_ovs.git] / INSTALL.Libvirt.rst
CommitLineData
c278f452
SF
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=========================
25Open vSwitch with Libvirt
26=========================
27
28This document describes how to use Open vSwitch with Libvirt 0.9.11 or later.
29This document assumes that you followed the `general installation guide
30<INSTALL.rst>`__ or installed Open vSwitch from distribution packaging such as
31a .deb or .rpm. The Open vSwitch support is included by default in Libvirt
320.9.11. Consult www.libvirt.org for instructions on how to build the latest
33Libvirt, if your Linux distribution by default comes with an older Libvirt
34release.
35
36Limitations
37-----------
38
39Currently there is no Open vSwitch support for networks that are managed by
40libvirt (e.g. NAT). As of now, only bridged networks are supported (those where
41the user has to manually create the bridge).
42
43Setup
44-----
45
46First, create the Open vSwitch bridge by using the ovs-vsctl utility (this must
47be done with administrative privileges)::
48
49 $ ovs-vsctl add-br ovsbr
50
51Once that is done, create a VM, if necessary, and edit its Domain XML file::
52
53 $ virsh edit <vm>
54
55Lookup in the Domain XML file the ``<interface>`` section. There should be one
56such XML section for each interface the VM has::
57
58 <interface type='network'>
59 <mac address='52:54:00:71:b1:b6'/>
60 <source network='default'/>
61 <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
62 </interface>
63
64And change it to something like this::
65
66 <interface type='bridge'>
67 <mac address='52:54:00:71:b1:b6'/>
68 <source bridge='ovsbr'/>
69 <virtualport type='openvswitch'/>
70 <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
71 </interface>
72
73The interface type must be set to ``bridge``. The ``<source>`` XML element
74specifies to which bridge this interface will be attached to. The
75``<virtualport>`` element indicates that the bridge in ``<source>`` element is
76an Open vSwitch bridge.
77
78Then (re)start the VM and verify if the guest's vnet interface is attached to
79the ovsbr bridge::
80
81 $ ovs-vsctl show
82
83Troubleshooting
84---------------
85
86If the VM does not want to start, then try to run the libvirtd process either
87from the terminal, so that all errors are printed in console, or inspect
88Libvirt/Open vSwitch log files for possible root cause.
89
90Bug Reporting
91-------------
92
93Report problems to bugs@openvswitch.org.