aboutsummaryrefslogtreecommitdiffstats
path: root/docs/man/xm.pod.1
blob: 442c55f383bf9c911a2853d111f6a0426c2171ae (plain)
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
=head1 NAME

xm - Xen management user interface

=head1 SYNOPSIS

xm <subcommand> [args]

=head1 DESCRIPTION

The B<xm> program is the main interface for managing Xen guest
domains. The program can be used to create, pause, and shutdown
domains. It can also be used to list current domains, enable or pin
VCPUs, and attach or detach virtual block devices.

The basic structure of every xm command is almost always:

  xm <SubCommand> <DomId> [OPTIONS]

Where I<SubCommand> is one of the sub commands listed below, I<DomId>
is the numeric domain id, or the domain name (which will be internally
translated to domain id), and I<OPTIONS> are sub command specific
options.  There are a few exceptions to this rule in the cases where
the sub command in question acts on all domains, the entire machine,
or directly on the xen hypervisor.  Those exceptions will be clear for
each of those sub commands.

=head1 NOTES

All B<xm> opperations rely upon the Xen control daemon, aka B<xend>.
For any xm commands to run xend must also be running.  For this reason
you should start xend as a service when your system first boots using
xen.

Most B<xm> commands require root privledges to run due to the
communications channels used to talk to the hypervisor.  Running as
non root will return an error.

Most B<xm> commands act asynchronously, so just because the B<xm>
command returned, doesn't mean the action is complete.  This is
important, as many operations on domains, like create and shutdown,
can take considerable time (30 seconds or more) to bring the machine
into a fully compliant state.  If you want to know when one of these
actions has finished you must poll through xm list periodically.

=head1 DOMAIN SUBCOMMANDS

The following sub commands manipulate domains directly, as stated
previously most commands take DomId as the first parameter.

=over 4

=item I<console> <DomId>

Attach to domain DomId's console.  If you've set up your Domains to
have a traditional log in console this will look much like a normal
text log in screen.

This uses the back end xenconsole service which currently only
works for para-virtual domains.  

The attached console will perform much like a standard serial console,
so running curses based interfaces over the console B<is not
advised>.  Vi tends to get very odd when using it over this interface.

=item I<create> [-c] <ConfigFile> [Name=Value]..

The create sub command requires a ConfigFile and can optional take a
series of name value pairs that add to or override variables defined
in the config file.  See L<xmdomain.cfg> for full details of that file
format, and possible options used in either the ConfigFile or
Name=Value combinations.

ConfigFile can either be an absolute path to a file, or a relative
path to a file located in /etc/xen.

Create will return B<as soon> as the domain is started.  This B<does
not> mean the guest OS in the domain has actually booted, or is
available for input.

B<OPTIONS>

=over 4 

=item I<-c>

Attache console to the domain as soon as it has started.  This is
useful for determining issues with crashing domains.

=back

B<EXAMPLES>

=over 4

=item I<with config file>

  xm create Fedora4

This creates a domain with the file /etc/xen/Fedora4, and returns as
soon as it is run.

=item I<without config file>
 
  xm create /dev/null ramdisk=initrd.img \
     kernel=/boot/vmlinuz-2.6.12.6-xenU \
     name=ramdisk nics=0 vcpus=1 \
     memory=64 root=/dev/ram0

This creates the domain without using a config file (more specifically
using /dev/null as an empty config file), kernel and ramdisk as
specified, setting the name of the domain to "ramdisk", also disabling
virtual networking.  (This example comes from the xm-test test suite.)

=back

=item I<destroy> <DomId>

Immediately terminate the domain DomId.  This doesn't give the domain
OS any chance to react, and it the equivalent of ripping the power
cord out on a physical machine.  In most cases you will want to use
the B<shutdown> command instead.

=item I<domid> <DomName>

Converts a domain name to a domain id using xend's internal mapping.

=item I<domname> <DomId>

Converts a domain id to a domain name using xend's internal mapping.

=item I<help> [--long]

Displays the short help message (i.e. common commands).

The I<--long> option prints out the complete set of B<xm> subcommands,
grouped by function.

=item I<list> [--long] [DomId, ...]

Prints information about one or more domains.  If no domains are
specified it prints out information about all domains.

An example format for the list is as follows:

 Name                              ID Mem(MiB) VCPUs State  Time(s)
 Domain-0                           0       98     1 r-----  5068.6
 Fedora3                          164      128     1 r-----     7.6
 Fedora4                          165      128     1 ------     0.6
 Mandrake2006                     166      128     1 -b----     3.6
 Mandrake10.2                     167      128     1 ------     2.5
 Suse9.2                          168      100     1 ------     1.8

Name is the name of the domain.  ID the domain numeric id.  Mem is the
size of the memory allocated to the domain.  VCPUS is the number of
VCPUS allocated to domain.  State is the run state (see below).  Time
is the total run time of the domain as accounted for by Xen.

B<STATES>

=over 4

The State field lists 6 states for a Xen Domain, and which ones the
current Domain is in.

=item I<r - running>

The domain is currently running on a CPU

=item I<b - blocked>

The domain is blocked, and not running or runable.  This can be caused
because the domain is waiting on IO (a traditional wait state) or has
gone to sleep because there was nothing else for it to do.

=item I<p - paused>

The domain has been paused, usually occurring through the administrator
running B<xm pause>.  When in a paused state the domain will still
consume allocated resources like memory, but will not be eligible for
scheduling by the Xen hypervisor.

=item I<s - shutdown>

FIXME: Why would you ever see this state?

=item I<c - crashed>

The domain has crashed, which is always a violent ending.  Usually
this state can only occur if the domain has been configured not to
restart on crash.  See L<xmdomain.cfg> for more info.

=item I<d - dying>

The domain is in process of dying, but hasn't completely shutdown or
crashed.

FIXME: Is this right?

=back

B<LONG OUTPUT>

=over 4

If I<--long> is specified, the output for xm list is not the table
view shown above, but instead is an S-Expression representing all
information known about all domains asked for.  This is mostly only
useful for external programs to parse the data.

B<Note:> there is no stable guarantees on the format of this data.
Use at your own risk.

=back

B<NOTES>

=over 4

The Time column is deceptive.  Virtual IO (network and block devices)
used by Domains requires coordination by Domain0, which means that
Domain0 is actually charged for much of the time that a DomainU is
doing IO.  Use of this time value to determine relative utilizations
by domains is thus very suspect, as a high IO workload may show as
less utilized than a high CPU workload.  Consider yourself warned.

=back

=item I<mem-max> <DomId> <Mem>

Specify the maximum amount of memory the Domain is able to use.  Mem
is specified in megabytes. 

The mem-max value may not correspond to the actual memory used in the
Domain, as it may balloon down it's memory to give more back to the OS.

=item I<mem-set> <DomId> <Mem>

Set the domain's used memory using the balloon driver.  Because this
operation requires cooperation from the domain operating system, there
is no guarantee that it will succeed.

B<Warning:> there is no good way to know in advance how small of a
mem-set will make a domain unstable and cause it to crash.  Be very
careful when using this command on running domains.

=item I<migrate> <DomId> <Host> [Options]

Migrate a domain to another Host machine. B<Xend> must be running on
other host machine, it must be running the same version of xen, it
must have the migration tcp port open and accepting connections from
the source host, and there must be sufficient resources for the domain
to run (memory, disk, etc).

Migration is pretty complicated, and has many security implications,
please read the Xen Users Guide to ensure you understand the
ramifications and limitations on migration before attempting it in
production.

B<OPTIONS>

=over 4

=item I<-l, --live>

Use live migration.  This will migrate the domain between hosts
without shutting down the domain.  See the Xen Users Guide for more
information.

=item I<-r, --resource> Mbs

Set maximum Mbs allowed for migrating the domain.  This ensures that
the network link is not saturated with migration traffic while
attempting to do other useful work.

=back

=item I<pause> <DomId>

Pause a domain.  When in a paused state the domain will still consume
allocated resources like memory, but will not be eligible for
scheduling by the Xen hypervisor.

=item I<reboot> [Options] <DomId>

Reboot a domain.  This acts just as if the domain had the B<reboot>
command run from the console.  The command returns as soon as it has
executed the reboot action, which may be significantly before the
domain actually reboots.

The behavior of what happens to a domain when it reboots is set by the
B<on_reboot> parameter of the xmdomain.cfg file when the domain was
created.

B<OPTIONS>

=over 4

=item I<-a, --all>

Reboot all domains

=item I<-w, --wait>

Wait for reboot to complete before returning.  This may take a while,
as all services in the domain will have to be shut down cleanly.

=back

=item I<restore> <File>

Create a domain from saved state File.

=item I<save> <DomId> <File>

Save domain state to File. Saves domain configuration to File as well.

=item I<shutdown> [Options] <DomId>

Shutdown a domain.

=over 4

Additional Options:

    -a, --all        Shutdown all domains.
    -H, --halt       Shutdown domain without reboot.
    -R, --reboot     Shutdown and reboot domain.
    -w, --wait       Wait for shutdown to complete.

=back

=item I<sysrq> <DomId> <letter>

Send a sysrq to a domain.

=item I<unpause> <DomId>

Unpause a paused domain.

=item I<set-vcpus> <DomId> <VCPUs>

Enable a specific number of VCPUs for a domain. Subcommand only enables or disables already configured VCPUs for domain.

=item I<vpcu-list> [DomID]

Lists VCPU information for a specific domain or all domains if DomID not given.

=item I<vcpu-pin> <DomId> <VCPU> <CPUs>

Sets VCPU to only run on specific CPUs.

=back

=head1 XEN HOST SUBCOMMANDS

=over 4

=item I<dmesg> [OPTION]

Read or clear Xen's message buffer. The buffer contains Xen boot, warning, and error messages.

=over 4

Additional Option:

    -c, --clear        Clears Xen's message buffer.

=back

=item I<info>

Get information about Xen host.

=item I<log>

Print B<xend> log.

=item I<top>

Monitor system and domains in real-time.

=back

=head1 SCHEDULER SUBCOMMANDS

=over 4

=item I<sched-bvt> <Parameters>

Set Borrowed Virtual Time (BVT) scheduler parameters. There are five parameters, which are given in order below.

=over 4

Parameters:

    mcuadv - Minimum Charging Unit (MCU) advance.
    warpback - Warp back time allowed.
    warpvalue - Warp value.
    warpl - Warp maximum limit.
    warpu - Unwarped minimum limit.

=back 

=item I<sched-bvt-ctxallow> <Allow>

Sets the BVT scheduler's context switch allowance. Allow is the minimum time slice allowed to run before being pre-empted.

=item I<sched-sedf> <Parameters>

Set simple sEDF scheduler parameters. Use the following parametersin order.

=over 4

Parameters:

    period - in nanoseconds
    slice - in nanoseconds
    latency-hint - scaled period if domain is doing heavy I/O
    extratime - flag for allowing domain to run in extra time.
    weight - another way of setting cpu slice.

=back

=back

=head1 VIRTUAL DEVICE COMMANDS

=over 4

=item I<block-attach <DomId> <BackDev> <FrontDev> <Mode> [BackDomId]

Create a new virtual block device.

=item I<block-detach> <DomId> <DevId>

Destroy a domain's virtual block device. DevId may either be a device ID or the device name as mounted in the guest.

=item I<block-list> <DomId>

List virtual block devices for a domain.

=item I<network-limit> <DomId> <Vif> <Credit> <Period>

Limit the transmission rate of a virtual network interface.

=item I<network-list> <DomId>

List virtual network interfaces for a domain.

=back

=head1 VNET COMMANDS

The Virtual Network interfaces for Xen 

=over 4

=item I<vnet-list> [-l|--long]

List vnets.

=item I<vnet-create> <config>

Create a vnet from a config file.

=item I<vnet-delete> <vnetid>

Delete a vnet.

=back

=head1 EXAMPLES

=head1 SEE ALSO

B<xmdomain.cfg>(5)

=head1 AUTHOR

  Sean Dague <sean at dague dot net>
  Daniel Stekloff <dsteklof at us dot ibm dot com>

=head1 BUGS