1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
5 This file is autogenerated from drvxen.html.in
6 Do not edit this file. Changes will be lost.
9 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
10 <link rel="stylesheet" type="text/css" href="main.css" />
11 <link rel="SHORTCUT ICON" href="32favicon.png" />
12 <title>libvirt: Xen hypervisor driver</title>
13 <meta name="description" content="libvirt, virtualization, virtualization API" />
17 <div id="headerLogo"></div>
18 <div id="headerSearch">
19 <form action="search.php" enctype="application/x-www-form-urlencoded" method="get"><div>
20 <input id="query" name="query" type="text" size="12" value="" />
21 <input id="submit" name="submit" type="submit" value="Search" />
29 <a title="Front page of the libvirt website" class="inactive" href="index.html">Home</a>
33 <a title="Details of new features and bugs fixed in each release" class="inactive" href="news.html">News</a>
37 <a title="Applications known to use libvirt" class="inactive" href="apps.html">Applications</a>
41 <a title="Get the latest source releases, binary builds and get access to the source repository" class="inactive" href="downloads.html">Downloads</a>
45 <a title="Information for users, administrators and developers" class="active" href="docs.html">Documentation</a>
48 <a title="How to compile libvirt" class="inactive" href="compiling.html">Compiling</a>
52 <a title="Information about deploying and using libvirt" class="inactive" href="deployment.html">Deployment</a>
56 <a title="Overview of the logical subsystems in the libvirt API" class="inactive" href="intro.html">Architecture</a>
60 <a title="Description of the XML formats used in libvirt" class="inactive" href="format.html">XML format</a>
64 <a title="Hypervisor specific driver information" class="active" href="drivers.html">Drivers</a>
67 <span class="active">Xen</span>
71 <a title="Driver for QEMU, KQEMU, KVM and Xenner" class="inactive" href="drvqemu.html">QEMU / KVM</a>
75 <a title="Driver for the Linux native container API" class="inactive" href="drvlxc.html">Linux Container</a>
79 <a title="Pseudo-driver simulating APIs in memory for test suites" class="inactive" href="drvtest.html">Test</a>
83 <a title="Driver providing secure remote to the libvirt APIs" class="inactive" href="drvremote.html">Remote</a>
87 <a title="Driver for the OpenVZ container technology" class="inactive" href="drvopenvz.html">OpenVZ</a>
91 <a title="Driver for the User Mode Linux technology" class="inactive" href="drvuml.html">UML</a>
95 <a title="Driver for the storage management APIs" class="inactive" href="storage.html">Storage</a>
99 <a title="Driver for VirtualBox" class="inactive" href="drvvbox.html">VirtualBox</a>
103 <a title="Driver for VMware ESX" class="inactive" href="drvesx.html">VMware ESX</a>
107 <a title="Driver for VMware Workstation / Player" class="inactive" href="drvvmware.html">VMware Workstation / Player</a>
111 <a title="Driver for Microsoft Hyper-V" class="inactive" href="drvhyperv.html">Microsoft Hyper-V</a>
115 <a title="Driver for IBM PowerVM" class="inactive" href="drvphyp.html">IBM PowerVM</a>
119 <a title="Driver for Parallels Cloud Server" class="inactive" href="drvparallels.html">Parallels</a>
123 <a title="Driver for bhyve" class="inactive" href="drvbhyve.html">Bhyve</a>
129 <a title="Reference manual for the C public API" class="inactive" href="html/index.html">API reference</a>
133 <a title="Bindings of the libvirt API for other languages" class="inactive" href="bindings.html">Language bindings</a>
137 <a title="Working on the internals of libvirt API, driver and daemon code" class="inactive" href="internals.html">Internals</a>
141 <a title="A guide and reference for developing with libvirt" class="inactive" href="devguide.html">Development Guide</a>
145 <a title="Command reference for virsh" class="inactive" href="virshcmdref.html">Virsh Commands</a>
149 <a title="Project governance and code of conduct" class="inactive" href="governance.html">Governance</a>
155 <a title="User contributed content" class="inactive" href="http://wiki.libvirt.org">Wiki</a>
159 <a title="Frequently asked questions" class="inactive" href="http://wiki.libvirt.org/page/FAQ">FAQ</a>
163 <a title="How and where to report bugs and request features" class="inactive" href="bugs.html">Bug reports</a>
167 <a title="How to contact the developers via email and IRC" class="inactive" href="contact.html">Contact</a>
171 <a title="Available test suites for libvirt" class="inactive" href="testsuites.html">Test suites</a>
175 <a title="Miscellaneous links of interest related to libvirt" class="inactive" href="relatedlinks.html">Related Links</a>
179 <a title="Overview of all content on the website" class="inactive" href="sitemap.html">Sitemap</a>
184 <h1>Xen hypervisor driver</h1>
186 <a href="#project">Project Links</a>
188 <a href="#prereq">Deployment pre-requisites</a>
190 <a href="#uri">Connections to Xen driver</a>
192 <a href="#imex">Import and export of libvirt domain XML configs</a>
194 <a href="#xmlimport">Converting from XM config files to domain XML</a>
196 <a href="#xmlexport">Converting from domain XML to XM config files</a>
199 <a href="#xmlconfig">Example domain XML config</a>
202 The libvirt Xen driver provides the ability to manage virtual machines
203 on any Xen release from 3.0.1 onwards.
206 <a name="project" shape="rect" id="project">Project Links</a>
207 <a class="headerlink" href="#project" title="Permalink to this headline">¶</a>
210 The <a href="http://www.cl.cam.ac.uk/Research/SRG/netos/xen/index.html" shape="rect">Xen</a>
211 hypervisor on Linux and Solaris hosts
214 <a name="prereq" shape="rect" id="prereq">Deployment pre-requisites</a>
215 <a class="headerlink" href="#prereq" title="Permalink to this headline">¶</a>
218 The libvirt Xen driver uses a combination of channels to manage Xen
222 <strong>XenD</strong>: Access to the Xen daemon is a mandatory
223 requirement for the libvirt Xen driver. It requires that the UNIX
224 socket interface be enabled in the <code>/etc/xen/xend-config.sxp</code>
225 configuration file. Specifically the config settings
226 <code>(xend-unix-server yes)</code>. This path is usually restricted
227 to only allow the <code>root</code> user access. As an alternative,
228 the HTTP interface can be used, however, this has significant security
231 <strong>XenStoreD</strong>: Access to the Xenstore daemon enables
232 more efficient codepaths for looking up domain information which
233 lowers the CPU overhead of management.
235 <strong>Hypercalls</strong>: The ability to make direct hypercalls
236 allows the most efficient codepaths in the driver to be used for
237 monitoring domain status.
239 <strong>XM config</strong>: When using Xen releases prior to 3.0.4,
240 there is no inactive domain management in XenD. For such releases,
241 libvirt will automatically process XM configuration files kept in
242 the <code>/etc/xen</code> directory. It is important not to place
243 any other non-config files in this directory.
245 <strong>libxl</strong>: Starting with Xen 4.2, the legacy XenD/xm
246 toolstack is deprecated in favor of libxl, also commonly called
247 libxenlight. libvirt supports this new Xen toolstack via the
248 libxl driver. If XenD is enabled, the legacy xen driver consisting
249 of the above mentioned channels will be used. If XenD is disabled,
250 the libxl driver will be used.
253 <a name="uri" shape="rect" id="uri">Connections to Xen driver</a>
254 <a class="headerlink" href="#uri" title="Permalink to this headline">¶</a>
257 The libvirt Xen driver is a single-instance privileged driver,
258 with a driver name of 'xen'. Some example connection URIs for
259 the libvirt driver are:
261 <pre xml:space="preserve">
262 xen:/// (local access, direct)
263 xen+unix:/// (local access, via daemon)
264 xen://example.com/ (remote access, TLS/x509)
265 xen+tcp://example.com/ (remote access, SASl/Kerberos)
266 xen+ssh://root@example.com/ (remote access, SSH tunnelled)
269 <a name="imex" shape="rect" id="imex">Import and export of libvirt domain XML configs</a>
270 <a class="headerlink" href="#imex" title="Permalink to this headline">¶</a>
272 <p>The Xen driver currently supports two native
273 config formats. The first known as <code>xen-xm</code> is the format
274 used by the XM tool for files in <code>/etc/xen</code>. The second
275 known as <code>xen-sxpr</code>, is the format used for interacting
276 with the XenD's legacy HTTP RPC service.</p>
278 <a name="xmlimport" shape="rect" id="xmlimport">Converting from XM config files to domain XML</a>
279 <a class="headerlink" href="#xmlimport" title="Permalink to this headline">¶</a>
282 The <code>virsh domxml-from-native</code> provides a way to convert an
283 existing set of XM config files into a guest description using libvirt Domain XML
284 that can then be used by libvirt.
286 <pre xml:space="preserve">$ virsh -c xen:/// domxml-from-native xen-xm rhel5.cfg
287 <domain type='xen'>
288 <name>rhel5pv</name>
289 <uuid>8f07fe28-753f-2729-d76d-bdbd892f949a</uuid>
290 <memory>2560000</memory>
291 <currentMemory>307200</currentMemory>
292 <vcpu>4</vcpu>
293 <bootloader>/usr/bin/pygrub</bootloader>
295 <type arch='x86_64' machine='xenpv'>linux</type>
297 <clock offset='utc'/>
298 <on_poweroff>destroy</on_poweroff>
299 <on_reboot>restart</on_reboot>
300 <on_crash>restart</on_crash>
302 <disk type='file' device='disk'>
303 <driver name='tap' type='aio'/>
304 <source file='/var/lib/xen/images/rhel5pv.img'/>
305 <target dev='xvda' bus='xen'/>
307 <disk type='file' device='disk'>
308 <driver name='tap' type='qcow'/>
309 <source file='/root/qcow1-xen.img'/>
310 <target dev='xvdd' bus='xen'/>
312 <interface type='bridge'>
313 <mac address='00:16:3e:60:36:ba'/>
314 <source bridge='xenbr0'/>
316 <console type='pty'>
317 <target port='0'/>
319 <input type='mouse' bus='xen'/>
320 <graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'/>
322 </domain></pre>
324 <a name="xmlexport" shape="rect" id="xmlexport">Converting from domain XML to XM config files</a>
325 <a class="headerlink" href="#xmlexport" title="Permalink to this headline">¶</a>
328 The <code>virsh domxml-to-native</code> provides a way to convert a
329 guest description using libvirt Domain XML, into the XM config file
332 <pre xml:space="preserve">$ virsh -c xen:/// domxml-to-native xen-xm rhel5pv.xml
334 uuid = "8f07fe28-753f-2729-d76d-bdbd892f949a"
338 bootloader = "/usr/bin/pygrub"
339 kernel = "/var/lib/xen/boot_kernel.0YK-cS"
340 ramdisk = "/var/lib/xen/boot_ramdisk.vWgrxK"
341 extra = "ro root=/dev/VolGroup00/LogVol00 rhgb quiet"
342 on_poweroff = "destroy"
343 on_reboot = "restart"
348 vnclisten = "0.0.0.0"
349 disk = [ "tap:aio:/var/lib/xen/images/rhel5pv.img,xvda,w", "tap:qcow:/root/qcow1-xen.img,xvdd,w" ]
350 vif = [ "mac=00:16:3e:60:36:ba,bridge=virbr0,script=vif-bridge,vifname=vif5.0" ]</pre>
352 <a name="xmlconfig" shape="rect" id="xmlconfig">Example domain XML config</a>
353 <a class="headerlink" href="#xmlconfig" title="Permalink to this headline">¶</a>
356 Below are some example XML configurations for Xen guest domains.
357 For full details of the available options, consult the <a href="formatdomain.html" shape="rect">domain XML format</a>
360 <h3>Paravirtualized guest bootloader</h3>
362 Using a bootloader allows a paravirtualized guest to be booted using
363 a kernel stored inside its virtual disk image
365 <pre xml:space="preserve"><domain type='xen' >
366 <name>fc8</name>
367 <bootloader>/usr/bin/pygrub</bootloader>
369 <type>linux</type>
371 <memory>131072</memory>
372 <vcpu>1</vcpu>
374 <disk type='file'>
375 <source file='/var/lib/xen/images/fc4.img'/>
376 <target dev='sda1'/>
378 <interface type='bridge'>
379 <source bridge='xenbr0'/>
380 <mac address='aa:00:00:00:00:11'/>
381 <script path='/etc/xen/scripts/vif-bridge'/>
383 <console tty='/dev/pts/5'/>
385 </domain></pre>
386 <h3>Paravirtualized guest direct kernel boot</h3>
388 For installation of paravirtualized guests it is typical to boot the
389 domain using a kernel and initrd stored in the host OS
391 <pre xml:space="preserve"><domain type='xen' >
392 <name>fc8</name>
394 <type>linux</type>
395 <kernel>/var/lib/xen/install/vmlinuz-fedora8-x86_64</kernel>
396 <initrd>/var/lib/xen/install/initrd-vmlinuz-fedora8-x86_64</initrd>
397 <cmdline> kickstart=http://example.com/myguest.ks </cmdline>
399 <memory>131072</memory>
400 <vcpu>1</vcpu>
402 <disk type='file'>
403 <source file='/var/lib/xen/images/fc4.img'/>
404 <target dev='sda1'/>
406 <interface type='bridge'>
407 <source bridge='xenbr0'/>
408 <mac address='aa:00:00:00:00:11'/>
409 <script path='/etc/xen/scripts/vif-bridge'/>
411 <graphics type='vnc' port='-1'/>
412 <console tty='/dev/pts/5'/>
414 </domain></pre>
415 <h3>Fullyvirtualized guest BIOS boot</h3>
417 Fullyvirtualized guests use the emulated BIOS to boot off the primary
418 harddisk, CDROM or Network PXE ROM.
420 <pre xml:space="preserve"><domain type='xen' id='3'>
421 <name>fv0</name>
422 <uuid>4dea22b31d52d8f32516782e98ab3fa0</uuid>
424 <type>hvm</type>
425 <loader>/usr/lib/xen/boot/hvmloader</loader>
426 <boot dev='hd'/>
428 <memory>524288</memory>
429 <vcpu>1</vcpu>
430 <on_poweroff>destroy</on_poweroff>
431 <on_reboot>restart</on_reboot>
432 <on_crash>restart</on_crash>
438 <clock sync="localtime"/>
440 <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
441 <interface type='bridge'>
442 <source bridge='xenbr0'/>
443 <mac address='00:16:3e:5d:c7:9e'/>
444 <script path='vif-bridge'/>
446 <disk type='file'>
447 <source file='/var/lib/xen/images/fv0'/>
448 <target dev='hda'/>
450 <disk type='file' device='cdrom'>
451 <source file='/var/lib/xen/images/fc5-x86_64-boot.iso'/>
452 <target dev='hdc'/>
455 <disk type='file' device='floppy'>
456 <source file='/root/fd.img'/>
457 <target dev='fda'/>
459 <graphics type='vnc' port='5904'/>
461 </domain></pre>
462 <h3>Fullyvirtualized guest direct kernel boot</h3>
464 With Xen 3.2.0 or later it is possible to bypass the BIOS and directly
465 boot a Linux kernel and initrd as a fullyvirtualized domain. This allows
466 for complete automation of OS installation, for example using the Anaconda
469 <pre xml:space="preserve"><domain type='xen' id='3'>
470 <name>fv0</name>
471 <uuid>4dea22b31d52d8f32516782e98ab3fa0</uuid>
473 <type>hvm</type>
474 <loader>/usr/lib/xen/boot/hvmloader</loader>
475 <kernel>/var/lib/xen/install/vmlinuz-fedora8-x86_64</kernel>
476 <initrd>/var/lib/xen/install/initrd-vmlinuz-fedora8-x86_64</initrd>
477 <cmdline> kickstart=http://example.com/myguest.ks </cmdline>
479 <memory>524288</memory>
480 <vcpu>1</vcpu>
481 <on_poweroff>destroy</on_poweroff>
482 <on_reboot>restart</on_reboot>
483 <on_crash>restart</on_crash>
489 <clock sync="localtime"/>
491 <emulator>/usr/lib/xen/bin/qemu-dm</emulator>
492 <interface type='bridge'>
493 <source bridge='xenbr0'/>
494 <mac address='00:16:3e:5d:c7:9e'/>
495 <script path='vif-bridge'/>
497 <disk type='file'>
498 <source file='/var/lib/xen/images/fv0'/>
499 <target dev='hda'/>
501 <disk type='file' device='cdrom'>
502 <source file='/var/lib/xen/images/fc5-x86_64-boot.iso'/>
503 <target dev='hdc'/>
506 <disk type='file' device='floppy'>
507 <source file='/root/fd.img'/>
508 <target dev='fda'/>
510 <graphics type='vnc' port='5904'/>
512 </domain></pre>
517 Sponsored by:<br /><a href="http://et.redhat.com/"><img src="et.png" alt="Project sponsored by Red Hat Emerging Technology" /></a></p>