view docs/man/xm.pod.1 @ 9792:75f8e9c4e483

Put back some modules directly in kernel.
ATA_PIIX, PACKET and SECURITY_CAPABILITY are not correctly load on certain

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
author vhanquez@kneesa.uk.xensource.com
date Thu Apr 20 15:45:09 2006 +0100 (2006-04-20)
parents 767e14b727fa
children c7b9b8a64755
line source
1 =head1 NAME
3 xm - Xen management user interface
5 =head1 SYNOPSIS
7 xm <subcommand> [args]
11 The B<xm> program is the main interface 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.
16 The basic structure of every xm command is almost always:
18 xm <subcommand> <domain-id> [OPTIONS]
20 Where I<subcommand> is one of the sub commands listed below, I<domain-id>
21 is the numeric domain id, or the domain name (which will be internally
22 translated to domain id), and I<OPTIONS> are sub command specific
23 options. There are a few exceptions to this rule in the cases where
24 the sub command in question acts on all domains, the entire machine,
25 or directly on the xen hypervisor. Those exceptions will be clear for
26 each of those sub commands.
28 =head1 NOTES
30 All B<xm> opperations rely upon the Xen control daemon, aka B<xend>.
31 For any xm commands to run xend must also be running. For this reason
32 you should start xend as a service when your system first boots using
33 xen.
35 Most B<xm> commands require root privledges to run due to the
36 communications channels used to talk to the hypervisor. Running as
37 non root will return an error.
39 Most B<xm> commands act asynchronously, so just because the B<xm>
40 command returned, doesn't mean the action is complete. This is
41 important, as many operations on domains, like create and shutdown,
42 can take considerable time (30 seconds or more) to bring the machine
43 into a fully compliant state. If you want to know when one of these
44 actions has finished you must poll through xm list periodically.
48 The following sub commands manipulate domains directly, as stated
49 previously most commands take domain-id as the first parameter.
51 =over 4
53 =item B<console> I<domain-id>
55 Attach to domain domain-id's console. If you've set up your Domains to
56 have a traditional log in console this will look much like a normal
57 text log in screen.
59 This uses the back end xenconsole service which currently only
60 works for para-virtual domains.
62 The attached console will perform much like a standard serial console,
63 so running curses based interfaces over the console B<is not
64 advised>. Vi tends to get very odd when using it over this interface.
66 =item B<create> I<[-c]> I<configfile> I<[name=value]>..
68 The create sub command requires a configfile and can optional take a
69 series of name value pairs that add to or override variables defined
70 in the config file. See L<xmdomain.cfg> for full details of that file
71 format, and possible options used in either the configfile or
72 Name=Value combinations.
74 Configfile can either be an absolute path to a file, or a relative
75 path to a file located in /etc/xen.
77 Create will return B<as soon> as the domain is started. This B<does
78 not> mean the guest OS in the domain has actually booted, or is
79 available for input.
83 =over 4
85 =item B<-c>
87 Attache console to the domain as soon as it has started. This is
88 useful for determining issues with crashing domains.
90 =back
94 =over 4
96 =item I<with config file>
98 xm create Fedora4
100 This creates a domain with the file /etc/xen/Fedora4, and returns as
101 soon as it is run.
103 =item I<without config file>
105 xm create /dev/null ramdisk=initrd.img \
106 kernel=/boot/vmlinuz- \
107 name=ramdisk nics=0 vcpus=1 \
108 memory=64 root=/dev/ram0
110 This creates the domain without using a config file (more specifically
111 using /dev/null as an empty config file), kernel and ramdisk as
112 specified, setting the name of the domain to "ramdisk", also disabling
113 virtual networking. (This example comes from the xm-test test suite.)
115 =back
117 =item B<destroy> I<domain-id>
119 Immediately terminate the domain domain-id. This doesn't give the domain
120 OS any chance to react, and it the equivalent of ripping the power
121 cord out on a physical machine. In most cases you will want to use
122 the B<shutdown> command instead.
124 =item B<domid> I<domain-name>
126 Converts a domain name to a domain id using xend's internal mapping.
128 =item B<domname> I<domain-id>
130 Converts a domain id to a domain name using xend's internal mapping.
132 =item B<help> I<[--long]>
134 Displays the short help message (i.e. common commands).
136 The I<--long> option prints out the complete set of B<xm> subcommands,
137 grouped by function.
139 =item B<list> I<[--long]> I<[domain-id, ...]>
141 Prints information about one or more domains. If no domains are
142 specified it prints out information about all domains.
144 An example format for the list is as follows:
146 Name ID Mem(MiB) VCPUs State Time(s)
147 Domain-0 0 98 1 r----- 5068.6
148 Fedora3 164 128 1 r----- 7.6
149 Fedora4 165 128 1 ------ 0.6
150 Mandrake2006 166 128 1 -b---- 3.6
151 Mandrake10.2 167 128 1 ------ 2.5
152 Suse9.2 168 100 1 ------ 1.8
154 Name is the name of the domain. ID the domain numeric id. Mem is the
155 size of the memory allocated to the domain. VCPUS is the number of
156 VCPUS allocated to domain. State is the run state (see below). Time
157 is the total run time of the domain as accounted for by Xen.
161 =over 4
163 The State field lists 6 states for a Xen Domain, and which ones the
164 current Domain is in.
166 =item B<r - running>
168 The domain is currently running on a CPU
170 =item B<b - blocked>
172 The domain is blocked, and not running or runable. This can be caused
173 because the domain is waiting on IO (a traditional wait state) or has
174 gone to sleep because there was nothing else for it to do.
176 =item B<p - paused>
178 The domain has been paused, usually occurring through the administrator
179 running B<xm pause>. When in a paused state the domain will still
180 consume allocated resources like memory, but will not be eligible for
181 scheduling by the Xen hypervisor.
183 =item B<s - shutdown>
185 FIXME: Why would you ever see this state?
187 =item B<c - crashed>
189 The domain has crashed, which is always a violent ending. Usually
190 this state can only occur if the domain has been configured not to
191 restart on crash. See L<xmdomain.cfg> for more info.
193 =item B<d - dying>
195 The domain is in process of dying, but hasn't completely shutdown or
196 crashed.
198 FIXME: Is this right?
200 =back
204 =over 4
206 If I<--long> is specified, the output for xm list is not the table
207 view shown above, but instead is an S-Expression representing all
208 information known about all domains asked for. This is mostly only
209 useful for external programs to parse the data.
211 B<Note:> there is no stable guarantees on the format of this data.
212 Use at your own risk.
214 =back
216 B<NOTES>
218 =over 4
220 The Time column is deceptive. Virtual IO (network and block devices)
221 used by Domains requires coordination by Domain0, which means that
222 Domain0 is actually charged for much of the time that a DomainU is
223 doing IO. Use of this time value to determine relative utilizations
224 by domains is thus very suspect, as a high IO workload may show as
225 less utilized than a high CPU workload. Consider yourself warned.
227 =back
229 =item B<mem-max> I<domain-id> I<mem>
231 Specify the maximum amount of memory the Domain is able to use. Mem
232 is specified in megabytes.
234 The mem-max value may not correspond to the actual memory used in the
235 Domain, as it may balloon down it's memory to give more back to the OS.
237 =item B<mem-set> I<domain-id> I<mem>
239 Set the domain's used memory using the balloon driver. Because this
240 operation requires cooperation from the domain operating system, there
241 is no guarantee that it will succeed.
243 B<Warning:> there is no good way to know in advance how small of a
244 mem-set will make a domain unstable and cause it to crash. Be very
245 careful when using this command on running domains.
247 =item B<migrate> I<domain-id> I<host> I<[options]>
249 Migrate a domain to another Host machine. B<Xend> must be running on
250 other host machine, it must be running the same version of xen, it
251 must have the migration tcp port open and accepting connections from
252 the source host, and there must be sufficient resources for the domain
253 to run (memory, disk, etc).
255 Migration is pretty complicated, and has many security implications,
256 please read the Xen Users Guide to ensure you understand the
257 ramifications and limitations on migration before attempting it in
258 production.
262 =over 4
264 =item B<-l, --live>
266 Use live migration. This will migrate the domain between hosts
267 without shutting down the domain. See the Xen Users Guide for more
268 information.
270 =item B<-r, --resource> I<Mbs>
272 Set maximum Mbs allowed for migrating the domain. This ensures that
273 the network link is not saturated with migration traffic while
274 attempting to do other useful work.
276 =back
278 =item B<pause> I<domain-id>
280 Pause a domain. When in a paused state the domain will still consume
281 allocated resources such as memory, but will not be eligible for
282 scheduling by the Xen hypervisor.
284 =item B<reboot> I<[options]> I<domain-id>
286 Reboot a domain. This acts just as if the domain had the B<reboot>
287 command run from the console. The command returns as soon as it has
288 executed the reboot action, which may be significantly before the
289 domain actually reboots.
291 The behavior of what happens to a domain when it reboots is set by the
292 I<on_reboot> parameter of the xmdomain.cfg file when the domain was
293 created.
297 =over 4
299 =item B<-a, --all>
301 Reboot all domains
303 =item B<-w, --wait>
305 Wait for reboot to complete before returning. This may take a while,
306 as all services in the domain will have to be shut down cleanly.
308 =back
310 =item B<restore> I<state-file>
312 Build a domain from an B<xm save> state file. See I<save> for more info.
314 =item B<save> I<domain-id> I<state-file>
316 Saves a running domain to a state file so that it can be restored
317 later. Once saved, the domain will no longer be running on the
318 system, thus the memory allocated for the domain will be free for
319 other domains to use. B<xm restore> restores from this state file.
321 This is roughly equivalent to doing a hibernate on a running computer,
322 with all the same limitations. Open network connections may be
323 severed upon restore, as TCP timeouts may have expired.
325 =item B<shutdown> I<[options]> I<domain-id>
327 Gracefully shuts down a domain. This coordinates with the domain OS
328 to perform graceful shutdown, so there is no guaruntee that it will
329 succeed, and may take a variable length of time depending on what
330 services must be shutdown in the domain. The command returns
331 immediately after signally the domain unless that I<-w> flag is used.
333 The behavior of what happens to a domain when it reboots is set by the
334 I<on_shutdown> parameter of the xmdomain.cfg file when the domain was
335 created.
339 =over 4
341 =item B<-a>
343 Shutdown B<all> domains. Often used when doing a complete shutdown of
344 a Xen system.
346 =item B<-w>
348 Wait for the domain to complete shutdown before returning.
350 =back
352 =item B<sysrq> I<domain-id> I<letter>
354 Send a I<Magic System Request> signal to the domain. For more
355 information on available magic sys req operations, see sysrq.txt in
356 your Linux Kernel sources.
358 =item B<unpause> I<domain-id>
360 Moves a domain out of the paused state. This will allow a previously
361 paused domain to now be eligible for scheduling by the Xen hypervisor.
363 =item B<vcpu-set> I<domain-id> I<vcpu-count>
365 Enables the I<vcpu-count> virtual CPUs for the domain in question.
366 Like mem-set, this command can only allocate up to the maximum virtual
367 CPU count configured at boot for the domain.
369 If the I<vcpu-count> is smaller than the current number of active
370 VCPUs, the highest number VCPUs will be hotplug removed. This may be
371 important for pinning purposes.
373 Attempting to set the VCPUs to a number larger than the initially
374 configured VCPU count is an error. Trying to set VCPUs to < 1 will be
375 quietly ignored.
377 =item B<vcpu-list> I<[domain-id]>
379 Lists VCPU information for a specific domain. If no domain is
380 specified, VCPU information for all domains will be provided.
382 =item B<vcpu-pin> I<domain-id> I<vcpu> I<cpus>
384 Pins the the VCPU to only run on the specific CPUs.
386 Normally VCPUs can float between available CPUs whenever Xen deems a
387 different run state is appropriate. Pinning can be used to restrict
388 this, by ensuring certain VCPUs can only run on certain physical
389 CPUs.
391 =back
395 =over 4
397 =item B<dmesg> I<[-c]>
399 Reads the Xen message buffer, similar to dmesg on a Linux system. The
400 buffer contains informational, warning, and error messages created
401 during Xen's boot process. If you are having problems with Xen, this
402 is one of the first places to look as part of problem determination.
406 =over 4
408 =item B<-c, --clear>
410 Clears Xen's message buffer.
412 =back
414 =item B<info>
416 Print information about the Xen host in I<name : value> format. When
417 reporting a Xen bug, please provide this information as part of the
418 bug report.
420 Sample xen domain info looks as follows (lines wrapped manually to
421 make the man page more readable):
423 system : Linux
424 host : talon
425 release :
426 version : #1 Mon Nov 14 14:26:26 EST 2005
427 machine : i686
428 nr_cpus : 2
429 nr_nodes : 1
430 sockets_per_node : 2
431 cores_per_socket : 1
432 threads_per_core : 1
433 cpu_mhz : 696
434 hw_caps : 0383fbff:00000000:00000000:00000040
435 memory : 767
436 free_memory : 37
437 xen_major : 3
438 xen_minor : 0
439 xen_extra : -devel
440 xen_caps : xen-3.0-x86_32
441 xen_params : virt_start=0xfc000000
442 xen_changeset : Mon Nov 14 18:13:38 2005 +0100
443 7793:090e44133d40
444 cc_compiler : gcc version 3.4.3 (Mandrakelinux
445 10.2 3.4.3-7mdk)
446 cc_compile_by : sdague
447 cc_compile_domain : (none)
448 cc_compile_date : Mon Nov 14 14:16:48 EST 2005
452 =over 4
454 Not all fields will be explained here, but some of the less obvious
455 ones deserve explanation:
457 =item I<hw_caps>
459 A vector showing what hardware capabilities are supported by your
460 processor. This is equivalent to, though more cryptic, the flags
461 field in /proc/cpuinfo on a normal Linux machine.
463 =item I<free_memory>
465 Available memory (in MB) not allocated to Xen, or any other Domains.
467 =item I<xen_caps>
469 The xen version, architecture. Architecture values can be one of:
470 x86_32, x86_32p (i.e. PAE enabled), x86_64, ia64.
472 =item I<xen_changeset>
474 The xen mercurial changeset id. Very useful for determining exactly
475 what version of code your Xen system was built from.
477 =back
479 =item B<log>
481 Print out the B<xend> log. This log file can be found in
482 /var/log/xend.log.
484 =item B<top>
486 Executes the xentop command, which provides real time monitoring of
487 domains. Xentop is a curses interface, and reasonably self
488 explanatory.
490 =back
494 Xen ships with a number of domain schedulers, which can be set at boot
495 time with the I<sched=> parameter on the Xen command line. By
496 default I<sedf> is used for scheduling.
498 FIXME: we really need a scheduler expert to write up this section.
500 =over 4
502 =item B<sched-bvt> I<mcuadv> I<warpback> I<warpvalue> I<warpl> I<warpu>
504 Performs runtime adjustments to the default parameters for the
505 Borrowed Virtual Time (BVT) scheduler. For full information on the
506 BVT concept, please consult the base paper listed in the B<SEE ALSO>
507 section.
509 Set Borrowed Virtual Time (BVT) scheduler parameters. There are five
510 required parameters, which are given in order below.
512 FIXME: what units are all the BVT params in?
516 =over 4
518 =item I<mcuadv>
520 The MCU (Minimum Charging Unit) advance determines the proportional
521 share of the CPU that a domain receives. It is set inversely
522 proportionally to a domain's sharing weight.
524 =item I<warpback>
526 The amount of `virtual time' the domain is allowed to warp backwards.
528 =item I<warpvalue>
530 Warp value (FIXME: what does this really mean?)
532 =item I<warpl>
534 The warp limit is the maximum time a domain can run warped for.
536 =item I<warpu>
538 The unwarp requirement is the minimum time a domain must run unwarped
539 for before it can warp again.
541 =back
543 =item B<sched-bvt-ctxallow> I<allow>
545 Sets the BVT scheduler's context switch allowance.
547 The context switch allowance is similar to the ``quantum'' in
548 traditional schedulers. It is the minimum time that a scheduled domain
549 will be allowed to run before being preempted.
551 =item B<sched-sedf> I<period> I<slice> I<latency-hint> I<extratime> I<weight>
553 Set Simple EDF (Earliest Deadline First) scheduler parameters. This
554 scheduler provides weighted CPU sharing in an intuitive way and uses
555 realtime-algorithms to ensure time guarantees. For more information
556 see docs/misc/sedf_scheduler_mini-HOWTO.txt in the Xen distribution.
560 =over 4
562 =item I<period>
564 The normal EDF scheduling usage in nanosecs
566 =item I<slice>
568 The normal EDF scheduling usage in nanosecs
570 FIXME: these are lame, should explain more.
572 =item I<latency-hint>
574 Scaled period if domain is doing heavy I/O.
576 =item I<extratime>
578 Flag for allowing domain to run in extra time.
580 =item I<weight>
582 Another way of setting cpu slice.
584 =back
588 I<normal EDF (20ms/5ms):>
590 xm sched-sedf <dom-id> 20000000 5000000 0 0 0
592 I<best-effort domains (i.e. non-realtime):>
594 xm sched-sedf <dom-id> 20000000 0 0 1 0
596 I<normal EDF (20ms/5ms) + share of extra-time:>
598 xm sched-sedf <dom-id> 20000000 5000000 0 1 0
600 I<4 domains with weights 2:3:4:2>
602 xm sched-sedf <d1> 0 0 0 0 2
603   xm sched-sedf <d2> 0 0 0 0 3
604   xm sched-sedf <d3> 0 0 0 0 4
605   xm sched-sedf <d4> 0 0 0 0 2
607 I<1 fully-specified (10ms/3ms) domain, 3 other domains share available
608 rest in 2:7:3 ratio:>
610 xm sched-sedf <d1> 10000000 3000000 0 0 0  
611 xm sched-sedf <d2> 0 0 0 0 2  
612 xm sched-sedf <d3> 0 0 0 0 7
613   xm sched-sedf <d4> 0 0 0 0 3
615 =back
619 Most virtual devices can be added and removed while guests are
620 running. The effect to the guest OS is much the same as any hotplug
621 event.
623 =head2 BLOCK DEVICES
625 =over 4
627 =item B<block-attach> I<domain-id> I<be-dev> I<fe-dev> I<mode> I<[bedomain-id]>
629 Create a new virtual block device. This will trigger a hotplug event
630 for the guest.
634 =over 4
636 =item I<domain-id>
638 The domain id of the guest domain that the device will be attached to.
640 =item I<be-dev>
642 The device in the backend domain (usually domain 0) to be exported.
643 This can be specified as a physical partition (phy:sda7) or as a file
644 mounted as loopback (file://path/to/loop.iso).
646 =item I<fe-dev>
648 How the device should be presented to the guest domain. It can be
649 specified as either a symbolic name, such as /dev/hdc, for common
650 devices, or by device id, such as 0x1400 (/dev/hdc device id in hex).
652 =item I<mode>
654 The access mode for the device from the guest domain. Supported modes
655 are I<rw> (read/write) or I<ro> (read-only).
657 =item I<bedomain-id>
659 The back end domain hosting the device. This defaults to domain 0.
661 =back
665 =over 4
667 =item I<Mount an ISO as a Disk>
669 xm block-attach guestdomain file://path/to/dsl-2.0RC2.iso /dev/hdc ro
671 This will mount the dsl iso as /dev/hdc in the guestdomain as a read
672 only device. This will probably not be detected as a cdrom by the
673 guest, but mounting /dev/hdc manually will work.
675 =back
677 =item B<block-detach> I<domain-id> I<devid>
679 Destroy a domain's virtual block device. devid B<must> be the device
680 id given to the device by domain 0. You will need to run I<xm
681 block-list> to determine that number.
683 FIXME: this is currently B<broken>. Even though a block device is
684 removed from domU, it appears to still be allocated in the domain 0.
686 =item B<block-list> I<[-l|--long]> I<domain-id>
688 List virtual block devices for a domain. The returned output is
689 formatted as a list or as an S-Expression if the '--long' option was given.
693 =item B<network-attach> I<domain-id> I<[script=scriptname]> I<[ip=ipaddr]>
694 I<[mac=macaddr]> I<[bridge=bridge-name]> I<[backend=bedomain-id]>
696 Creates a new network device in the domain specified by domain-id. It
697 takes the following optional options:
701 =over 4
703 =item I<script=scriptname>
705 Use the specified script name to bring up the network. Defaults to
706 the default setting in xend-config.sxp for I<vif-script>.
708 =item I<ip=ipaddr>
710 Passes the specified IP Address to the adapter on creation.
712 FIXME: this currently appears to be B<broken>. I'm not sure under what
713 circumstances this should actually work.
715 =item I<mac=macaddr>
717 The MAC address that the domain will see on its ethernet device. If
718 the device is not specified it will be randomly generated with the
719 00:16:3e vendor id prefix.
721 =item I<bridge=bridge-name>
723 The name of the bridge to attach the vif to, in case you have more
724 than one. This defaults to
726 =item I<backend=bedomain-id>
728 The backend domain id. By default this is domain 0.
730 =back
732 =item B<network-detach> I<domain-id> I<devid>
734 Removes the network device from the domain specified by I<domain-id>.
735 I<devid> is the virtual interface device number within the domain
736 (i.e. the 3 in vif22.3).
738 FIXME: this is currently B<broken>. Network devices aren't completely
739 removed from domain 0.
741 =item B<network-list> I<[-l|--long]> I<domain-id>
743 List virtual network interfaces for a domain. The returned output is
744 formatted as a list or as an S-Expression if the '--long' option was given.
748 =item B<vtpm-list> I<[-l|--long]> I<domain-id>
750 Show the virtual TPM device for a domain. The returned output is
751 formatted as a list or as an S-Expression if the '--long' option was given.
753 =back
755 =head1 VNET COMMANDS
757 The Virtual Network interfaces for Xen.
759 FIXME: This needs a lot more explaination, or it needs to be ripped
760 out entirely.
762 =over 4
764 =item B<vnet-list> I<[-l|--long]>
766 List vnets.
768 =item B<vnet-create> I<config>
770 Create a vnet from a config file.
772 =item B<vnet-delete> I<vnetid>
774 Delete a vnet.
776 =back
778 =head1 EXAMPLES
780 =head1 SEE ALSO
782 B<xmdomain.cfg>(5), B<xentop>(1)
784 BVT scheduling paper: K.J. Duda and D.R. Cheriton. Borrowed Virtual
785 Time (BVT) scheduling: supporting latency-sensitive threads in a
786 general purpose scheduler. In proceedings of the 17th ACM SIGOPS
787 Symposium on Operating Systems principles, volume 33(5) of ACM
788 Operating Systems Review, pages 261-267
790 =head1 AUTHOR
792 Sean Dague <sean at dague dot net>
793 Daniel Stekloff <dsteklof at us dot ibm dot com>
795 =head1 BUGS