Debian Codegraph @

docs/man/xl.1.pod.in

raw
1 =head1 NAME
2
3 xl - Xen management tool, based on libxenlight
4
5 =head1 SYNOPSIS
6
7 B<xl> I<subcommand> [I<args>]
8
9 =head1 DESCRIPTION
10
11 The B<xl> program is the new tool for managing Xen guest
12 domains. The program can be used to create, pause, and shutdown
13 domains. It can also be used to list current domains, enable or pin
14 VCPUs, and attach or detach virtual block devices.
15
16 The basic structure of every B<xl> command is almost always:
17
18 =over 2
19
20 B<xl> I<subcommand> [I<OPTIONS>] I<domain-id>
21
22 =back
23
24 Where I<subcommand> is one of the subcommands listed below, I<domain-id>
25 is the numeric domain id, or the domain name (which will be internally
26 translated to domain id), and I<OPTIONS> are subcommand specific
27 options. There are a few exceptions to this rule in the cases where
28 the subcommand in question acts on all domains, the entire machine,
29 or directly on the Xen hypervisor. Those exceptions will be clear for
30 each of those subcommands.
31
32 =head1 NOTES
33
34 =over 4
35
36 =item start the script B</etc/init.d/xencommons> at boot time
37
38 Most B<xl> operations rely upon B<xenstored> and B<xenconsoled>: make
39 sure you start the script B</etc/init.d/xencommons> at boot time to
40 initialize all the daemons needed by B<xl>.
41
42 =item setup a B<xenbr0> bridge in dom0
43
44 In the most common network configuration, you need to setup a bridge in dom0
45 named B<xenbr0> in order to have a working network in the guest domains.
46 Please refer to the documentation of your Linux distribution to know how to
47 setup the bridge.
48
49 =item B<autoballoon>
50
51 If you specify the amount of memory dom0 has, passing B<dom0_mem> to
52 Xen, it is highly recommended to disable B<autoballoon>. Edit
53 B<@XEN_CONFIG_DIR@/xl.conf> and set it to 0.
54
55 =item run xl as B<root>
56
57 Most B<xl> commands require root privileges to run due to the
58 communications channels used to talk to the hypervisor. Running as
59 non root will return an error.
60
61 =back
62
63 =head1 GLOBAL OPTIONS
64
65 Some global options are always available:
66
67 =over 4
68
69 =item B<-v>
70
71 Verbose.
72
73 =item B<-N>
74
75 Dry run: do not actually execute the command.
76
77 =item B<-f>
78
79 Force execution: xl will refuse to run some commands if it detects that xend is
80 also running, this option will force the execution of those commands, even
81 though it is unsafe.
82
83 =item B<-t>
84
85 Always use carriage-return-based overwriting for displaying progress
86 messages without scrolling the screen. Without -t, this is done only
87 if stderr is a tty.
88
89 =item B<-T>
90
91 Include timestamps and pid of the xl process in output.
92
93 =back
94
95 =head1 DOMAIN SUBCOMMANDS
96
97 The following subcommands manipulate domains directly. As stated
98 previously, most commands take I<domain-id> as the first parameter.
99
100 =over 4
101
102 =item B<button-press> I<domain-id> I<button>
103
104 I<This command is deprecated. Please use C<xl trigger> instead.>
105
106 Indicate an ACPI button press to the domain, where I<button> can be 'power' or
107 'sleep'. This command is only available for HVM domains.
108
109 =item B<create> [I<configfile>] [I<OPTIONS>]
110
111 The create subcommand takes a config file as its first argument: see
112 L<xl.cfg(5)> for full details of the file format and possible options.
113 If I<configfile> is missing B<xl> creates the domain assuming the default
114 values for every option.
115
116 I<configfile> has to be an absolute path to a file.
117
118 Create will return B<as soon> as the domain is started. This B<does
119 not> mean the guest OS in the domain has actually booted, or is
120 available for input.
121
122 If the I<-F> option is specified, create will start the domain and not
123 return until its death.
124
125 B<OPTIONS>
126
127 =over 4
128
129 =item B<-q>, B<--quiet>
130
131 No console output.
132
133 =item B<-f=FILE>, B<--defconfig=FILE>
134
135 Use the given configuration file.
136
137 =item B<-p>
138
139 Leave the domain paused after it is created.
140
141 =item B<-F>
142
143 Run in foreground until death of the domain.
144
145 =item B<-V>, B<--vncviewer>
146
147 Attach to domain's VNC server, forking a vncviewer process.
148
149 =item B<-A>, B<--vncviewer-autopass>
150
151 Pass the VNC password to vncviewer via stdin.
152
153 =item B<-c>
154
155 Attach console to the domain as soon as it has started. This is
156 useful for determining issues with crashing domains and just as a
157 general convenience since you often want to watch the
158 domain boot.
159
160 =item B<key=value>
161
162 It is possible to pass I<key=value> pairs on the command line to provide
163 options as if they were written in the configuration file; these override
164 whatever is in the I<configfile>.
165
166 NB: Many config options require characters such as quotes or brackets
167 which are interpreted by the shell (and often discarded) before being
168 passed to xl, resulting in xl being unable to parse the value
169 correctly. A simple work-around is to put all extra options within a
170 single set of quotes, separated by semicolons. (See below for an example.)
171
172 =back
173
174 B<EXAMPLES>
175
176 =over 4
177
178 =item I<with extra parameters>
179
180 xl create hvm.cfg 'cpus="0-3"; pci=["01:05.1","01:05.2"]'
181
182 This creates a domain with the file hvm.cfg, but additionally pins it to
183 cpus 0-3, and passes through two PCI devices.
184
185 =back
186
187 =item B<config-update> I<domain-id> [I<configfile>] [I<OPTIONS>]
188
189 Update the saved configuration for a running domain. This has no
190 immediate effect but will be applied when the guest is next
191 restarted. This command is useful to ensure that runtime modifications
192 made to the guest will be preserved when the guest is restarted.
193
194 Since Xen 4.5 xl has improved capabilities to handle dynamic domain
195 configuration changes and will preserve any changes made at runtime
196 when necessary. Therefore it should not normally be necessary to use
197 this command any more.
198
199 I<configfile> has to be an absolute path to a file.
200
201 B<OPTIONS>
202
203 =over 4
204
205 =item B<-f=FILE>, B<--defconfig=FILE>
206
207 Use the given configuration file.
208
209 =item B<key=value>
210
211 It is possible to pass I<key=value> pairs on the command line to
212 provide options as if they were written in the configuration file;
213 these override whatever is in the I<configfile>. Please see the note
214 under I<create> on handling special characters when passing
215 I<key=value> pairs on the command line.
216
217 =back
218
219 =item B<console> [I<OPTIONS>] I<domain-id>
220
221 Attach to the console of a domain specified by I<domain-id>. If you've set up
222 your domains to have a traditional login console this will look much like a
223 normal text login screen.
224
225 Use the escape character key combination (default Ctrl+]) to detach from the
226 domain console.
227
228 B<OPTIONS>
229
230 =over 4
231
232 =item I<-t [pv|serial]>
233
234 Connect to a PV console or connect to an emulated serial console.
235 PV consoles are the only consoles available for PV domains while HVM
236 domains can have both. If this option is not specified it defaults to
237 emulated serial for HVM guests and PV console for PV guests.
238
239 =item I<-n NUM>
240
241 Connect to console number I<NUM>. Console numbers start from 0.
242
243 =item I<-e escapechar>
244
245 Customize the escape sequence used to detach from the domain console to
246 I<escapechar>. If not specified, the value "^]" is used.
247
248 =back
249
250 =item B<destroy> [I<OPTIONS>] I<domain-id>
251
252 Immediately terminate the domain specified by I<domain-id>. This doesn't give
253 the domain OS any chance to react, and is the equivalent of ripping the power
254 cord out on a physical machine. In most cases you will want to use the
255 B<shutdown> command instead.
256
257 B<OPTIONS>
258
259 =over 4
260
261 =item I<-f>
262
263 Allow domain 0 to be destroyed. Because a domain cannot destroy itself, this
264 is only possible when using a disaggregated toolstack, and is most useful when
265 using a hardware domain separated from domain 0.
266
267 =back
268
269 =item B<domid> I<domain-name>
270
271 Converts a domain name to a domain id.
272
273 =item B<domname> I<domain-id>
274
275 Converts a domain id to a domain name.
276
277 =item B<rename> I<domain-id> I<new-name>
278
279 Change the domain name of a domain specified by I<domain-id> to I<new-name>.
280
281 =item B<dump-core> I<domain-id> [I<filename>]
282
283 Dumps the virtual machine's memory for the specified domain to the
284 I<filename> specified, without pausing the domain. The dump file will
285 be written to a distribution specific directory for dump files, for example:
286 @XEN_DUMP_DIR@/dump.
287
288 =item B<help> [I<--long>]
289
290 Displays the short help message (i.e. common commands) by default.
291
292 If the I<--long> option is specified, it displays the complete set of B<xl>
293 subcommands, grouped by function.
294
295 =item B<list> [I<OPTIONS>] [I<domain-id> ...]
296
297 Displays information about one or more domains. If no domains are
298 specified it displays information about all domains.
299
300
301 B<OPTIONS>
302
303 =over 4
304
305 =item B<-l>, B<--long>
306
307 The output for B<xl list> is not the table view shown below, but
308 instead presents the data as a JSON data structure.
309
310 =item B<-Z>, B<--context>
311
312 Also displays the security labels.
313
314 =item B<-v>, B<--verbose>
315
316 Also displays the domain UUIDs, the shutdown reason and security labels.
317
318 =item B<-c>, B<--cpupool>
319
320 Also displays the cpupool the domain belongs to.
321
322 =item B<-n>, B<--numa>
323
324 Also displays the domain NUMA node affinity.
325
326 =back
327
328 B<EXAMPLE>
329
330 An example format for the list is as follows:
331
332 Name ID Mem VCPUs State Time(s)
333 Domain-0 0 750 4 r----- 11794.3
334 win 1 1019 1 r----- 0.3
335 linux 2 2048 2 r----- 5624.2
336
337 Name is the name of the domain. ID the numeric domain id. Mem is the
338 desired amount of memory to allocate to the domain (although it may
339 not be the currently allocated amount). VCPUs is the number of
340 virtual CPUs allocated to the domain. State is the run state (see
341 below). Time is the total run time of the domain as accounted for by
342 Xen.
343
344 B<STATES>
345
346 The State field lists 6 states for a Xen domain, and which ones the
347 current domain is in.
348
349 =over 4
350
351 =item B<r - running>
352
353 The domain is currently running on a CPU.
354
355 =item B<b - blocked>
356
357 The domain is blocked, and not running or runnable. This can be because the
358 domain is waiting on IO (a traditional wait state) or has
359 gone to sleep because there was nothing else for it to do.
360
361 =item B<p - paused>
362
363 The domain has been paused, usually occurring through the administrator
364 running B<xl pause>. When in a paused state the domain will still
365 consume allocated resources (like memory), but will not be eligible for
366 scheduling by the Xen hypervisor.
367
368 =item B<s - shutdown>
369
370 The guest OS has shut down (SCHEDOP_shutdown has been called) but the
371 domain is not dying yet.
372
373 =item B<c - crashed>
374
375 The domain has crashed, which is always a violent ending. Usually
376 this state only occurs if the domain has been configured not to
377 restart on a crash. See L<xl.cfg(5)> for more info.
378
379 =item B<d - dying>
380
381 The domain is in the process of dying, but hasn't completely shut down or
382 crashed.
383
384 =back
385
386 B<NOTES>
387
388 =over 4
389
390 The Time column is deceptive. Virtual IO (network and block devices)
391 used by the domains requires coordination by Domain0, which means that
392 Domain0 is actually charged for much of the time that a DomainU is
393 doing IO. Use of this time value to determine relative utilizations
394 by domains is thus very unreliable, as a high IO workload may show as
395 less utilized than a high CPU workload. Consider yourself warned.
396
397 =back
398
399 =item B<mem-set> I<domain-id> I<mem>
400
401 Set the target for the domain's balloon driver.
402
403 The default unit is kiB. Add 't' for TiB, 'g' for GiB, 'm' for
404 MiB, 'k' for kiB, and 'b' for bytes (e.g., `2048m` for 2048 MiB).
405
406 This must be less than the initial B<maxmem> parameter in the domain's
407 configuration.
408
409 Note that this operation requests the guest operating system's balloon
410 driver to reach the target amount of memory. The guest may fail to
411 reach that amount of memory for any number of reasons, including:
412
413 =over 4
414
415 =item
416
417 The guest doesn't have a balloon driver installed
418
419 =item
420
421 The guest's balloon driver is buggy
422
423 =item
424
425 The guest's balloon driver cannot create free guest memory due to
426 guest memory pressure
427
428 =item
429
430 The guest's balloon driver cannot allocate memory from Xen because of
431 hypervisor memory pressure
432
433 =item
434
435 The guest administrator has disabled the balloon driver
436
437 =back
438
439 B<Warning:> There is no good way to know in advance how small of a
440 mem-set will make a domain unstable and cause it to crash. Be very
441 careful when using this command on running domains.
442
443 =item B<mem-max> I<domain-id> I<mem>
444
445 Specify the limit Xen will place on the amount of memory a guest may
446 allocate.
447
448 The default unit is kiB. Add 't' for TiB, 'g' for GiB, 'm' for
449 MiB, 'k' for kiB, and 'b' for bytes (e.g., `2048m` for 2048 MiB).
450
451 I<mem> can't be set lower than the current memory target for
452 I<domain-id>. It is allowed to be higher than the configured maximum
453 memory size of the domain (B<maxmem> parameter in the domain's
454 configuration).
455
456 Setting the maximum memory size above the configured maximum memory size
457 will require special guest support (memory hotplug) in order to be usable
458 by the guest.
459
460 The domain will not receive any signal regarding the changed memory
461 limit.
462
463 =item B<migrate> [I<OPTIONS>] I<domain-id> I<host>
464
465 Migrate a domain to another host machine. By default B<xl> relies on ssh as a
466 transport mechanism between the two hosts.
467
468 B<OPTIONS>
469
470 =over 4
471
472 =item B<-s> I<sshcommand>
473
474 Use <sshcommand> instead of ssh. String will be passed to sh. If empty, run
475 <host> instead of ssh <host> xl migrate-receive [-d -e].
476
477 =item B<-e>
478
479 On the new <host>, do not wait in the background for the death of the
480 domain. See the corresponding option of the I<create> subcommand.
481
482 =item B<-C> I<config>
483
484 Send the specified <config> file instead of the file used on creation of the
485 domain.
486
487 =item B<--debug>
488
489 Display huge (!) amount of debug information during the migration process.
490
491 =item B<-p>
492
493 Leave the domain on the receive side paused after migration.
494
495 =item B<-D>
496
497 Preserve the B<domain-id> in the domain coniguration that is transferred
498 such that it will be identical on the destination host, unless that
499 configuration is overridden using the B<-C> option. Note that it is not
500 possible to use this option for a 'localhost' migration.
501
502 =back
503
504 =item B<remus> [I<OPTIONS>] I<domain-id> I<host>
505
506 Enable Remus HA or COLO HA for domain. By default B<xl> relies on ssh as a
507 transport mechanism between the two hosts.
508
509 B<NOTES>
510
511 =over 4
512
513 Remus support in xl is still in experimental (proof-of-concept) phase.
514 Disk replication support is limited to DRBD disks.
515
516 COLO support in xl is still in experimental (proof-of-concept)
517 phase. All options are subject to change in the future.
518
519 =back
520
521 COLO disk configuration looks like:
522
523 disk = ['...,colo,colo-host=xxx,colo-port=xxx,colo-export=xxx,active-disk=xxx,hidden-disk=xxx...']
524
525 The supported options are:
526
527 =over 4
528
529 =item B<colo-host> : Secondary host's ip address.
530
531 =item B<colo-port> : Secondary host's port, we will run a nbd server on the
532 secondary host, and the nbd server will listen on this port.
533
534 =item B<colo-export> : Nbd server's disk export name of the secondary host.
535
536 =item B<active-disk> : Secondary's guest write will be buffered to this disk,
537 and it's used by the secondary.
538
539 =item B<hidden-disk> : Primary's modified contents will be buffered in this
540 disk, and it's used by the secondary.
541
542 =back
543
544 COLO network configuration looks like:
545
546 vif = [ '...,forwarddev=xxx,...']
547
548 The supported options are:
549
550 =over 4
551
552 =item B<forwarddev> : Forward devices for the primary and the secondary, they
553 are directly connected.
554
555
556 =back
557
558 B<OPTIONS>
559
560 =over 4
561
562 =item B<-i> I<MS>
563
564 Checkpoint domain memory every MS milliseconds (default 200ms).
565
566 =item B<-u>
567
568 Disable memory checkpoint compression.
569
570 =item B<-s> I<sshcommand>
571
572 Use <sshcommand> instead of ssh. String will be passed to sh.
573 If empty, run <host> instead of ssh <host> xl migrate-receive -r [-e].
574
575 =item B<-e>
576
577 On the new <host>, do not wait in the background for the death of the domain.
578 See the corresponding option of the I<create> subcommand.
579
580 =item B<-N> I<netbufscript>
581
582 Use <netbufscript> to setup network buffering instead of the
583 default script (@XEN_SCRIPT_DIR@/remus-netbuf-setup).
584
585 =item B<-F>
586
587 Run Remus in unsafe mode. Use this option with caution as failover may
588 not work as intended.
589
590 =item B<-b>
591
592 Replicate memory checkpoints to /dev/null (blackhole).
593 Generally useful for debugging. Requires enabling unsafe mode.
594
595 =item B<-n>
596
597 Disable network output buffering. Requires enabling unsafe mode.
598
599 =item B<-d>
600
601 Disable disk replication. Requires enabling unsafe mode.
602
603 =item B<-c>
604
605 Enable COLO HA. This conflicts with B<-i> and B<-b>, and memory
606 checkpoint compression must be disabled.
607
608 =item B<-p>
609
610 Use userspace COLO Proxy. This option must be used in conjunction
611 with B<-c>.
612
613 =back
614
615 =item B<pause> I<domain-id>
616
617 Pause a domain. When in a paused state the domain will still consume
618 allocated resources (such as memory), but will not be eligible for
619 scheduling by the Xen hypervisor.
620
621 =item B<reboot> [I<OPTIONS>] I<domain-id>
622
623 Reboot a domain. This acts just as if the domain had the B<reboot>
624 command run from the console. The command returns as soon as it has
625 executed the reboot action, which may be significantly earlier than when the
626 domain actually reboots.
627
628 For HVM domains this requires PV drivers to be installed in your guest
629 OS. If PV drivers are not present but you have configured the guest OS
630 to behave appropriately you may be able to use the I<-F> option to
631 trigger a reset button press.
632
633 The behavior of what happens to a domain when it reboots is set by the
634 B<on_reboot> parameter of the domain configuration file when the
635 domain was created.
636
637 B<OPTIONS>
638
639 =over 4
640
641 =item B<-F>
642
643 If the guest does not support PV reboot control then fallback to
644 sending an ACPI power event (equivalent to the I<reset> option to
645 I<trigger>).
646
647 You should ensure that the guest is configured to behave as expected
648 in response to this event.
649
650 =back
651
652 =item B<restore> [I<OPTIONS>] [I<configfile>] I<checkpointfile>
653
654 Build a domain from an B<xl save> state file. See B<save> for more info.
655
656 B<OPTIONS>
657
658 =over 4
659
660 =item B<-p>
661
662 Do not unpause the domain after restoring it.
663
664 =item B<-e>
665
666 Do not wait in the background for the death of the domain on the new host.
667 See the corresponding option of the I<create> subcommand.
668
669 =item B<-d>
670
671 Enable debug messages.
672
673 =item B<-V>, B<--vncviewer>
674
675 Attach to the domain's VNC server, forking a vncviewer process.
676
677 =item B<-A>, B<--vncviewer-autopass>
678
679 Pass the VNC password to vncviewer via stdin.
680
681
682
683 =back
684
685 =item B<resume> I<domain-id>
686
687 Resume a domain, after having been suspended.
688
689 =item B<save> [I<OPTIONS>] I<domain-id> I<checkpointfile> [I<configfile>]
690
691 Saves a running domain to a state file so that it can be restored
692 later. Once saved, the domain will no longer be running on the
693 system, unless the -c or -p options are used.
694 B<xl restore> restores from this checkpoint file.
695 Passing a config file argument allows the user to manually select the VM config
696 file used to create the domain.
697
698 =over 4
699
700 =item B<-c>
701
702 Leave the domain running after creating the snapshot.
703
704 =item B<-p>
705
706 Leave the domain paused after creating the snapshot.
707
708 =item B<-D>
709
710 Preserve the B<domain-id> in the domain coniguration that is embedded in
711 the state file such that it will be identical when the domain is restored,
712 unless that configuration is overridden. (See the B<restore> operation
713 above).
714
715 =back
716
717 =item B<sharing> [I<domain-id>]
718
719 Display the number of shared pages for a specified domain. If no domain is
720 specified it displays information about all domains.
721
722 =item B<shutdown> [I<OPTIONS>] I<-a|domain-id>
723
724 Gracefully shuts down a domain. This coordinates with the domain OS
725 to perform graceful shutdown, so there is no guarantee that it will
726 succeed, and may take a variable length of time depending on what
727 services must be shut down in the domain.
728
729 For HVM domains this requires PV drivers to be installed in your guest
730 OS. If PV drivers are not present but you have configured the guest OS
731 to behave appropriately you may be able to use the I<-F> option to
732 trigger a power button press.
733
734 The command returns immediately after signaling the domain unless the
735 B<-w> flag is used.
736
737 The behavior of what happens to a domain when it reboots is set by the
738 B<on_shutdown> parameter of the domain configuration file when the
739 domain was created.
740
741 B<OPTIONS>
742
743 =over 4
744
745 =item B<-a>, B<--all>
746
747 Shutdown all guest domains. Often used when doing a complete shutdown
748 of a Xen system.
749
750 =item B<-w>, B<--wait>
751
752 Wait for the domain to complete shutdown before returning. If given once,
753 the wait is for domain shutdown or domain death. If given multiple times,
754 the wait is for domain death only.
755
756 =item B<-F>
757
758 If the guest does not support PV shutdown control then fallback to
759 sending an ACPI power event (equivalent to the I<power> option to
760 I<trigger>).
761
762 You should ensure that the guest is configured to behave as expected
763 in response to this event.
764
765 =back
766
767 =item B<suspend> I<domain-id>
768
769 Suspend a domain. This is a cooperative operation where the domain must
770 respond to the xenstore trigger. When in a suspended state the domain
771 still consumes allocated resources (such as memory), but is not eligible
772 for scheduling by the Xen hypervisor. It is in a shutdown state, but
773 not dying.
774
775 =item B<sysrq> I<domain-id> I<letter>
776
777 Send a <Magic System Request> to the domain, each type of request is
778 represented by a different letter.
779 It can be used to send SysRq requests to Linux guests, see sysrq.txt in
780 your Linux Kernel sources for more information.
781 It requires PV drivers to be installed in your guest OS.
782
783 =item B<trigger> I<domain-id> I<nmi|reset|init|power|sleep|s3resume> [I<VCPU>]
784
785 Send a trigger to a domain, where the trigger can be: nmi, reset, init, power
786 or sleep. Optionally a specific vcpu number can be passed as an argument.
787 This command is only available for HVM domains.
788
789 =item B<unpause> I<domain-id>
790
791 Moves a domain out of the paused state. This will allow a previously
792 paused domain to now be eligible for scheduling by the Xen hypervisor.
793
794 =item B<vcpu-set> I<domain-id> I<vcpu-count>
795
796 Enables the I<vcpu-count> virtual CPUs for the domain in question.
797 Like mem-set, this command can only allocate up to the maximum virtual
798 CPU count configured at boot for the domain.
799
800 If the I<vcpu-count> is smaller than the current number of active
801 VCPUs, the highest number VCPUs will be hotplug removed. This may be
802 important for pinning purposes.
803
804 Attempting to set the VCPUs to a number larger than the initially
805 configured VCPU count is an error. Trying to set VCPUs to < 1 will be
806 quietly ignored.
807
808 Some guests may need to actually bring the newly added CPU online
809 after B<vcpu-set>, go to B<SEE ALSO> section for information.
810
811 =item B<vcpu-list> [I<domain-id>]
812
813 Lists VCPU information for a specific domain. If no domain is
814 specified, VCPU information for all domains will be provided.
815
816 =item B<vcpu-pin> [I<-f|--force>] I<domain-id> I<vcpu> I<cpus hard> I<cpus soft>
817
818 Set hard and soft affinity for a I<vcpu> of <domain-id>. Normally VCPUs
819 can float between available CPUs whenever Xen deems a different run state
820 is appropriate.
821
822 Hard affinity can be used to restrict this, by ensuring certain VCPUs
823 can only run on certain physical CPUs. Soft affinity specifies a I<preferred>
824 set of CPUs. Soft affinity needs special support in the scheduler, which is
825 only provided in credit1.
826
827 The keyword B<all> can be used to apply the hard and soft affinity masks to
828 all the VCPUs in the domain. The symbol '-' can be used to leave either
829 hard or soft affinity alone.
830
831 For example:
832
833 xl vcpu-pin 0 3 - 6-9
834
835 will set soft affinity for vCPU 3 of domain 0 to pCPUs 6,7,8 and 9,
836 leaving its hard affinity untouched. On the other hand:
837
838 xl vcpu-pin 0 3 3,4 6-9
839
840 will set both hard and soft affinity, the former to pCPUs 3 and 4, the
841 latter to pCPUs 6,7,8, and 9.
842
843 Specifying I<-f> or I<--force> will remove a temporary pinning done by the
844 operating system (normally this should be done by the operating system).
845 In case a temporary pinning is active for a vcpu the affinity of this vcpu
846 can't be changed without this option.
847
848 =item B<vm-list>
849
850 Prints information about guests. This list excludes information about
851 service or auxiliary domains such as dom0 and stubdoms.
852
853 B<EXAMPLE>
854
855 An example format for the list is as follows:
856
857 UUID ID name
858 59e1cf6c-6ab9-4879-90e7-adc8d1c63bf5 2 win
859 50bc8f75-81d0-4d53-b2e6-95cb44e2682e 3 linux
860
861 =item B<vncviewer> [I<OPTIONS>] I<domain-id>
862
863 Attach to the domain's VNC server, forking a vncviewer process.
864
865 B<OPTIONS>
866
867 =over 4
868
869 =item I<--autopass>
870
871 Pass the VNC password to vncviewer via stdin.
872
873 =back
874
875 =back
876
877 =head1 XEN HOST SUBCOMMANDS
878
879 =over 4
880
881 =item B<debug-keys> I<keys>
882
883 Send debug I<keys> to Xen. It is the same as pressing the Xen
884 "conswitch" (Ctrl-A by default) three times and then pressing "keys".
885
886 =item B<set-parameters> I<params>
887
888 Set hypervisor parameters as specified in I<params>. This allows for some
889 boot parameters of the hypervisor to be modified in the running systems.
890
891 =item B<dmesg> [I<OPTIONS>]
892
893 Reads the Xen message buffer, similar to dmesg on a Linux system. The
894 buffer contains informational, warning, and error messages created
895 during Xen's boot process. If you are having problems with Xen, this
896 is one of the first places to look as part of problem determination.
897
898 B<OPTIONS>
899
900 =over 4
901
902 =item B<-c>, B<--clear>
903
904 Clears Xen's message buffer.
905
906 =back
907
908 =item B<info> [I<OPTIONS>]
909
910 Print information about the Xen host in I<name : value> format. When
911 reporting a Xen bug, please provide this information as part of the
912 bug report. See I<https://wiki.xenproject.org/wiki/Reporting_Bugs_against_Xen_Project> on how to
913 report Xen bugs.
914
915 Sample output looks as follows:
916
917 host : scarlett
918 release : 3.1.0-rc4+
919 version : #1001 SMP Wed Oct 19 11:09:54 UTC 2011
920 machine : x86_64
921 nr_cpus : 4
922 nr_nodes : 1
923 cores_per_socket : 4
924 threads_per_core : 1
925 cpu_mhz : 2266
926 hw_caps : bfebfbff:28100800:00000000:00003b40:009ce3bd:00000000:00000001:00000000
927 virt_caps : hvm hvm_directio
928 total_memory : 6141
929 free_memory : 4274
930 free_cpus : 0
931 outstanding_claims : 0
932 xen_major : 4
933 xen_minor : 2
934 xen_extra : -unstable
935 xen_caps : xen-3.0-x86_64 xen-3.0-x86_32p hvm-3.0-x86_32 hvm-3.0-x86_32p hvm-3.0-x86_64
936 xen_scheduler : credit
937 xen_pagesize : 4096
938 platform_params : virt_start=0xffff800000000000
939 xen_changeset : Wed Nov 02 17:09:09 2011 +0000 24066:54a5e994a241
940 xen_commandline : com1=115200,8n1 guest_loglvl=all dom0_mem=750M console=com1
941 cc_compiler : gcc version 4.4.5 (Debian 4.4.5-8)
942 cc_compile_by : sstabellini
943 cc_compile_domain : uk.xensource.com
944 cc_compile_date : Tue Nov 8 12:03:05 UTC 2011
945 xend_config_format : 4
946
947
948 B<FIELDS>
949
950 Not all fields will be explained here, but some of the less obvious
951 ones deserve explanation:
952
953 =over 4
954
955 =item B<hw_caps>
956
957 A vector showing what hardware capabilities are supported by your
958 processor. This is equivalent to, though more cryptic, the flags
959 field in /proc/cpuinfo on a normal Linux machine: they both derive from
960 the feature bits returned by the cpuid command on x86 platforms.
961
962 =item B<free_memory>
963
964 Available memory (in MB) not allocated to Xen, or any other domains, or
965 claimed for domains.
966
967 =item B<outstanding_claims>
968
969 When a claim call is done (see L<xl.conf(5)>) a reservation for a specific
970 amount of pages is set and also a global value is incremented. This
971 global value (outstanding_claims) is then reduced as the domain's memory
972 is populated and eventually reaches zero. Most of the time the value will
973 be zero, but if you are launching multiple guests, and B<claim_mode> is
974 enabled, this value can increase/decrease. Note that the value also
975 affects the B<free_memory> - as it will reflect the free memory
976 in the hypervisor minus the outstanding pages claimed for guests.
977 See xl I<info> B<claims> parameter for detailed listing.
978
979 =item B<xen_caps>
980
981 The Xen version and architecture. Architecture values can be one of:
982 x86_32, x86_32p (i.e. PAE enabled), x86_64, ia64.
983
984 =item B<xen_changeset>
985
986 The Xen mercurial changeset id. Very useful for determining exactly
987 what version of code your Xen system was built from.
988
989 =back
990
991 B<OPTIONS>
992
993 =over 4
994
995 =item B<-n>, B<--numa>
996
997 List host NUMA topology information
998
999 =back
1000
1001 =item B<top>
1002
1003 Executes the B<xentop(1)> command, which provides real time monitoring of
1004 domains. Xentop has a curses interface, and is reasonably self explanatory.
1005
1006 =item B<uptime>
1007
1008 Prints the current uptime of the domains running.
1009
1010 =item B<claims>
1011
1012 Prints information about outstanding claims by the guests. This provides
1013 the outstanding claims and currently populated memory count for the guests.
1014 These values added up reflect the global outstanding claim value, which
1015 is provided via the I<info> argument, B<outstanding_claims> value.
1016 The B<Mem> column has the cumulative value of outstanding claims and
1017 the total amount of memory that has been right now allocated to the guest.
1018
1019 B<EXAMPLE>
1020
1021 An example format for the list is as follows:
1022
1023 Name ID Mem VCPUs State Time(s) Claimed
1024 Domain-0 0 2047 4 r----- 19.7 0
1025 OL5 2 2048 1 --p--- 0.0 847
1026 OL6 3 1024 4 r----- 5.9 0
1027 Windows_XP 4 2047 1 --p--- 0.0 1989
1028
1029 In which it can be seen that the OL5 guest still has 847MB of claimed
1030 memory (out of the total 2048MB where 1191MB has been allocated to
1031 the guest).
1032
1033 =back
1034
1035 =head1 SCHEDULER SUBCOMMANDS
1036
1037 Xen ships with a number of domain schedulers, which can be set at boot
1038 time with the B<sched=> parameter on the Xen command line. By
1039 default B<credit> is used for scheduling.
1040
1041 =over 4
1042
1043 =item B<sched-credit> [I<OPTIONS>]
1044
1045 Set or get credit (aka credit1) scheduler parameters. The credit scheduler is
1046 a proportional fair share CPU scheduler built from the ground up to be
1047 work conserving on SMP hosts.
1048
1049 Each domain (including Domain0) is assigned a weight and a cap.
1050
1051 B<OPTIONS>
1052
1053 =over 4
1054
1055 =item B<-d DOMAIN>, B<--domain=DOMAIN>
1056
1057 Specify domain for which scheduler parameters are to be modified or retrieved.
1058 Mandatory for modifying scheduler parameters.
1059
1060 =item B<-w WEIGHT>, B<--weight=WEIGHT>
1061
1062 A domain with a weight of 512 will get twice as much CPU as a domain
1063 with a weight of 256 on a contended host. Legal weights range from 1
1064 to 65535 and the default is 256.
1065
1066 =item B<-c CAP>, B<--cap=CAP>
1067
1068 The cap optionally fixes the maximum amount of CPU a domain will be
1069 able to consume, even if the host system has idle CPU cycles. The cap
1070 is expressed in percentage of one physical CPU: 100 is 1 physical CPU,
1071 50 is half a CPU, 400 is 4 CPUs, etc. The default, 0, means there is
1072 no upper cap.
1073
1074 NB: Many systems have features that will scale down the computing
1075 power of a cpu that is not 100% utilized. This can be in the
1076 operating system, but can also sometimes be below the operating system
1077 in the BIOS. If you set a cap such that individual cores are running
1078 at less than 100%, this may have an impact on the performance of your
1079 workload over and above the impact of the cap. For example, if your
1080 processor runs at 2GHz, and you cap a vm at 50%, the power management
1081 system may also reduce the clock speed to 1GHz; the effect will be
1082 that your VM gets 25% of the available power (50% of 1GHz) rather than
1083 50% (50% of 2GHz). If you are not getting the performance you expect,
1084 look at performance and cpufreq options in your operating system and
1085 your BIOS.
1086
1087 =item B<-p CPUPOOL>, B<--cpupool=CPUPOOL>
1088
1089 Restrict output to domains in the specified cpupool.
1090
1091 =item B<-s>, B<--schedparam>
1092
1093 Specify to list or set pool-wide scheduler parameters.
1094
1095 =item B<-t TSLICE>, B<--tslice_ms=TSLICE>
1096
1097 Timeslice tells the scheduler how long to allow VMs to run before
1098 pre-empting. The default is 30ms. Valid ranges are 1ms to 1000ms.
1099 The length of the timeslice (in ms) must be higher than the length of
1100 the ratelimit (see below).
1101
1102 =item B<-r RLIMIT>, B<--ratelimit_us=RLIMIT>
1103
1104 Ratelimit attempts to limit the number of schedules per second. It
1105 sets a minimum amount of time (in microseconds) a VM must run before
1106 we will allow a higher-priority VM to pre-empt it. The default value
1107 is 1000 microseconds (1ms). Valid range is 100 to 500000 (500ms).
1108 The ratelimit length must be lower than the timeslice length.
1109
1110 =item B<-m DELAY>, B<--migration_delay_us=DELAY>
1111
1112 Migration delay specifies for how long a vCPU, after it stopped running should
1113 be considered "cache-hot". Basically, if less than DELAY us passed since when
1114 the vCPU was executing on a CPU, it is likely that most of the vCPU's working
1115 set is still in the CPU's cache, and therefore the vCPU is not migrated.
1116
1117 Default is 0. Maximum is 100 ms. This can be effective at preventing vCPUs
1118 to bounce among CPUs too quickly, but, at the same time, the scheduler stops
1119 being fully work-conserving.
1120
1121 =back
1122
1123 B<COMBINATION>
1124
1125 The following is the effect of combining the above options:
1126
1127 =over 4
1128
1129 =item B<E<lt>nothingE<gt>> : List all domain params and sched params from all pools
1130
1131 =item B<-d [domid]> : List domain params for domain [domid]
1132
1133 =item B<-d [domid] [params]> : Set domain params for domain [domid]
1134
1135 =item B<-p [pool]> : list all domains and sched params for [pool]
1136
1137 =item B<-s> : List sched params for poolid 0
1138
1139 =item B<-s [params]> : Set sched params for poolid 0
1140
1141 =item B<-p [pool] -s> : List sched params for [pool]
1142
1143 =item B<-p [pool] -s [params]> : Set sched params for [pool]
1144
1145 =item B<-p [pool] -d>... : Illegal
1146
1147 =back
1148
1149 =item B<sched-credit2> [I<OPTIONS>]
1150
1151 Set or get credit2 scheduler parameters. The credit2 scheduler is a
1152 proportional fair share CPU scheduler built from the ground up to be
1153 work conserving on SMP hosts.
1154
1155 Each domain (including Domain0) is assigned a weight.
1156
1157 B<OPTIONS>
1158
1159 =over 4
1160
1161 =item B<-d DOMAIN>, B<--domain=DOMAIN>
1162
1163 Specify domain for which scheduler parameters are to be modified or retrieved.
1164 Mandatory for modifying scheduler parameters.
1165
1166 =item B<-w WEIGHT>, B<--weight=WEIGHT>
1167
1168 A domain with a weight of 512 will get twice as much CPU as a domain
1169 with a weight of 256 on a contended host. Legal weights range from 1
1170 to 65535 and the default is 256.
1171
1172 =item B<-p CPUPOOL>, B<--cpupool=CPUPOOL>
1173
1174 Restrict output to domains in the specified cpupool.
1175
1176 =item B<-s>, B<--schedparam>
1177
1178 Specify to list or set pool-wide scheduler parameters.
1179
1180 =item B<-r RLIMIT>, B<--ratelimit_us=RLIMIT>
1181
1182 Attempts to limit the rate of context switching. It is basically the same
1183 as B<--ratelimit_us> in B<sched-credit>
1184
1185 =back
1186
1187 =item B<sched-rtds> [I<OPTIONS>]
1188
1189 Set or get rtds (Real Time Deferrable Server) scheduler parameters.
1190 This rt scheduler applies Preemptive Global Earliest Deadline First
1191 real-time scheduling algorithm to schedule VCPUs in the system.
1192 Each VCPU has a dedicated period, budget and extratime.
1193 While scheduled, a VCPU burns its budget.
1194 A VCPU has its budget replenished at the beginning of each period;
1195 Unused budget is discarded at the end of each period.
1196 A VCPU with extratime set gets extra time from the unreserved system resource.
1197
1198 B<OPTIONS>
1199
1200 =over 4
1201
1202 =item B<-d DOMAIN>, B<--domain=DOMAIN>
1203
1204 Specify domain for which scheduler parameters are to be modified or retrieved.
1205 Mandatory for modifying scheduler parameters.
1206
1207 =item B<-v VCPUID/all>, B<--vcpuid=VCPUID/all>
1208
1209 Specify vcpu for which scheduler parameters are to be modified or retrieved.
1210
1211 =item B<-p PERIOD>, B<--period=PERIOD>
1212
1213 Period of time, in microseconds, over which to replenish the budget.
1214
1215 =item B<-b BUDGET>, B<--budget=BUDGET>
1216
1217 Amount of time, in microseconds, that the VCPU will be allowed
1218 to run every period.
1219
1220 =item B<-e Extratime>, B<--extratime=Extratime>
1221
1222 Binary flag to decide if the VCPU will be allowed to get extra time from
1223 the unreserved system resource.
1224
1225 =item B<-c CPUPOOL>, B<--cpupool=CPUPOOL>
1226
1227 Restrict output to domains in the specified cpupool.
1228
1229 =back
1230
1231 B<EXAMPLE>
1232
1233 =over 4
1234
1235 1) Use B<-v all> to see the budget and period of all the VCPUs of
1236 all the domains:
1237
1238 xl sched-rtds -v all
1239 Cpupool Pool-0: sched=RTDS
1240 Name ID VCPU Period Budget Extratime
1241 Domain-0 0 0 10000 4000 yes
1242 vm1 2 0 300 150 yes
1243 vm1 2 1 400 200 yes
1244 vm1 2 2 10000 4000 yes
1245 vm1 2 3 1000 500 yes
1246 vm2 4 0 10000 4000 yes
1247 vm2 4 1 10000 4000 yes
1248
1249 Without any arguments, it will output the default scheduling
1250 parameters for each domain:
1251
1252 xl sched-rtds
1253 Cpupool Pool-0: sched=RTDS
1254 Name ID Period Budget Extratime
1255 Domain-0 0 10000 4000 yes
1256 vm1 2 10000 4000 yes
1257 vm2 4 10000 4000 yes
1258
1259
1260 2) Use, for instance, B<-d vm1, -v all> to see the budget and
1261 period of all VCPUs of a specific domain (B<vm1>):
1262
1263 xl sched-rtds -d vm1 -v all
1264 Name ID VCPU Period Budget Extratime
1265 vm1 2 0 300 150 yes
1266 vm1 2 1 400 200 yes
1267 vm1 2 2 10000 4000 yes
1268 vm1 2 3 1000 500 yes
1269
1270 To see the parameters of a subset of the VCPUs of a domain, use:
1271
1272 xl sched-rtds -d vm1 -v 0 -v 3
1273 Name ID VCPU Period Budget Extratime
1274 vm1 2 0 300 150 yes
1275 vm1 2 3 1000 500 yes
1276
1277 If no B<-v> is specified, the default scheduling parameters for the
1278 domain are shown:
1279
1280 xl sched-rtds -d vm1
1281 Name ID Period Budget Extratime
1282 vm1 2 10000 4000 yes
1283
1284
1285 3) Users can set the budget and period of multiple VCPUs of a
1286 specific domain with only one command,
1287 e.g., "xl sched-rtds -d vm1 -v 0 -p 100 -b 50 -e 1 -v 3 -p 300 -b 150 -e 0".
1288
1289 To change the parameters of all the VCPUs of a domain, use B<-v all>,
1290 e.g., "xl sched-rtds -d vm1 -v all -p 500 -b 250 -e 1".
1291
1292 =back
1293
1294 =back
1295
1296 =head1 CPUPOOLS COMMANDS
1297
1298 Xen can group the physical cpus of a server in cpu-pools. Each physical CPU is
1299 assigned at most to one cpu-pool. Domains are each restricted to a single
1300 cpu-pool. Scheduling does not cross cpu-pool boundaries, so each cpu-pool has
1301 its own scheduler.
1302 Physical cpus and domains can be moved from one cpu-pool to another only by an
1303 explicit command.
1304 Cpu-pools can be specified either by name or by id.
1305
1306 =over 4
1307
1308 =item B<cpupool-create> [I<OPTIONS>] [I<configfile>] [I<variable=value> ...]
1309
1310 Create a cpu pool based an config from a I<configfile> or command-line
1311 parameters. Variable settings from the I<configfile> may be altered
1312 by specifying new or additional assignments on the command line.
1313
1314 See the L<xlcpupool.cfg(5)> manpage for more information.
1315
1316 B<OPTIONS>
1317
1318 =over 4
1319
1320 =item B<-f=FILE>, B<--defconfig=FILE>
1321
1322 Use the given configuration file.
1323
1324 =back
1325
1326 =item B<cpupool-list> [I<OPTIONS>] [I<cpu-pool>]
1327
1328 List CPU pools on the host.
1329
1330 B<OPTIONS>
1331
1332 =over 4
1333
1334 =item B<-c>, B<--cpus>
1335
1336 If this option is specified, B<xl> prints a list of CPUs used by I<cpu-pool>.
1337
1338 =back
1339
1340 =item B<cpupool-destroy> I<cpu-pool>
1341
1342 Deactivates a cpu pool.
1343 This is possible only if no domain is active in the cpu-pool.
1344
1345 =item B<cpupool-rename> I<cpu-pool> <newname>
1346
1347 Renames a cpu-pool to I<newname>.
1348
1349 =item B<cpupool-cpu-add> I<cpu-pool> I<cpus|node:nodes>
1350
1351 Adds one or more CPUs or NUMA nodes to I<cpu-pool>. CPUs and NUMA
1352 nodes can be specified as single CPU/node IDs or as ranges.
1353
1354 For example:
1355
1356 (a) xl cpupool-cpu-add mypool 4
1357 (b) xl cpupool-cpu-add mypool 1,5,10-16,^13
1358 (c) xl cpupool-cpu-add mypool node:0,nodes:2-3,^10-12,8
1359
1360 means adding CPU 4 to mypool, in (a); adding CPUs 1,5,10,11,12,14,15
1361 and 16, in (b); and adding all the CPUs of NUMA nodes 0, 2 and 3,
1362 plus CPU 8, but keeping out CPUs 10,11,12, in (c).
1363
1364 All the specified CPUs that can be added to the cpupool will be added
1365 to it. If some CPU can't (e.g., because they're already part of another
1366 cpupool), an error is reported about each one of them.
1367
1368 =item B<cpupool-cpu-remove> I<cpu-pool> I<cpus|node:nodes>
1369
1370 Removes one or more CPUs or NUMA nodes from I<cpu-pool>. CPUs and NUMA
1371 nodes can be specified as single CPU/node IDs or as ranges, using the
1372 exact same syntax as in B<cpupool-cpu-add> above.
1373
1374 =item B<cpupool-migrate> I<domain-id> I<cpu-pool>
1375
1376 Moves a domain specified by domain-id or domain-name into a cpu-pool.
1377 Domain-0 can't be moved to another cpu-pool.
1378
1379 =item B<cpupool-numa-split>
1380
1381 Splits up the machine into one cpu-pool per numa node.
1382
1383 =back
1384
1385 =head1 VIRTUAL DEVICE COMMANDS
1386
1387 Most virtual devices can be added and removed while guests are
1388 running, assuming that the necessary support exists in the guest OS. The
1389 effect to the guest OS is much the same as any hotplug event.
1390
1391 =head2 BLOCK DEVICES
1392
1393 =over 4
1394
1395 =item B<block-attach> I<domain-id> I<disc-spec-component(s)> ...
1396
1397 Create a new virtual block device and attach it to the specified domain.
1398 A disc specification is in the same format used for the B<disk> variable in
1399 the domain config file. See L<xl-disk-configuration(5)>. This will trigger a
1400 hotplug event for the guest.
1401
1402 Note that only PV block devices are supported by block-attach.
1403 Requests to attach emulated devices (eg, vdev=hdc) will result in only
1404 the PV view being available to the guest.
1405
1406 =item B<block-detach> [I<OPTIONS>] I<domain-id> I<devid>
1407
1408 Detach a domain's virtual block device. I<devid> may be the symbolic
1409 name or the numeric device id given to the device by domain 0. You
1410 will need to run B<xl block-list> to determine that number.
1411
1412 Detaching the device requires the cooperation of the domain. If the
1413 domain fails to release the device (perhaps because the domain is hung
1414 or is still using the device), the detach will fail.
1415
1416 B<OPTIONS>
1417
1418 =over 4
1419
1420 =item B<--force>
1421
1422 If this parameter is specified the device will be forcefully detached, which
1423 may cause IO errors in the domain and possibly a guest crash
1424
1425 =back
1426
1427
1428
1429 =item B<block-list> I<domain-id>
1430
1431 List virtual block devices for a domain.
1432
1433 =item B<cd-insert> I<domain-id> I<virtualdevice> I<target>
1434
1435 Insert a cdrom into a guest domain's existing virtual cd drive. The
1436 virtual drive must already exist but can be empty. How the device should be
1437 presented to the guest domain is specified by the I<virtualdevice> parameter;
1438 for example "hdc". Parameter I<target> is the target path in the backend domain
1439 (usually domain 0) to be exported; can be a block device or a file etc.
1440 See B<target> in L<xl-disk-configuration(5)>.
1441
1442 Only works with HVM domains.
1443
1444
1445 =item B<cd-eject> I<domain-id> I<virtualdevice>
1446
1447 Eject a cdrom from a guest domain's virtual cd drive, specified by
1448 I<virtualdevice>. Only works with HVM domains.
1449
1450 =back
1451
1452 =head2 NETWORK DEVICES
1453
1454 =over 4
1455
1456 =item B<network-attach> I<domain-id> I<network-device>
1457
1458 Creates a new network device in the domain specified by I<domain-id>.
1459 I<network-device> describes the device to attach, using the same format as the
1460 B<vif> string in the domain config file. See L<xl.cfg(5)> and
1461 L<xl-network-configuration(5)>
1462 for more information.
1463
1464 Note that only attaching PV network interfaces is supported.
1465
1466 =item B<network-detach> I<domain-id> I<devid|mac>
1467
1468 Removes the network device from the domain specified by I<domain-id>.
1469 I<devid> is the virtual interface device number within the domain
1470 (i.e. the 3 in vif22.3). Alternatively, the I<mac> address can be used to
1471 select the virtual interface to detach.
1472
1473 =item B<network-list> I<domain-id>
1474
1475 List virtual network interfaces for a domain.
1476
1477 =back
1478
1479 =head2 CHANNEL DEVICES
1480
1481 =over 4
1482
1483 =item B<channel-list> I<domain-id>
1484
1485 List virtual channel interfaces for a domain.
1486
1487 =back
1488
1489 =head2 VIRTUAL TRUSTED PLATFORM MODULE (vTPM) DEVICES
1490
1491 =over 4
1492
1493 =item B<vtpm-attach> I<domain-id> I<vtpm-device>
1494
1495 Creates a new vtpm (virtual Trusted Platform Module) device in the domain
1496 specified by I<domain-id>. I<vtpm-device> describes the device to attach,
1497 using the same format as the B<vtpm> string in the domain config file.
1498 See L<xl.cfg(5)> for more information.
1499
1500 =item B<vtpm-detach> I<domain-id> I<devid|uuid>
1501
1502 Removes the vtpm device from the domain specified by I<domain-id>.
1503 I<devid> is the numeric device id given to the virtual Trusted
1504 Platform Module device. You will need to run B<xl vtpm-list> to determine that
1505 number. Alternatively, the I<uuid> of the vtpm can be used to
1506 select the virtual device to detach.
1507
1508 =item B<vtpm-list> I<domain-id>
1509
1510 List virtual Trusted Platform Modules for a domain.
1511
1512 =back
1513
1514 =head2 VDISPL DEVICES
1515
1516 =over 4
1517
1518 =item B<vdispl-attach> I<domain-id> I<vdispl-device>
1519
1520 Creates a new vdispl device in the domain specified by I<domain-id>.
1521 I<vdispl-device> describes the device to attach, using the same format as the
1522 B<vdispl> string in the domain config file. See L<xl.cfg(5)> for
1523 more information.
1524
1525 B<NOTES>
1526
1527 =over 4
1528
1529 As in I<vdispl-device> string semicolon is used then put quotes or escaping
1530 when using from the shell.
1531
1532 B<EXAMPLE>
1533
1534 =over 4
1535
1536 xl vdispl-attach DomU connectors='id0:1920x1080;id1:800x600;id2:640x480'
1537
1538 or
1539
1540 xl vdispl-attach DomU connectors=id0:1920x1080\;id1:800x600\;id2:640x480
1541
1542 =back
1543
1544 =back
1545
1546 =item B<vdispl-detach> I<domain-id> I<dev-id>
1547
1548 Removes the vdispl device specified by I<dev-id> from the domain specified by I<domain-id>.
1549
1550 =item B<vdispl-list> I<domain-id>
1551
1552 List virtual displays for a domain.
1553
1554 =back
1555
1556 =head2 VSND DEVICES
1557
1558 =over 4
1559
1560 =item B<vsnd-attach> I<domain-id> I<vsnd-item> I<vsnd-item> ...
1561
1562 Creates a new vsnd device in the domain specified by I<domain-id>.
1563 I<vsnd-item>'s describe the vsnd device to attach, using the same format as the
1564 B<VSND_ITEM_SPEC> string in the domain config file. See L<xl.cfg(5)> for
1565 more information.
1566
1567 B<EXAMPLE>
1568
1569 =over 4
1570
1571 xl vsnd-attach DomU 'CARD, short-name=Main, sample-formats=s16_le;s8;u32_be'
1572 'PCM, name=Main' 'STREAM, id=0, type=p' 'STREAM, id=1, type=c, channels-max=2'
1573
1574 =back
1575
1576 =item B<vsnd-detach> I<domain-id> I<dev-id>
1577
1578 Removes the vsnd device specified by I<dev-id> from the domain specified by I<domain-id>.
1579
1580 =item B<vsnd-list> I<domain-id>
1581
1582 List vsnd devices for a domain.
1583
1584 =back
1585
1586 =head2 KEYBOARD DEVICES
1587
1588 =over 4
1589
1590 =item B<vkb-attach> I<domain-id> I<vkb-device>
1591
1592 Creates a new keyboard device in the domain specified by I<domain-id>.
1593 I<vkb-device> describes the device to attach, using the same format as the
1594 B<VKB_SPEC_STRING> string in the domain config file. See L<xl.cfg(5)>
1595 for more information.
1596
1597 =item B<vkb-detach> I<domain-id> I<devid>
1598
1599 Removes the keyboard device from the domain specified by I<domain-id>.
1600 I<devid> is the virtual interface device number within the domain
1601
1602 =item B<vkb-list> I<domain-id>
1603
1604 List virtual network interfaces for a domain.
1605
1606 =back
1607
1608 =head1 PCI PASS-THROUGH
1609
1610 =over 4
1611
1612 =item B<pci-assignable-list> [I<-n>]
1613
1614 List all the B<BDF> of assignable PCI devices. See
1615 L<xl-pci-configuration(5)> for more information. If the -n option is
1616 specified then any name supplied when the device was made assignable
1617 will also be displayed.
1618
1619 These are devices in the system which are configured to be
1620 available for passthrough and are bound to a suitable PCI
1621 backend driver in domain 0 rather than a real driver.
1622
1623 =item B<pci-assignable-add> [I<-n NAME>] I<BDF>
1624
1625 Make the device at B<BDF> assignable to guests. See
1626 L<xl-pci-configuration(5)> for more information. If the -n option is
1627 supplied then the assignable device entry will the named with the
1628 given B<NAME>.
1629
1630 This will bind the device to the pciback driver and assign it to the
1631 "quarantine domain". If it is already bound to a driver, it will
1632 first be unbound, and the original driver stored so that it can be
1633 re-bound to the same driver later if desired. If the device is
1634 already bound, it will assign it to the quarantine domain and return
1635 success.
1636
1637 CAUTION: This will make the device unusable by Domain 0 until it is
1638 returned with pci-assignable-remove. Care should therefore be taken
1639 not to do this on a device critical to domain 0's operation, such as
1640 storage controllers, network interfaces, or GPUs that are currently
1641 being used.
1642
1643 =item B<pci-assignable-remove> [I<-r>] I<BDF>|I<NAME>
1644
1645 Make a device non-assignable to guests. The device may be identified
1646 either by its B<BDF> or the B<NAME> supplied when the device was made
1647 assignable. See L<xl-pci-configuration(5)> for more information.
1648
1649 This will at least unbind the device from pciback, and
1650 re-assign it from the "quarantine domain" back to domain 0. If the -r
1651 option is specified, it will also attempt to re-bind the device to its
1652 original driver, making it usable by Domain 0 again. If the device is
1653 not bound to pciback, it will return success.
1654
1655 Note that this functionality will work even for devices which were not
1656 made assignable by B<pci-assignable-add>. This can be used to allow
1657 dom0 to access devices which were automatically quarantined by Xen
1658 after domain destruction as a result of Xen's B<iommu=quarantine>
1659 command-line default.
1660
1661 As always, this should only be done if you trust the guest, or are
1662 confident that the particular device you're re-assigning to dom0 will
1663 cancel all in-flight DMA on FLR.
1664
1665 =item B<pci-attach> I<domain-id> I<PCI_SPEC_STRING>
1666
1667 Hot-plug a new pass-through pci device to the specified domain. See
1668 L<xl-pci-configuration(5)> for more information.
1669
1670 =item B<pci-detach> [I<OPTIONS>] I<domain-id> I<PCI_SPEC_STRING>
1671
1672 Hot-unplug a pci device that was previously passed through to a domain. See
1673 L<xl-pci-configuration(5)> for more information.
1674
1675 B<OPTIONS>
1676
1677 =over 4
1678
1679 =item B<-f>
1680
1681 If this parameter is specified, B<xl> is going to forcefully remove the device
1682 even without guest domain's collaboration.
1683
1684 =back
1685
1686 =item B<pci-list> I<domain-id>
1687
1688 List the B<BDF> of pci devices passed through to a domain.
1689
1690 =back
1691
1692 =head1 USB PASS-THROUGH
1693
1694 =over 4
1695
1696 =item B<usbctrl-attach> I<domain-id> I<usbctrl-device>
1697
1698 Create a new USB controller in the domain specified by I<domain-id>,
1699 I<usbctrl-device> describes the device to attach, using form
1700 C<KEY=VALUE KEY=VALUE ...> where B<KEY=VALUE> has the same
1701 meaning as the B<usbctrl> description in the domain config file.
1702 See L<xl.cfg(5)> for more information.
1703
1704 =item B<usbctrl-detach> I<domain-id> I<devid>
1705
1706 Destroy a USB controller from the specified domain.
1707 B<devid> is devid of the USB controller.
1708
1709 =item B<usbdev-attach> I<domain-id> I<usbdev-device>
1710
1711 Hot-plug a new pass-through USB device to the domain specified by
1712 I<domain-id>, I<usbdev-device> describes the device to attach, using
1713 form C<KEY=VALUE KEY=VALUE ...> where B<KEY=VALUE> has the same
1714 meaning as the B<usbdev> description in the domain config file.
1715 See L<xl.cfg(5)> for more information.
1716
1717 =item B<usbdev-detach> I<domain-id> I<controller=devid> I<port=number>
1718
1719 Hot-unplug a previously assigned USB device from a domain.
1720 B<controller=devid> and B<port=number> is USB controller:port in the guest
1721 domain the USB device is attached to.
1722
1723 =item B<usb-list> I<domain-id>
1724
1725 List pass-through usb devices for a domain.
1726
1727 =back
1728
1729 =head1 DEVICE-MODEL CONTROL
1730
1731 =over 4
1732
1733 =item B<qemu-monitor-command> I<domain-id> I<command>
1734
1735 Issue a monitor command to the device model of the domain specified by
1736 I<domain-id>. I<command> can be any valid command qemu understands. This
1737 can be e.g. used to add non-standard devices or devices with non-standard
1738 parameters to a domain. The output of the command is printed to stdout.
1739
1740 B<Warning:> This qemu monitor access is provided for convenience when
1741 debugging, troubleshooting, and experimenting. Its use is not
1742 supported by the Xen Project.
1743
1744 Specifically, not all information displayed by the qemu monitor will
1745 necessarily be accurate or complete, because in a Xen system qemu
1746 does not have a complete view of the guest.
1747
1748 Furthermore, modifying the guest's setup via the qemu monitor may
1749 conflict with the Xen toolstack's assumptions. Resulting problems
1750 may include, but are not limited to: guest crashes; toolstack error
1751 messages; inability to migrate the guest; and security
1752 vulnerabilities which are not covered by the Xen Project security
1753 response policy.
1754
1755 B<EXAMPLE>
1756
1757 Obtain information of USB devices connected as such via the device model
1758 (only!) to a domain:
1759
1760 xl qemu-monitor-command vm1 'info usb'
1761 Device 0.2, Port 5, Speed 480 Mb/s, Product Mass Storage
1762
1763 =back
1764
1765 =head1 FLASK
1766
1767 B<FLASK> is a security framework that defines a mandatory access control policy
1768 providing fine-grained controls over Xen domains, allowing the policy writer
1769 to define what interactions between domains, devices, and the hypervisor are
1770 permitted. Some example of what you can do using XSM/FLASK:
1771 - Prevent two domains from communicating via event channels or grants
1772 - Control which domains can use device passthrough (and which devices)
1773 - Restrict or audit operations performed by privileged domains
1774 - Prevent a privileged domain from arbitrarily mapping pages from other
1775 domains.
1776
1777 You can find more details on how to use FLASK and an example security
1778 policy here: L<https://xenbits.xenproject.org/docs/unstable/misc/xsm-flask.txt>
1779
1780 =over 4
1781
1782 =item B<getenforce>
1783
1784 Determine if the FLASK security module is loaded and enforcing its policy.
1785
1786 =item B<setenforce> I<1|0|Enforcing|Permissive>
1787
1788 Enable or disable enforcing of the FLASK access controls. The default is
1789 permissive, but this can be changed to enforcing by specifying "flask=enforcing"
1790 or "flask=late" on the hypervisor's command line.
1791
1792 =item B<loadpolicy> I<policy-file>
1793
1794 Load FLASK policy from the given policy file. The initial policy is provided to
1795 the hypervisor as a multiboot module; this command allows runtime updates to the
1796 policy. Loading new security policy will reset runtime changes to device labels.
1797
1798 =back
1799
1800 =head1 PLATFORM SHARED RESOURCE MONITORING/CONTROL
1801
1802 Intel Haswell and later server platforms offer shared resource monitoring
1803 and control technologies. The availability of these technologies and the
1804 hardware capabilities can be shown with B<psr-hwinfo>.
1805
1806 See L<https://xenbits.xenproject.org/docs/unstable/misc/xl-psr.html> for more
1807 information.
1808
1809 =over 4
1810
1811 =item B<psr-hwinfo> [I<OPTIONS>]
1812
1813 Show Platform Shared Resource (PSR) hardware information.
1814
1815 B<OPTIONS>
1816
1817 =over 4
1818
1819 =item B<-m>, B<--cmt>
1820
1821 Show Cache Monitoring Technology (CMT) hardware information.
1822
1823 =item B<-a>, B<--cat>
1824
1825 Show Cache Allocation Technology (CAT) hardware information.
1826
1827 =back
1828
1829 =back
1830
1831 =head2 CACHE MONITORING TECHNOLOGY
1832
1833 Intel Haswell and later server platforms offer monitoring capability in each
1834 logical processor to measure specific platform shared resource metric, for
1835 example, L3 cache occupancy. In the Xen implementation, the monitoring
1836 granularity is domain level. To monitor a specific domain, just attach the
1837 domain id with the monitoring service. When the domain doesn't need to be
1838 monitored any more, detach the domain id from the monitoring service.
1839
1840 Intel Broadwell and later server platforms also offer total/local memory
1841 bandwidth monitoring. Xen supports per-domain monitoring for these two
1842 additional monitoring types. Both memory bandwidth monitoring and L3 cache
1843 occupancy monitoring share the same set of underlying monitoring service. Once
1844 a domain is attached to the monitoring service, monitoring data can be shown
1845 for any of these monitoring types.
1846
1847 There is no cache monitoring and memory bandwidth monitoring on L2 cache so
1848 far.
1849
1850 =over 4
1851
1852 =item B<psr-cmt-attach> I<domain-id>
1853
1854 attach: Attach the platform shared resource monitoring service to a domain.
1855
1856 =item B<psr-cmt-detach> I<domain-id>
1857
1858 detach: Detach the platform shared resource monitoring service from a domain.
1859
1860 =item B<psr-cmt-show> I<psr-monitor-type> [I<domain-id>]
1861
1862 Show monitoring data for a certain domain or all domains. Current supported
1863 monitor types are:
1864 - "cache-occupancy": showing the L3 cache occupancy(KB).
1865 - "total-mem-bandwidth": showing the total memory bandwidth(KB/s).
1866 - "local-mem-bandwidth": showing the local memory bandwidth(KB/s).
1867
1868 =back
1869
1870 =head2 CACHE ALLOCATION TECHNOLOGY
1871
1872 Intel Broadwell and later server platforms offer capabilities to configure and
1873 make use of the Cache Allocation Technology (CAT) mechanisms, which enable more
1874 cache resources (i.e. L3/L2 cache) to be made available for high priority
1875 applications. In the Xen implementation, CAT is used to control cache allocation
1876 on VM basis. To enforce cache on a specific domain, just set capacity bitmasks
1877 (CBM) for the domain.
1878
1879 Intel Broadwell and later server platforms also offer Code/Data Prioritization
1880 (CDP) for cache allocations, which support specifying code or data cache for
1881 applications. CDP is used on a per VM basis in the Xen implementation. To
1882 specify code or data CBM for the domain, CDP feature must be enabled and CBM
1883 type options need to be specified when setting CBM, and the type options (code
1884 and data) are mutually exclusive. There is no CDP support on L2 so far.
1885
1886 =over 4
1887
1888 =item B<psr-cat-set> [I<OPTIONS>] I<domain-id> I<cbm>
1889
1890 Set cache capacity bitmasks(CBM) for a domain. For how to specify I<cbm>
1891 please refer to L<https://xenbits.xenproject.org/docs/unstable/misc/xl-psr.html>.
1892
1893 B<OPTIONS>
1894
1895 =over 4
1896
1897 =item B<-s SOCKET>, B<--socket=SOCKET>
1898
1899 Specify the socket to process, otherwise all sockets are processed.
1900
1901 =item B<-l LEVEL>, B<--level=LEVEL>
1902
1903 Specify the cache level to process, otherwise the last level cache (L3) is
1904 processed.
1905
1906 =item B<-c>, B<--code>
1907
1908 Set code CBM when CDP is enabled.
1909
1910 =item B<-d>, B<--data>
1911
1912 Set data CBM when CDP is enabled.
1913
1914 =back
1915
1916 =item B<psr-cat-show> [I<OPTIONS>] [I<domain-id>]
1917
1918 Show CAT settings for a certain domain or all domains.
1919
1920 B<OPTIONS>
1921
1922 =over 4
1923
1924 =item B<-l LEVEL>, B<--level=LEVEL>
1925
1926 Specify the cache level to process, otherwise the last level cache (L3) is
1927 processed.
1928
1929 =back
1930
1931 =back
1932
1933 =head2 Memory Bandwidth Allocation
1934
1935 Intel Skylake and later server platforms offer capabilities to configure and
1936 make use of the Memory Bandwidth Allocation (MBA) mechanisms, which provides
1937 OS/VMMs the ability to slow misbehaving apps/VMs by using a credit-based
1938 throttling mechanism. In the Xen implementation, MBA is used to control memory
1939 bandwidth on VM basis. To enforce bandwidth on a specific domain, just set
1940 throttling value (THRTL) for the domain.
1941
1942 =over 4
1943
1944 =item B<psr-mba-set> [I<OPTIONS>] I<domain-id> I<thrtl>
1945
1946 Set throttling value (THRTL) for a domain. For how to specify I<thrtl>
1947 please refer to L<https://xenbits.xenproject.org/docs/unstable/misc/xl-psr.html>.
1948
1949 B<OPTIONS>
1950
1951 =over 4
1952
1953 =item B<-s SOCKET>, B<--socket=SOCKET>
1954
1955 Specify the socket to process, otherwise all sockets are processed.
1956
1957 =back
1958
1959 =item B<psr-mba-show> [I<domain-id>]
1960
1961 Show MBA settings for a certain domain or all domains. For linear mode, it
1962 shows the decimal value. For non-linear mode, it shows hexadecimal value.
1963
1964 =back
1965
1966 =head1 IGNORED FOR COMPATIBILITY WITH XM
1967
1968 xl is mostly command-line compatible with the old xm utility used with
1969 the old Python xend. For compatibility, the following options are
1970 ignored:
1971
1972 =over 4
1973
1974 =item B<xl migrate --live>
1975
1976 =back
1977
1978 =head1 ENVIRONMENT VARIABLES
1979
1980 The following environment variables shall affect the execution of xl:
1981
1982 =over 4
1983
1984 =item LIBXL_BOOTLOADER_RESTRICT
1985
1986 Equivalent to L<xl.cfg(5)> B<bootloader_restrict> option. Provided for
1987 compatibility reasons. Having this variable set is equivalent to enabling
1988 the option, even if the value is 0.
1989
1990 If set takes precedence over L<xl.cfg(5)> and L<xl.conf(5)>
1991 B<bootloader_restrict> options.
1992
1993 =item LIBXL_BOOTLOADER_USER
1994
1995 Equivalent to L<xl.cfg(5)> B<bootloader_user> option. Provided for
1996 compatibility reasons.
1997
1998 If set takes precedence over L<xl.cfg(5)> B<bootloader_user> option.
1999
2000 =item LIBXL_BOOTLOADER_TIMEOUT
2001
2002 Timeout in seconds for bootloader execution when running in restricted mode.
2003 Otherwise the build time default in LIBXL_BOOTLOADER_TIMEOUT will be used.
2004
2005 If defined the value must be an unsigned integer between 0 and INT_MAX,
2006 otherwise behavior is undefined. Setting to 0 disables the timeout.
2007
2008 =back
2009
2010 =head1 SEE ALSO
2011
2012 The following man pages:
2013
2014 L<xl.cfg(5)>, L<xlcpupool.cfg(5)>, L<xentop(1)>, L<xl-disk-configuration(5)>
2015 L<xl-network-configuration(5)>
2016
2017 And the following documents on the xenproject.org website:
2018
2019 L<https://xenbits.xenproject.org/docs/unstable/misc/xsm-flask.txt>
2020 L<https://xenbits.xenproject.org/docs/unstable/misc/xl-psr.html>
2021
2022 For systems that don't automatically bring the CPU online:
2023
2024 L<https://wiki.xenproject.org/wiki/Paravirt_Linux_CPU_Hotplug>
2025
2026 =head1 BUGS
2027
2028 Send bugs to [email protected], see
2029 https://wiki.xenproject.org/wiki/Reporting_Bugs_against_Xen_Project on how to send bug reports.