~ubuntu-branches/ubuntu/wily/openvswitch/wily

« back to all changes in this revision

Viewing changes to INSTALL.Libvirt

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2015-08-10 11:35:15 UTC
  • mfrom: (1.1.30)
  • Revision ID: package-import@ubuntu.com-20150810113515-575vj06oq29emxsn
Tags: 2.4.0~git20150810.97bab95-0ubuntu1
* New upstream snapshot from 2.4 branch:
  - d/*: Align any relevant packaging changes with upstream.
* d/*: wrap-and-sort.
* d/openvswitch-{common,vswitch}.install: Correct install location for
  bash completion files.
* d/tests/openflow.py: Explicitly use ovs-testcontroller as provided
  by 2.4.0 release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
                 How to Use Open vSwitch with Libvirt
2
 
                 ====================================
3
 
 
4
 
This document describes how to use Open vSwitch with Libvirt 0.9.11 or
5
 
later. This document assumes that you followed INSTALL or installed
6
 
Open vSwitch from distribution packaging such as a .deb or .rpm. The Open
7
 
vSwitch support is included by default in Libvirt 0.9.11. Consult
8
 
www.libvirt.org for instructions on how to build the latest Libvirt, if your
9
 
Linux distribution by default comes with an older Libvirt release.
10
 
 
11
 
Limitations
12
 
-----------
13
 
Currently there is no Open vSwitch support for networks that are managed
14
 
by libvirt (e.g. NAT). As of now, only bridged networks are supported (those
15
 
where the user has to manually create the bridge).
16
 
 
17
 
Setup
18
 
-----
19
 
 
20
 
First, create the Open vSwitch bridge by using the ovs-vsctl utility (this
21
 
must be done with administrative privileges):
22
 
 
23
 
 % ovs-vsctl add-br ovsbr
24
 
 
25
 
Once that is done, create a VM, if necessary, and edit its Domain XML file:
26
 
 
27
 
 % virsh edit <vm>
28
 
 
29
 
Lookup in the Domain XML file the <interface> section. There should be one
30
 
such 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
 
 
40
 
And 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
 
 
51
 
The interface type must be set to "bridge". The <source> XML element
52
 
specifies to which bridge this interface will be attached to. The
53
 
<virtualport> element indicates that the bridge in <source> element is an
54
 
Open vSwitch bridge.
55
 
 
56
 
Then (re)start the VM and verify if the guest's vnet interface is attached to
57
 
the ovsbr bridge.
58
 
 
59
 
 % ovs-vsctl show
60
 
 
61
 
Troubleshooting
62
 
---------------
63
 
If the VM does not want to start, then try to run the libvirtd process either
64
 
from the terminal, so that all errors are printed in console, or inspect
65
 
Libvirt/Open vSwitch log files for possible root cause.
66
 
 
67
 
Bug Reporting
68
 
-------------
69
 
 
70
 
Please report problems to bugs@openvswitch.org.