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<>.
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<>.
33
33
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
51
.\" Escape single quotes in literal strings from groff's Unicode transform.
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.
57
61
. tm Index:\\$1\t\\n%\t"\\$2"
63
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
64
.\" way too many mistakes in technical documents.
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
.\" ========================================================================
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.
134
141
virsh \- management user interface
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 .
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
261
268
\&\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
264
\& 0 Domain-0 running
271
\& 0 Domain\-0 running
265
272
\& 2 fedora paused
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.
276
State is the run state (see below).
277
278
\&\fB\s-1STATES\s0\fR
279
The State field lists 6 states for a Xen Domain, and which ones the
280
current Domain is in.
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.
283
.IP "\fBrunning\fR" 4
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
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"
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
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
301
.IP "\fBc \- crashed\fR" 4
302
.IX Item "c - crashed"
302
.IP "\fBcrashed\fR" 4
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
308
309
The domain is in process of dying, but hasn't completely shutdown or
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
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.
382
This is equivalent to:
383
virsh dumpxml domain > domain.xml
385
virsh define domain.xml
386
except that it does some error checking.
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.
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
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"
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
423
Allows to show (and set) the domain scheduler parameters.
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.
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
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.
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.
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.
561
This is equivalent to:
562
virsh net-dumpxml network > network.xml
564
virsh define network.xml
565
except that it does some error checking.
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.
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.
569
.IX Header "SEE ALSO"
570
\&\fIxm\fR\|(1), \fIxmdomain.cfg\fR\|(5), \fIxentop\fR\|(1) , <http://www.libvirt.org/>
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
601
Messages at level \s-1DEBUG\s0 or above
605
Messages at level \s-1INFO\s0 or above
609
Messages at level \s-1WARNING\s0 or above
613
Messages at level \s-1ERROR\s0 or above
617
For further information about debugging options consult \f(CW\*(C`http://libvirt.org/logging.html\*(C'\fR
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.
574
627
\& Andrew Puch <apuch @ redhat.com>
575
628
\& Daniel Veillard <veillard @ redhat.com>
579
\& Based on the xm man paged by
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>
585
Bugs can be view on the RedHat buzilla page under the libvirt
586
<https://bugzilla.redhat.com/>
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>
635
.IX Header "COPYRIGHT"
636
Copyright (C) 2005, 2007\-2009 Red Hat, Inc.
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
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/>