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