Debian Codegraph @

docs/man/xl-disk-configuration.5.pod.in

raw
1 =head1 NAME
2
3 xl-disk-configuration - XL Disk Configuration Syntax
4
5 =head1 SYNTAX
6
7 This document specifies the xl config file format disk configuration
8 option. It has the following form:
9
10 disk = [ 'DISKSPEC', 'DISKSPEC', ... ]
11
12 where each C<DISKSPEC> is in this form:
13
14 [<key>=<value>|<flag>,]*,
15 [<target>, [<format>, [<vdev>, [<access>]]]],
16 [<key>=<value>|<flag>,]*
17 [target=<target>]
18
19 For example, these strings are equivalent:
20
21 /dev/vg/guest-volume,,hda
22 /dev/vg/guest-volume,raw,hda,rw
23 format=raw, vdev=hda, access=rw, target=/dev/vg/guest-volume
24 raw:/dev/vg/guest-volume,hda,w (deprecated, see below)
25
26 As are these:
27
28 /root/image.iso,,hdc,cdrom
29 /root/image.iso,,hdc,,cdrom
30 /root/image.iso,raw,hdc,devtype=cdrom
31 format=raw, vdev=hdc, access=ro, devtype=cdrom, target=/root/image.iso
32 raw:/root/image.iso,hdc:cdrom,ro (deprecated, see below)
33
34 These might be specified in the domain config file like this:
35
36 disk = [ '/dev/vg/guest-volume,,hda', '/root/image.iso,,hdc,cdrom' ]
37
38
39 More formally, the string is a series of comma-separated keyword/value
40 pairs, flags and positional parameters. Parameters which are not bare
41 keywords and which do not contain "=" symbols are assigned to the
42 so-far-unspecified positional parameters, in the order below. The
43 positional parameters may also be specified explicitly by name.
44
45 Each parameter may be specified at most once, either as a positional
46 parameter or a named parameter. Default values apply if the parameter
47 is not specified, or if it is specified with an empty value (whether
48 positionally or explicitly).
49
50 Whitespace may appear before each parameter and will be ignored.
51
52 =head1 Positional Parameters
53
54 =over 4
55
56 =item B<target>
57
58 =over 4
59
60 =item Description
61
62 Block device or image file path. When this is used as a path, F</dev>
63 will be prepended if the path doesn't start with a '/'.
64
65 =item Supported values
66
67 N/A
68
69 =item Deprecated values
70
71 N/A
72
73 =item Default value
74
75 None. While a path is provided in most cases there is an exception:
76 for a cdrom device, lack of this attribute would imply an empty cdrom
77 drive.
78
79 =item Special syntax
80
81 When this parameter is specified by name, ie with the C<target=>
82 syntax in the configuration file, it consumes the whole rest of the
83 C<DISKSPEC> including trailing whitespaces. Therefore in that case
84 it must come last. This is permissible even if an empty value for
85 the target was already specified as a positional parameter. This
86 is the only way to specify a target string containing metacharacters
87 such as commas and (in some cases) colons, which would otherwise be
88 misinterpreted.
89
90 Future parameter and flag names will start with an ascii letter and
91 contain only ascii alphanumerics, hyphens and underscores, and will
92 not be legal as vdevs. Targets which might match that syntax
93 should not be specified as positional parameters.
94
95 =back
96
97 =item B<format>
98
99 =over 4
100
101 =item Description
102
103 Specifies the format of image file.
104
105 =item Supported values
106
107 raw, qcow, qcow2, vhd, qed
108
109 =item Deprecated values
110
111 None
112
113 =item Default value
114
115 raw
116
117 =back
118
119 =item B<vdev>
120
121 =over 4
122
123 =item Description
124
125 Virtual device as seen by the guest (also referred to as guest drive
126 designation in some specifications). See L<xen-vbd-interface(7)>.
127
128 =item Supported values
129
130 hd[x], xvd[x], sd[x] etc. Please refer to the above specification for
131 further details.
132
133 =item Deprecated values
134
135 None
136
137 =item Default Value
138
139 None, this parameter is mandatory.
140
141 =back
142
143 =item B<access>
144
145 =over 4
146
147 =item Description
148
149 Specified access control information. Whether or not the block device is
150 provided to the guest in read-only or read-write mode depends on this
151 attribute.
152
153 =item Supported values
154
155 C<ro>, C<r> (specifies read-only)
156
157 C<rw>, C<w> (specifies read/write)
158
159 =item Deprecated values
160
161 None
162
163 =item Default value
164
165 C<rw> unless devtype=cdrom, in which case C<r>
166
167 =back
168
169 =back
170
171 =head1 Other Parameters And Flags
172
173 =over 4
174
175 =item B<devtype>=I<DEVTYPE>
176
177 =over 4
178
179 =item Description
180
181 Qualifies virtual device type.
182
183 =item Supported values
184
185 cdrom
186
187 =item Deprecated values
188
189 None
190
191 =item Mandatory
192
193 No
194
195 =back
196
197 =item B<cdrom>
198
199 Convenience alias for "devtype=cdrom".
200
201
202 =item B<backend>=I<DOMAIN-NAME>
203
204 =over 4
205
206 =item Description
207
208 Designates a backend domain for the device
209
210 =item Supported values
211
212 Valid domain names
213
214 =item Mandatory
215
216 No
217
218 =back
219
220 Specifies the backend domain which this device should attach to. This
221 defaults to domain 0. Specifying another domain requires setting up a
222 driver domain which is outside the scope of this document.
223
224
225 =item B<backendtype>=I<TYPE>
226
227 =over 4
228
229 =item Description
230
231 Specifies the backend implementation to use
232
233 =item Supported values
234
235 phy, qdisk, standalone, tap
236
237 =item Mandatory
238
239 No
240
241 =item Default value
242
243 Automatically determine which backend to use.
244
245 =back
246
247 It controls which software implementation of the backend driver is used.
248 Depending on the "specification" option this may affect the guest's view
249 of the device.
250
251 Not all backend drivers support all combinations of other options.
252 For example, "phy" and "standalone" do not support formats other than "raw"
253 and "standalone" does not support specifications other than "virtio".
254 Normally this option should not be specified, in which case libxl will
255 automatically determine the most suitable backend.
256
257 "tap" needs blktap's tapback to be running.
258
259
260 =item B<script>=I<SCRIPT>
261
262 Specifies that B<target> is not a normal host path, but rather
263 information to be interpreted by the executable program I<SCRIPT>,
264 (looked for in F<@XEN_SCRIPT_DIR@>, if it doesn't contain a slash).
265
266 These scripts are normally called "block-I<SCRIPT>".
267
268
269 =item B<direct-io-safe>
270
271 =over 4
272
273 =item Description
274
275 Disables non-O_DIRECT workaround
276
277 =item Supported values
278
279 absent, present
280
281 =item Mandatory
282
283 No
284
285 =item Default value
286
287 absent (workaround may be enabled)
288
289 =back
290
291 There is a memory lifetime bug in some driver domain (dom0) kernels
292 which can cause crashes when using O_DIRECT. The bug occurs due to a
293 mismatch between the backend-visible lifetime of pages used for the
294 Xen PV network protocol and that expected by the backend kernel's
295 networking subsystem. This can cause crashes when using certain
296 backends with certain underlying storage.
297
298 See:
299 L<https://lists.xenproject.org/archives/html/xen-devel/2012-12/msg01154.html>
300
301 For this reason, (this version of) the Xen libxl toolstack disables
302 O_DIRECT when using the qemu-based Xen PV backend (C<qdisk>).
303
304 However, this workaround has performance and scaling implications, and
305 it is only necessary if the underlying device is a network filesystem.
306 If the underlying device is not, then it is good to disable it; that
307 is what this option is for.
308
309 This option simply requests that the workaround be disabled. (However,
310 not all backends versions which use the workaround understand this
311 option, so this is on a best effort basis.)
312
313 It's important to note that if you are storing the VM disk on a
314 network filesystem or a network block device (NFS or ISCSI) it might
315 not be safe to use this option. Otherwise specifying it is safe and
316 can give better performances.
317
318 If in the future the bug is fixed properly this option will then be
319 silently ignored.
320
321
322 =item B<discard> / B<no-discard>
323
324 =over 4
325
326 =item Description
327
328 Request that backend advertise discard support to frontend
329
330 =item Supported values
331
332 discard, no-discard
333
334 =item Mandatory
335
336 No
337
338 =item Default value
339
340 discard
341
342 =back
343
344 An advisory setting for the backend driver, specifying whether to
345 advertise discard support (TRIM, UNMAP) to the frontend. The real
346 benefit of this option is to be able to force it off rather than on. It
347 can be used to disable "hole punching" for file based backends which
348 were intentionally created non-sparse to avoid fragmentation of the
349 file.
350
351 =item B<trusted> / B<untrusted>
352
353 =over 4
354
355 =item Description
356
357 Reports whether the backend should be trusted by the frontend
358
359 =item Supported values
360
361 trusted, untrusted
362
363 =item Mandatory
364
365 No
366
367 =item Default value
368
369 trusted
370
371 =back
372
373 An advisory setting for the frontend driver on whether the backend should be
374 trusted. The frontend should deploy whatever protections it has available to
375 prevent an untrusted backend from accessing guest data not related to the I/O
376 processing or causing malfunction to the frontend or the whole domain.
377
378 Note frontends can ignore such recommendation.
379
380 =item B<specification>=I<SPECIFICATION>
381
382 =over 4
383
384 =item Description
385
386 Specifies the communication protocol (specification) to use for the chosen
387 "backendtype" option
388
389 =item Supported values
390
391 xen, virtio
392
393 =item Mandatory
394
395 No
396
397 =item Default value
398
399 xen
400
401 =back
402
403 Besides forcing toolstack to use specific backend implementation, this also
404 affects the guest's view of the device. For example, "virtio" requires
405 Virtio frontend driver (virtio-blk) to be used. Please note, the virtual
406 device (vdev) is not passed to the guest in that case, but it still must be
407 specified for the internal purposes.
408
409 =item B<grant_usage=BOOLEAN>
410
411 =over 4
412
413 =item Description
414
415 Specifies the usage of Xen grants for accessing guest memory. Only applicable
416 to specification "virtio".
417
418 =item Supported values
419
420 1, 0
421
422 =item Mandatory
423
424 No
425
426 =item Default value
427
428 If this option is missing, then the default grant setting will be used,
429 i.e. "grant_usage=1" if backend-domid != 0 or "grant_usage=0" otherwise.
430
431 =back
432
433 =back
434
435 =head1 COLO Parameters
436
437 =over 4
438
439 =item B<colo>
440
441 Enable COLO HA for disk. For better understanding block replication on
442 QEMU, please refer to: L<https://wiki.qemu.org/Features/BlockReplication>
443 Note that the COLO configuration settings should be considered unstable.
444 They may change incompatibly in future versions of Xen.
445
446
447 =item B<colo-host>
448
449 =over 4
450
451 =item Description
452
453 Secondary host's address
454
455 =item Mandatory
456
457 Yes when COLO enabled
458
459 =back
460
461 =item B<colo-port>
462
463 =over 4
464
465 =item Description
466
467 Secondary port. We will run a nbd server on secondary host,
468 and the nbd server will listen this port.
469
470 =item Mandatory
471
472 Yes when COLO enabled
473
474 =back
475
476 =item B<colo-export>
477
478 =over 4
479
480 =item Description
481
482 We will run a nbd server on secondary host, exportname is
483 the nbd server's disk export name.
484
485 =item Mandatory
486
487 Yes when COLO enabled
488
489 =back
490
491 =item B<active-disk>
492
493 =over 4
494
495 =item Description
496
497 This is used by secondary. Secondary guest's write will be buffered in this
498 disk.
499
500 =item Mandatory
501
502 Yes when COLO enabled
503
504 =back
505
506 =item B<hidden-disk>
507
508 =over 4
509
510 =item Description
511
512 This is used by secondary. It buffers the original content that is modified
513 by the primary VM.
514
515 =item Mandatory
516
517 Yes when COLO enabled
518
519 =back
520
521 =back
522
523
524 =head1 Deprecated Parameters, Prefixes And Syntaxes
525
526 Deprecated forms are acceptable and are intended work compatibly with
527 xend and xl from xen 4.1. In future they may print a warning.
528 Support for deprecated parameters and syntaxes are likely to be
529 dropped in future versions of xl.
530
531 There is support for a deprecated old syntax for C<DISKSPEC>:
532
533 [<format>:][<target>],<vdev>[:<devtype>],<access> (deprecated)
534
535 This syntax also supports deprecated prefixes, described below. These
536 are found prepended to the format parameter - eg C<tap:aio:qcow:>.
537
538 =over 4
539
540 =item B<format>
541
542 =over 4
543
544 =item Description
545
546 Specifies the format (deprecated)
547
548 =item Supported values
549
550 raw: qcow2: vhd:
551
552 =back
553
554 In xend and old versions of libxl it was necessary to specify the
555 format with a prefix. For compatibility, these three prefixes are
556 recognised as specifying the corresponding format. They are
557 equivalent to C<format=FORMAT> or the specification of B<format>
558 (without a colon) as a positional parameter.
559
560
561 =item B<script>
562
563 =over 4
564
565 =item Description
566
567 Specifies the script (deprecated)
568
569 =item Supported values
570
571 iscsi: nbd: enbd: drbd:
572
573 =back
574
575 In xend and old versions of libxl it was necessary to specify the
576 "script" (see above) with a prefix. For compatibility, these four
577 prefixes are recognised as specifying the corresponding script. They
578 are equivalent to C<script=block-SCRIPT>.
579
580
581 =item B<deprecated-prefix>
582
583 =over 4
584
585 =item Description
586
587 Deprecated prefix, ignored
588
589 =item Supported values
590
591 tapdisk: tap2: aio: ioemu: file: phy:
592
593 =back
594
595 Various prefixes were required by xend and older versions of libxl to
596 make the block devices work. In some cases these options would
597 override the backend type, but in other cases they would be ignored in
598 favour of "making it work"; in yet other cases it would be necessary
599 to specify several of these, for example:
600
601 tap:aio:/some/path...
602
603 All of these prefixes are now stripped and ignored.
604
605 =back
606
607 =head2 Missing format and empty target
608
609 The following syntax is also supported:
610
611 ,<vdev>:<devtype>,<access> (deprecated)
612
613 This is solely for compatibility with xend's syntax for empty cdroms,
614 which is (for example) C<,hdc:cdrom,r>.