~ubuntu-branches/ubuntu/maverick/libvirt/maverick

« back to all changes in this revision

Viewing changes to virsh.1

Tags: upstream-0.6.4
Import upstream version 0.6.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
 
1
.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.07)
2
2
.\"
3
3
.\" Standard preamble:
4
4
.\" ========================================================================
25
25
..
26
26
.\" Set up some character translations and predefined strings.  \*(-- will
27
27
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28
 
.\" double quote, and \*(R" will give a right double quote.  | will give a
29
 
.\" real vertical bar.  \*(C+ will give a nicer C++.  Capital omega is used to
30
 
.\" do unbreakable dashes and therefore won't be available.  \*(C` and \*(C'
31
 
.\" expand to `' in nroff, nothing in troff, for use with C<>.
32
 
.tr \(*W-|\(bv\*(Tr
 
28
.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
 
29
.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
 
30
.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
 
31
.\" nothing in troff, for use with C<>.
 
32
.tr \(*W-
33
33
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34
34
.ie n \{\
35
35
.    ds -- \(*W-
48
48
.    ds R" ''
49
49
'br\}
50
50
.\"
 
51
.\" Escape single quotes in literal strings from groff's Unicode transform.
 
52
.ie \n(.g .ds Aq \(aq
 
53
.el       .ds Aq '
 
54
.\"
51
55
.\" If the F register is turned on, we'll generate index entries on stderr for
52
56
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53
57
.\" entries marked with X<> in POD.  Of course, you'll have to process the
54
58
.\" output yourself in some meaningful fashion.
55
 
.if \nF \{\
 
59
.ie \nF \{\
56
60
.    de IX
57
61
.    tm Index:\\$1\t\\n%\t"\\$2"
58
62
..
59
63
.    nr % 0
60
64
.    rr F
61
65
.\}
62
 
.\"
63
 
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
64
 
.\" way too many mistakes in technical documents.
65
 
.hy 0
66
 
.if n .na
 
66
.el \{\
 
67
.    de IX
 
68
..
 
69
.\}
67
70
.\"
68
71
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69
72
.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
129
132
.\" ========================================================================
130
133
.\"
131
134
.IX Title "VIRSH 1"
132
 
.TH VIRSH 1 "2008-04-15" "perl v5.8.8" "Virtualization Support"
 
135
.TH VIRSH 1 "2009-04-16" "libvirt-0.6.2" "Virtualization Support"
 
136
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 
137
.\" way too many mistakes in technical documents.
 
138
.if n .ad l
 
139
.nh
133
140
.SH "NAME"
134
141
virsh \- management user interface
135
142
.SH "SYNOPSIS"
144
151
The basic structure of most virsh usage is:
145
152
.PP
146
153
.Vb 1
147
 
\&  virsh <command> <domain-id> [OPTIONS]
 
154
\&  virsh <command> <domain\-id> [OPTIONS]
148
155
.Ve
149
156
.PP
150
157
Where \fIcommand\fR is one of the commands listed below, \fIdomain-id\fR
164
171
.IX Header "NOTES"
165
172
All \fBvirsh\fR operations rely upon the libvirt library.
166
173
For any virsh commands to run xend/qemu, or what ever virtual library that libvirt supports.  For this reason you should start xend/qemu as a service when your system first boots using xen/qemu. This can usually be done using the command
167
 
\&\fBservice start libvirtd\fR .
 
174
\&\fBservice libvirtd start\fR .
168
175
.PP
169
176
Most \fBvirsh\fR commands require root privileges to run due to the
170
177
communications channels used to talk to the hypervisor.  Running as
222
229
allow to connect locally as root to the daemon supervising QEmu and \s-1KVM\s0 domains
223
230
.IP "qemu:///session" 4
224
231
.IX Item "qemu:///session"
225
 
allow to connect locally as a normal user to the his own set of QEmu and \s-1KVM\s0 domains
 
232
allow to connect locally as a normal user to his own set of QEmu and \s-1KVM\s0 domains
226
233
.RE
227
234
.RS 4
228
235
.Sp
261
268
\&\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
262
269
.Sp
263
270
.Vb 2
264
 
\&  0 Domain-0             running
 
271
\&  0 Domain\-0             running
265
272
\&  2 fedora               paused
266
273
.Ve
267
274
.Sp
268
275
Name is the name of the domain.  \s-1ID\s0 the domain numeric id.
269
 
 State is the run state (see below).
270
 
.IP "\fBfreecell\fR optional \fIcellno\fR" 4
271
 
.IX Item "freecell optional cellno"
272
 
Prints the available amount of memory on the machine or within a
273
 
\&\s-1NUMA\s0 cell if \fIcellno\fR is provided.
274
 
.RS 4
 
276
State is the run state (see below).
275
277
.Sp
276
 
.RS 4
277
278
\&\fB\s-1STATES\s0\fR
278
279
.Sp
279
 
The State field lists 6 states for a Xen Domain, and which ones the
280
 
current Domain is in.
281
 
.RE
282
 
.IP "\fBr \- running\fR" 4
283
 
.IX Item "r - running"
 
280
The State field lists 6 states for a domain, and which ones the
 
281
current domain is in.
 
282
.RS 4
 
283
.IP "\fBrunning\fR" 4
 
284
.IX Item "running"
284
285
The domain is currently running on a \s-1CPU\s0
285
 
.IP "\fBb \- blocked\fR" 4
286
 
.IX Item "b - blocked"
287
 
The domain is blocked, and not running or runnable.  This can be caused
 
286
.IP "\fBidle\fR" 4
 
287
.IX Item "idle"
 
288
The domain is idle, and not running or runnable.  This can be caused
288
289
because the domain is waiting on \s-1IO\s0 (a traditional wait state) or has
289
290
gone to sleep because there was nothing else for it to do.
290
 
.IP "\fBp \- paused\fR" 4
291
 
.IX Item "p - paused"
 
291
.IP "\fBpaused\fR" 4
 
292
.IX Item "paused"
292
293
The domain has been paused, usually occurring through the administrator
293
 
running \fBxm pause\fR.  When in a paused state the domain will still
 
294
running \fBvirsh suspend\fR.  When in a paused state the domain will still
294
295
consume allocated resources like memory, but will not be eligible for
295
 
scheduling by the Xen hypervisor.
296
 
.IP "\fBs \- shutdown\fR" 4
297
 
.IX Item "s - shutdown"
 
296
scheduling by the hypervisor.
 
297
.IP "\fBshutdown\fR" 4
 
298
.IX Item "shutdown"
298
299
The domain is in the process of shutting down, i.e. the guest operating system
299
300
has been notified and should be in the process of stopping its operations
300
301
gracefully.
301
 
.IP "\fBc \- crashed\fR" 4
302
 
.IX Item "c - crashed"
 
302
.IP "\fBcrashed\fR" 4
 
303
.IX Item "crashed"
303
304
The domain has crashed, which is always a violent ending.  Usually
304
305
this state can only occur if the domain has been configured not to
305
 
restart on crash.  See xmdomain.cfg for more info.
306
 
.IP "\fBd \- dying\fR" 4
307
 
.IX Item "d - dying"
 
306
restart on crash.
 
307
.IP "\fBdying\fR" 4
 
308
.IX Item "dying"
308
309
The domain is in process of dying, but hasn't completely shutdown or
309
310
crashed.
310
311
.RE
311
312
.RS 4
 
313
.RE
 
314
.IP "\fBfreecell\fR optional \fIcellno\fR" 4
 
315
.IX Item "freecell optional cellno"
 
316
Prints the available amount of memory on the machine or within a
 
317
\&\s-1NUMA\s0 cell if \fIcellno\fR is provided.
312
318
.SH "DOMAIN COMMANDS"
313
319
.IX Header "DOMAIN COMMANDS"
314
320
The following commands manipulate domains directly, as stated
324
330
Connect the virtual serial console for the guest.
325
331
.IP "\fBcreate\fR \fI\s-1FILE\s0\fR" 4
326
332
.IX Item "create FILE"
327
 
Create a domain from an \s-1XML\s0 <file> an easy way to create one if you have a pre-existing xen guest created via \fBxm\fR create <\s-1XMLFILE\s0>.
 
333
Create a domain from an \s-1XML\s0 <file>. An easy way to create the \s-1XML\s0 <file> is to use the \fBdumpxml\fR command to obtain the definition of a pre-existing guest.
328
334
.Sp
329
335
\&\fBExample\fR
330
336
.Sp
335
341
but not started.
336
342
.IP "\fBdestroy\fR \fIdomain-id\fR" 4
337
343
.IX Item "destroy domain-id"
338
 
Immediately terminate the domain domain\-id.  This doesn't give the domain
 
344
Immediately terminate the domain domain-id.  This doesn't give the domain
339
345
\&\s-1OS\s0 any chance to react, and it the equivalent of ripping the power
340
346
cord out on a physical machine.  In most cases you will want to use
341
347
the \fBshutdown\fR command instead.
369
375
.IP "\fBdumpxml\fR \fIdomain-id\fR" 4
370
376
.IX Item "dumpxml domain-id"
371
377
Output the domain information as an \s-1XML\s0 dump to stdout, this format can be used by the \fBcreate\fR command.
 
378
.IP "\fBedit\fR \fIdomain-id\fR" 4
 
379
.IX Item "edit domain-id"
 
380
Edit the \s-1XML\s0 configuration file for a domain.
 
381
.Sp
 
382
This is equivalent to:
 
383
 virsh dumpxml domain > domain.xml
 
384
 edit domain.xml
 
385
 virsh define domain.xml
 
386
except that it does some error checking.
 
387
.Sp
 
388
The editor used can be supplied by the \f(CW$EDITOR\fR environment
 
389
variable, or if that is not defined defaults to \f(CW\*(C`vi\*(C'\fR.
372
390
.IP "\fBmigrate\fR optional \fI\-\-live\fR \fIdomain-id\fR \fIdesturi\fR \fImigrateuri\fR" 4
373
391
.IX Item "migrate optional --live domain-id desturi migrateuri"
374
392
Migrate domain to another host.  Add \-\-live for live migration. The \fIdesturi\fR
381
399
executed the reboot action, which may be significantly before the
382
400
domain actually reboots.
383
401
.Sp
384
 
For xen vm the behavior of what happens to a domain when it reboots is set by the
385
 
\&\fIon_reboot\fR parameter of the xmdomain.cfg file when the domain was
386
 
created.
 
402
The exact behavior of a domain when it reboots is set by the
 
403
\&\fIon_reboot\fR parameter in the domain's \s-1XML\s0 definition.
387
404
.IP "\fBrestore\fR \fIstate-file\fR" 4
388
405
.IX Item "restore state-file"
389
406
Restores a domain from an \fBvirsh save\fR state file.  See \fIsave\fR for more info.
397
414
This is roughly equivalent to doing a hibernate on a running computer,
398
415
with all the same limitations.  Open network connections may be
399
416
severed upon restore, as \s-1TCP\s0 timeouts may have expired.
 
417
.IP "\fBschedinfo\fR optional \fI\-\-set\fR \fBparameter=value\fR \fIdomain-id\fR" 4
 
418
.IX Item "schedinfo optional --set parameter=value domain-id"
 
419
.PD 0
400
420
.IP "\fBschedinfo\fR optional \fI\-\-weight\fR \fBnumber\fR optional \fI\-\-cap\fR \fBnumber\fR \fIdomain-id\fR" 4
401
421
.IX Item "schedinfo optional --weight number optional --cap number domain-id"
402
 
Allows to show (and set) the domain scheduler parameters. This is currently
403
 
only defined for \s-1XEN_CREDIT\s0 scheduler, and the optional weight and cap
404
 
arguments allows to set the associated parameters in that scheduler if
405
 
provided.
 
422
.PD
 
423
Allows to show (and set) the domain scheduler parameters.
 
424
.Sp
 
425
\&\fBNote\fR: The weight and cap parameters are defined only for the
 
426
\&\s-1XEN_CREDIT\s0 scheduler and are now \fI\s-1DEPRECATED\s0\fR.
406
427
.IP "\fBsetmem\fR \fIdomain-id\fR \fBkilobytes\fR" 4
407
428
.IX Item "setmem domain-id kilobytes"
408
429
Change the current memory allocation in the guest domain. This should take
431
452
succeed, and may take a variable length of time depending on what
432
453
services must be shutdown in the domain.
433
454
.Sp
434
 
For a xen guest vm the behavior of what happens to a domain when it reboots is set by the
435
 
\&\fIon_shutdown\fR parameter of the xmdomain.cfg file when the domain was
436
 
created.
 
455
The exact behavior of a domain when it shuts down is set by the
 
456
\&\fIon_shutdown\fR parameter in the domain's \s-1XML\s0 definition.
437
457
.IP "\fBstart\fR \fIdomain-name\fR" 4
438
458
.IX Item "start domain-name"
439
459
Start a (previously defined) inactive domain.
466
486
.IX Item "vncdisplay domain-id"
467
487
Output the \s-1IP\s0 address and port number for the \s-1VNC\s0 display. If the information
468
488
is not available the processes will provide an exit code of 1.
469
 
.RE
470
 
.RS 4
471
 
.SH "DEVICES COMMANDS"
472
 
.IX Header "DEVICES COMMANDS"
 
489
.SH "DEVICE COMMANDS"
 
490
.IX Header "DEVICE COMMANDS"
473
491
The following commands manipulate devices associated to domains.
474
492
The domain-id can be specified as an short integer, a name or a full \s-1UUID\s0.
475
493
To better understand the values allowed as options for the command
509
527
\&\fItype\fR can be either \fInetwork\fR to indicate a physical network device or \fIbridge\fR to indicate a bridge to a device.
510
528
It is recommended to use the \fImac\fR option to distinguish between the interfaces
511
529
if more than one are present on the domain.
512
 
.RE
513
 
.RS 4
514
 
.SH "VIRTUAL NETWORKS COMMANDS"
515
 
.IX Header "VIRTUAL NETWORKS COMMANDS"
 
530
.SH "VIRTUAL NETWORK COMMANDS"
 
531
.IX Header "VIRTUAL NETWORK COMMANDS"
516
532
The following commands manipulate networks. Libvirt has the capability to
517
533
define virtual networks which can then be used by domains and linked to
518
534
actual network devices. For more detailed information about this feature
538
554
.IP "\fBnet-dumpxml\fR \fInetwork\fR" 4
539
555
.IX Item "net-dumpxml network"
540
556
Output the virtual network information as an \s-1XML\s0 dump to stdout.
 
557
.IP "\fBnet-edit\fR \fInetwork\fR" 4
 
558
.IX Item "net-edit network"
 
559
Edit the \s-1XML\s0 configuration file for a network.
 
560
.Sp
 
561
This is equivalent to:
 
562
 virsh net-dumpxml network > network.xml
 
563
 edit network.xml
 
564
 virsh define network.xml
 
565
except that it does some error checking.
 
566
.Sp
 
567
The editor used can be supplied by the \f(CW$EDITOR\fR environment
 
568
variable, or if that is not defined defaults to \f(CW\*(C`vi\*(C'\fR.
541
569
.IP "\fBnet-list\fR optional \fI\-\-inactive\fR or \fI\-\-all\fR" 4
542
570
.IX Item "net-list optional --inactive or --all"
543
571
Returns the list of active networks, if \fI\-\-all\fR is specified this will also
555
583
.IP "\fBnet-uuid\fR \fInetwork-name\fR" 4
556
584
.IX Item "net-uuid network-name"
557
585
Convert a network name to network \s-1UUID\s0.
558
 
.RE
559
 
.RS 4
560
586
.SH "ENVIRONMENT"
561
587
.IX Header "ENVIRONMENT"
 
588
The following environment variables can be set to alter the behaviour
 
589
of \f(CW\*(C`virsh\*(C'\fR
562
590
.IP "\s-1VIRSH_DEFAULT_CONNECT_URI\s0" 4
563
591
.IX Item "VIRSH_DEFAULT_CONNECT_URI"
564
592
The hypervisor to connect to by default. Set this to a \s-1URI\s0, in the same
565
593
format as accepted by the \fBconnect\fR option.
566
 
.RE
567
 
.RS 4
568
 
.SH "SEE ALSO"
569
 
.IX Header "SEE ALSO"
570
 
\&\fIxm\fR\|(1), \fIxmdomain.cfg\fR\|(5), \fIxentop\fR\|(1) , <http://www.libvirt.org/>
571
 
.SH "AUTHOR"
572
 
.IX Header "AUTHOR"
 
594
.IP "LIBVIRT_DEBUG=LEVEL" 4
 
595
.IX Item "LIBVIRT_DEBUG=LEVEL"
 
596
Turn on verbose debugging of all libvirt \s-1API\s0 calls. Valid levels are
 
597
.RS 4
 
598
.IP "\(bu" 4
 
599
LIBVIRT_DEBUG=1
 
600
.Sp
 
601
Messages at level \s-1DEBUG\s0 or above
 
602
.IP "\(bu" 4
 
603
LIBVIRT_DEBUG=2
 
604
.Sp
 
605
Messages at level \s-1INFO\s0 or above
 
606
.IP "\(bu" 4
 
607
LIBVIRT_DEBUG=3
 
608
.Sp
 
609
Messages at level \s-1WARNING\s0 or above
 
610
.IP "\(bu" 4
 
611
LIBVIRT_DEBUG=4
 
612
.Sp
 
613
Messages at level \s-1ERROR\s0 or above
 
614
.RE
 
615
.RS 4
 
616
.Sp
 
617
For further information about debugging options consult \f(CW\*(C`http://libvirt.org/logging.html\*(C'\fR
 
618
.RE
 
619
.SH "BUGS"
 
620
.IX Header "BUGS"
 
621
Report any bugs discovered to the libvirt community via the mailing
 
622
list \f(CW\*(C`http://libvirt.org/contact.html\*(C'\fR or bug tracker \f(CW\*(C`http://libvirt.org/bugs.html\*(C'\fR.
 
623
Alternatively report bugs to your software distributor / vendor.
 
624
.SH "AUTHORS"
 
625
.IX Header "AUTHORS"
573
626
.Vb 2
574
627
\&  Andrew Puch <apuch @ redhat.com>
575
628
\&  Daniel Veillard <veillard @ redhat.com>
576
 
.Ve
577
 
.Sp
578
 
.Vb 3
579
 
\&  Based on the xm man paged by
 
629
\&
 
630
\&  Based on the xm man page by:
580
631
\&  Sean Dague <sean at dague dot net>
581
632
\&  Daniel Stekloff <dsteklof at us dot ibm dot com>
582
633
.Ve
583
 
.SH "BUGS"
584
 
.IX Header "BUGS"
585
 
Bugs can be view on the RedHat buzilla page under the libvirt
586
 
<https://bugzilla.redhat.com/>
587
 
.Sp
588
 
<https://bugzilla.redhat.com/bugzilla/buglist.cgi?product=Fedora+Core&component=libvirt&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_status=MODIFIED&short_desc_type=allwordssubstr&short_desc=&long_desc_type=allwordssubstr>
 
634
.SH "COPYRIGHT"
 
635
.IX Header "COPYRIGHT"
 
636
Copyright (C) 2005, 2007\-2009 Red Hat, Inc.
 
637
.SH "LICENSE"
 
638
.IX Header "LICENSE"
 
639
virsh is distributed under the terms of the \s-1GNU\s0 \s-1LGPL\s0 v2+.
 
640
This is free software; see the source for copying conditions. There
 
641
is \s-1NO\s0 warranty; not even for \s-1MERCHANTABILITY\s0 or \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0
 
642
\&\s-1PURPOSE\s0
 
643
.SH "SEE ALSO"
 
644
.IX Header "SEE ALSO"
 
645
\&\fIvirt\-install\fR\|(1), \fIvirt\-xml\-validate\fR\|(1), \fIvirt\-top\fR\|(1), \fIvirt\-mem\fR\|(1), \fIvirt\-df\fR\|(1), <http://www.libvirt.org/>