backup: Wire up qemu full pull backup commands over QMP
[libvirt/ericb.git] / docs / drvxen.html.in
blobb2f41c17632e2e424a0ff9a6908084528dd04180
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE html>
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <body>
5 <h1>libxl hypervisor driver for Xen</h1>
7 <ul id="toc"></ul>
9 <p>
10 The libvirt libxl driver provides the ability to manage virtual
11 machines on any Xen release from 4.6.0 onwards.
12 </p>
14 <h2><a id="project">Project Links</a></h2>
16 <ul>
17 <li>
18 The <a href="https://www.xenproject.org">Xen</a>
19 hypervisor on Linux and Solaris hosts
20 </li>
21 </ul>
23 <h2><a id="prereq">Deployment pre-requisites</a></h2>
25 <p>
26 The libvirt libxl driver uses Xen's libxl API, also known as
27 libxenlight, to implement libvirt's hypervisor driver
28 functionality. libxl provides a consolidated interface for
29 managing a Xen host and its virtual machines, unlike old
30 versions of Xen where applications often had to communicate
31 with xend, xenstored, and the hypervisor itself via hypercalls.
32 With libxl the only pre-requisit is a properly installed Xen
33 host with the libxl toolstack running in a service domain
34 (often Domain-0).
35 </p>
37 <h2><a id="uri">Connections to libxl driver</a></h2>
39 <p>
40 The libvirt libxl driver is a single-instance privileged driver,
41 with a driver name of 'xen'. Some example connection URIs for
42 the libxl driver are:
43 </p>
45 <pre>
46 xen:///system (local access, direct)
47 xen+unix:///system (local access, via daemon)
48 xen://example.com/system (remote access, TLS/x509)
49 xen+tcp://example.com/system (remote access, SASl/Kerberos)
50 xen+ssh://root@example.com/system (remote access, SSH tunnelled)
51 </pre>
53 <h2><a id="imex">Import and export of libvirt domain XML configs</a></h2>
55 <p>
56 The libxl driver currently supports three native
57 config formats. The first, known as <code>xen-xm</code>, is the
58 original Xen virtual machine config format used by the legacy
59 xm/xend toolstack. The second, known as <code>xen-sxpr</code>,
60 is also one of the original formats that was used by xend's
61 legacy HTTP RPC service (<span class='removed'>removed in 5.6.0</span>)
62 </p>
64 <p>
65 The third format is <code>xen-xl</code>, which is the virtual
66 machine config format supported by modern Xen. The <code>xen-xl</code>
67 format is described in the xl.cfg(5) man page.
68 </p>
70 <h3><a id="xmlimport">Converting from XM config files to domain XML</a></h3>
72 <p>
73 The <code>virsh domxml-from-native</code> provides a way to convert an
74 existing set of xl, xm, or sxpr config files to libvirt Domain XML,
75 which can then be used by libvirt.
76 </p>
78 <pre>$ virsh -c xen:///system domxml-from-native xen-xm rhel5.cfg
79 &lt;domain type='xen'&gt;
80 &lt;name&gt;rhel5pv&lt;/name&gt;
81 &lt;uuid&gt;8f07fe28-753f-2729-d76d-bdbd892f949a&lt;/uuid&gt;
82 &lt;memory&gt;2560000&lt;/memory&gt;
83 &lt;currentMemory&gt;307200&lt;/currentMemory&gt;
84 &lt;vcpu&gt;4&lt;/vcpu&gt;
85 &lt;bootloader&gt;/usr/bin/pygrub&lt;/bootloader&gt;
86 &lt;os&gt;
87 &lt;type arch='x86_64' machine='xenpv'&gt;linux&lt;/type&gt;
88 &lt;/os&gt;
89 &lt;clock offset='utc'/&gt;
90 &lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;
91 &lt;on_reboot&gt;restart&lt;/on_reboot&gt;
92 &lt;on_crash&gt;restart&lt;/on_crash&gt;
93 &lt;devices&gt;
94 &lt;disk type='file' device='disk'&gt;
95 &lt;driver name='tap' type='aio'/&gt;
96 &lt;source file='/var/lib/xen/images/rhel5pv.img'/&gt;
97 &lt;target dev='xvda' bus='xen'/&gt;
98 &lt;/disk&gt;
99 &lt;disk type='file' device='disk'&gt;
100 &lt;driver name='tap' type='qcow'/&gt;
101 &lt;source file='/root/qcow1-xen.img'/&gt;
102 &lt;target dev='xvdd' bus='xen'/&gt;
103 &lt;/disk&gt;
104 &lt;interface type='bridge'&gt;
105 &lt;mac address='00:16:3e:60:36:ba'/&gt;
106 &lt;source bridge='xenbr0'/&gt;
107 &lt;/interface&gt;
108 &lt;console type='pty'&gt;
109 &lt;target port='0'/&gt;
110 &lt;/console&gt;
111 &lt;input type='mouse' bus='xen'/&gt;
112 &lt;graphics type='vnc' port='-1' autoport='yes' listen='0.0.0.0'/&gt;
113 &lt;/devices&gt;
114 &lt;/domain&gt;</pre>
116 <h3><a id="xmlexport">Converting from domain XML to XM config files</a></h3>
119 The <code>virsh domxml-to-native</code> provides a way to convert a
120 guest description using libvirt Domain XML into xl, xm, or sxpr config
121 format.
122 </p>
124 <pre>$ virsh -c xen:///system domxml-to-native xen-xm rhel5pv.xml
125 name = "rhel5pv"
126 uuid = "8f07fe28-753f-2729-d76d-bdbd892f949a"
127 maxmem = 2500
128 memory = 300
129 vcpus = 4
130 bootloader = "/usr/bin/pygrub"
131 kernel = "/var/lib/xen/boot_kernel.0YK-cS"
132 ramdisk = "/var/lib/xen/boot_ramdisk.vWgrxK"
133 extra = "ro root=/dev/VolGroup00/LogVol00 rhgb quiet"
134 on_poweroff = "destroy"
135 on_reboot = "restart"
136 on_crash = "restart"
137 sdl = 0
138 vnc = 1
139 vncunused = 1
140 vnclisten = "0.0.0.0"
141 disk = [ "tap:aio:/var/lib/xen/images/rhel5pv.img,xvda,w", "tap:qcow:/root/qcow1-xen.img,xvdd,w" ]
142 vif = [ "mac=00:16:3e:60:36:ba,bridge=virbr0,script=vif-bridge,vifname=vif5.0" ]</pre>
144 <h2><a id="xmlconfig">Example domain XML config</a></h2>
147 Below are some example XML configurations for Xen guest domains.
148 For full details of the available options, consult the <a href="formatdomain.html">domain XML format</a>
149 guide.
150 </p>
152 <h3>Paravirtualized guest bootloader</h3>
155 Using a bootloader allows a paravirtualized guest to be booted using
156 a kernel stored inside its virtual disk image
157 </p>
159 <pre>&lt;domain type='xen' &gt;
160 &lt;name&gt;fc8&lt;/name&gt;
161 &lt;bootloader&gt;/usr/bin/pygrub&lt;/bootloader&gt;
162 &lt;os&gt;
163 &lt;type&gt;linux&lt;/type&gt;
164 &lt;/os&gt;
165 &lt;memory&gt;131072&lt;/memory&gt;
166 &lt;vcpu&gt;1&lt;/vcpu&gt;
167 &lt;devices&gt;
168 &lt;disk type='file'&gt;
169 &lt;source file='/var/lib/xen/images/fc4.img'/&gt;
170 &lt;target dev='sda1'/&gt;
171 &lt;/disk&gt;
172 &lt;interface type='bridge'&gt;
173 &lt;source bridge='xenbr0'/&gt;
174 &lt;mac address='aa:00:00:00:00:11'/&gt;
175 &lt;script path='/etc/xen/scripts/vif-bridge'/&gt;
176 &lt;/interface&gt;
177 &lt;console tty='/dev/pts/5'/&gt;
178 &lt;/devices&gt;
179 &lt;/domain&gt;</pre>
181 <h3>Paravirtualized guest direct kernel boot</h3>
184 For installation of paravirtualized guests it is typical to boot the
185 domain using a kernel and initrd stored in the host OS
186 </p>
188 <pre>&lt;domain type='xen' &gt;
189 &lt;name&gt;fc8&lt;/name&gt;
190 &lt;os&gt;
191 &lt;type&gt;linux&lt;/type&gt;
192 &lt;kernel&gt;/var/lib/xen/install/vmlinuz-fedora8-x86_64&lt;/kernel&gt;
193 &lt;initrd&gt;/var/lib/xen/install/initrd-vmlinuz-fedora8-x86_64&lt;/initrd&gt;
194 &lt;cmdline&gt; kickstart=http://example.com/myguest.ks &lt;/cmdline&gt;
195 &lt;/os&gt;
196 &lt;memory&gt;131072&lt;/memory&gt;
197 &lt;vcpu&gt;1&lt;/vcpu&gt;
198 &lt;devices&gt;
199 &lt;disk type='file'&gt;
200 &lt;source file='/var/lib/xen/images/fc4.img'/&gt;
201 &lt;target dev='sda1'/&gt;
202 &lt;/disk&gt;
203 &lt;interface type='bridge'&gt;
204 &lt;source bridge='xenbr0'/&gt;
205 &lt;mac address='aa:00:00:00:00:11'/&gt;
206 &lt;script path='/etc/xen/scripts/vif-bridge'/&gt;
207 &lt;/interface&gt;
208 &lt;graphics type='vnc' port='-1'/&gt;
209 &lt;console tty='/dev/pts/5'/&gt;
210 &lt;/devices&gt;
211 &lt;/domain&gt;</pre>
213 <h3>Fullyvirtualized guest BIOS boot</h3>
216 Fullyvirtualized guests use the emulated BIOS to boot off the primary
217 harddisk, CDROM or Network PXE ROM.
218 </p>
220 <pre>&lt;domain type='xen' id='3'&gt;
221 &lt;name&gt;fv0&lt;/name&gt;
222 &lt;uuid&gt;4dea22b31d52d8f32516782e98ab3fa0&lt;/uuid&gt;
223 &lt;os&gt;
224 &lt;type&gt;hvm&lt;/type&gt;
225 &lt;loader&gt;/usr/lib/xen/boot/hvmloader&lt;/loader&gt;
226 &lt;boot dev='hd'/&gt;
227 &lt;/os&gt;
228 &lt;memory&gt;524288&lt;/memory&gt;
229 &lt;vcpu&gt;1&lt;/vcpu&gt;
230 &lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;
231 &lt;on_reboot&gt;restart&lt;/on_reboot&gt;
232 &lt;on_crash&gt;restart&lt;/on_crash&gt;
233 &lt;features&gt;
234 &lt;pae/&gt;
235 &lt;acpi/&gt;
236 &lt;apic/&gt;
237 &lt;/features&gt;
238 &lt;clock sync="localtime"/&gt;
239 &lt;devices&gt;
240 &lt;emulator&gt;/usr/lib/xen/bin/qemu-dm&lt;/emulator&gt;
241 &lt;interface type='bridge'&gt;
242 &lt;source bridge='xenbr0'/&gt;
243 &lt;mac address='00:16:3e:5d:c7:9e'/&gt;
244 &lt;script path='vif-bridge'/&gt;
245 &lt;/interface&gt;
246 &lt;disk type='file'&gt;
247 &lt;source file='/var/lib/xen/images/fv0'/&gt;
248 &lt;target dev='hda'/&gt;
249 &lt;/disk&gt;
250 &lt;disk type='file' device='cdrom'&gt;
251 &lt;source file='/var/lib/xen/images/fc5-x86_64-boot.iso'/&gt;
252 &lt;target dev='hdc'/&gt;
253 &lt;readonly/&gt;
254 &lt;/disk&gt;
255 &lt;disk type='file' device='floppy'&gt;
256 &lt;source file='/root/fd.img'/&gt;
257 &lt;target dev='fda'/&gt;
258 &lt;/disk&gt;
259 &lt;graphics type='vnc' port='5904'/&gt;
260 &lt;/devices&gt;
261 &lt;/domain&gt;</pre>
263 <h3>Fullyvirtualized guest direct kernel boot</h3>
266 With Xen 3.2.0 or later it is possible to bypass the BIOS and directly
267 boot a Linux kernel and initrd as a fullyvirtualized domain. This allows
268 for complete automation of OS installation, for example using the Anaconda
269 kickstart support.
270 </p>
272 <pre>&lt;domain type='xen' id='3'&gt;
273 &lt;name&gt;fv0&lt;/name&gt;
274 &lt;uuid&gt;4dea22b31d52d8f32516782e98ab3fa0&lt;/uuid&gt;
275 &lt;os&gt;
276 &lt;type&gt;hvm&lt;/type&gt;
277 &lt;loader&gt;/usr/lib/xen/boot/hvmloader&lt;/loader&gt;
278 &lt;kernel&gt;/var/lib/xen/install/vmlinuz-fedora8-x86_64&lt;/kernel&gt;
279 &lt;initrd&gt;/var/lib/xen/install/initrd-vmlinuz-fedora8-x86_64&lt;/initrd&gt;
280 &lt;cmdline&gt; kickstart=http://example.com/myguest.ks &lt;/cmdline&gt;
281 &lt;/os&gt;
282 &lt;memory&gt;524288&lt;/memory&gt;
283 &lt;vcpu&gt;1&lt;/vcpu&gt;
284 &lt;on_poweroff&gt;destroy&lt;/on_poweroff&gt;
285 &lt;on_reboot&gt;restart&lt;/on_reboot&gt;
286 &lt;on_crash&gt;restart&lt;/on_crash&gt;
287 &lt;features&gt;
288 &lt;pae/&gt;
289 &lt;acpi/&gt;
290 &lt;apic/&gt;
291 &lt;/features&gt;
292 &lt;clock sync="localtime"/&gt;
293 &lt;devices&gt;
294 &lt;emulator&gt;/usr/lib/xen/bin/qemu-dm&lt;/emulator&gt;
295 &lt;interface type='bridge'&gt;
296 &lt;source bridge='xenbr0'/&gt;
297 &lt;mac address='00:16:3e:5d:c7:9e'/&gt;
298 &lt;script path='vif-bridge'/&gt;
299 &lt;/interface&gt;
300 &lt;disk type='file'&gt;
301 &lt;source file='/var/lib/xen/images/fv0'/&gt;
302 &lt;target dev='hda'/&gt;
303 &lt;/disk&gt;
304 &lt;disk type='file' device='cdrom'&gt;
305 &lt;source file='/var/lib/xen/images/fc5-x86_64-boot.iso'/&gt;
306 &lt;target dev='hdc'/&gt;
307 &lt;readonly/&gt;
308 &lt;/disk&gt;
309 &lt;disk type='file' device='floppy'&gt;
310 &lt;source file='/root/fd.img'/&gt;
311 &lt;target dev='fda'/&gt;
312 &lt;/disk&gt;
313 &lt;graphics type='vnc' port='5904'/&gt;
314 &lt;/devices&gt;
315 &lt;/domain&gt;</pre>
317 </body>
318 </html>