2006-04-10 14:15:33 +00:00
. \" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
. \"
. \" Standard preamble:
. \" ========================================================================
.de Sh \" Subsection heading
.br
.if t .Sp
.ne 5
.PP
\fB \\ $1\fR
.PP
. .
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
. .
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\ $1
. .
.de Ve \" End verbatim text
.ft R
.fi
. .
. \" Set up some character translations and predefined strings. \*(-- will
. \" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
. \" double quote, and \*(R" will give a right double quote. | will give a
. \" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
. \" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
. \" expand to `' in nroff, nothing in troff, for use with C<>.
.tr \(*W -|\(bv\*(Tr
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
.ie n \{ \
. ds -- \(*W -
. ds PI pi
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W \h '-12u'\(*W\h'-12u'-\" diablo 10 pitch
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W \h '-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
. ds C` ""
. ds C' ""
'br\}
.el \{ \
. ds -- \| \(em \|
. ds PI \(*p
. ds L" ``
. ds R" ''
'br\}
. \"
. \" If the F register is turned on, we'll generate index entries on stderr for
. \" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
. \" entries marked with X<> in POD. Of course, you'll have to process the
. \" output yourself in some meaningful fashion.
.if \nF \{ \
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
. .
. nr % 0
. rr F
. \}
. \"
. \" For nroff, turn off justification. Always turn off hyphenation; it makes
. \" way too many mistakes in technical documents.
.hy 0
.if n .na
. \"
. \" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
. \" Fear. Run. Save yourself. No user-serviceable parts.
. \" fudge factors for nroff and troff
.if n \{ \
. ds #H 0
. ds #V .8m
. ds #F .3m
. ds #[ \f1
. ds #] \fP
. \}
.if t \{ \
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
. ds #V .6m
. ds #F 0
. ds #[ \&
. ds #] \&
. \}
. \" simple accents for nroff and troff
.if n \{ \
. ds ' \&
. ds ` \&
. ds ^ \&
. ds , \&
. ds ~ ~
. ds /
. \}
.if t \{ \
. ds ' \\ k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
. ds ` \\ k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
. ds ^ \\ k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
. ds , \\ k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
. ds ~ \\ k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
. ds / \\ k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
. \}
. \" troff and (daisy-wheel) nroff accents
.ds : \\ k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
.ds 8 \h '\*(#H'\(*b\h'-\*(#H'
.ds o \\ k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
.ds d- \h '\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
.ds th \* (#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
.ds Th \* (#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
.ds ae a\h'-(\w'a'u*4/10)'e
.ds Ae A\h'-(\w'A'u*4/10)'E
. \" corrections for vroff
.if v .ds ~ \\ k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
.if v .ds ^ \\ k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
. \" for low resolution devices (crt and lpr)
.if \n (.H>23 .if \n (.V>19 \
\{ \
. ds : e
. ds 8 ss
. ds o a
. ds d- d\h'-1'\(ga
. ds D- D\h'-1'\(hy
. ds th \o 'bp'
. ds Th \o 'LP'
. ds ae ae
. ds Ae AE
. \}
.rm #[ #] #H #V #F C
. \" ========================================================================
. \"
.IX Title "VIRSH.POD.1 1"
.TH VIRSH.POD.1 1 "2006-04-06" "perl v5.8.6" "User Contributed Perl Documentation"
.SH "NAME"
virsh \- management user interface
.SH "SYNOPSIS"
.IX Header "SYNOPSIS"
virsh <subcommand> [args]
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
The \fB virsh\fR program is the main interface for managing virsh guest
2006-05-22 14:38:33 +00:00
domains. The program can be used to create, suspend, resume, save, and shutdown
2006-10-11 15:18:31 +00:00
domains. It can also be used to list current domains. Libvirt is a C toolkit to interact with the virtualization capabilities of recent versions of Linux (and other OSes). It is free software available under the \s -1GNU\s 0 Lesser General Public License. Virtualization of the Linux Operating System means the ability to run multiple instances of Operating Systems concurrently on a single hardware system where the basic resources are driven by a Linux instance. The library aim at providing long term stable C \s -1API\s 0 initially for the Xen paravirtualization but should be able to integrate other virtualization mechanisms if needed.
2006-04-10 14:15:33 +00:00
.PP
The basic structure of every virsh command is almost always:
.PP
.Vb 1
2006-05-22 14:38:33 +00:00
\& virsh <subcommand> <domain-id|name|uuid> [OPTIONS]
2006-04-10 14:15:33 +00:00
.Ve
.PP
Where \fI subcommand\fR is one of the sub commands listed below, \fI domain-id\fR
is the numeric domain id, or the domain name (which will be internally
translated to domain id), and \fI \s -1OPTIONS\s 0\fR 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,
2006-10-11 15:18:31 +00:00
or directly on the xen hypervisor. Those exceptions will be explained for
2006-04-10 14:15:33 +00:00
each of those sub commands.
.SH "NOTES"
.IX Header "NOTES"
2006-10-11 15:18:31 +00:00
All \fB virsh\fR operations rely upon the libvirt library.
So any virsh commands may require to run xend or qemu (or which ever virtualization layer that libvirt will use). For this reason you should start xend or qemu as a service when your system first boots.
2006-04-10 14:15:33 +00:00
.PP
Most \fB virsh\fR 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.
.PP
Most \fB virsh\fR commands act asynchronously, so just because the \fB virsh\fR
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 virsh list periodically.
.SH "DOMAIN SUBCOMMANDS"
.IX Header "DOMAIN SUBCOMMANDS"
The following sub commands manipulate domains directly, as stated
previously most commands take domain-id as the first parameter.
.IP "\fBconnect\fR optional \fI\-\-readonly\fR" 4
.IX Item "connect optional --readonly"
Connect to local hypervisor. This is build-in command after shell start up.
.Sp
The \fI \- \- readonly\fR option read-only connection
.IP "\fBcreate\fR \fI\s-1FILE\s0\fR" 4
.IX Item "create FILE"
Create a domain from an \s -1XML\s 0 <file> an easy way to create one if you have a pre-existing xen guest created via \fB xm\fR create <\s -1XMLFILE\s 0>.
2006-05-22 14:38:33 +00:00
.IP "\fBdumpxml\fR \fIdomain-name, id or uuid\fR" 4
.IX Item "dumpxml domain-name, id or uuid"
2006-04-10 14:15:33 +00:00
Ouput the domain informations as an \s -1XML\s 0 dump to stdout, this format can be used by the create sub command.
2006-05-22 14:38:33 +00:00
.IP "\fBdestroy\fR \fIdomain-name, id or uuid\fR" 4
.IX Item "destroy domain-name, id or uuid"
2006-04-10 14:15:33 +00:00
Immediately terminate the domain domain\- id. This doesn't give the domain
2006-10-11 15:18:31 +00:00
\& \s -1OS\s 0 any chance to react, and it is the equivalent of ripping the power
2006-04-10 14:15:33 +00:00
cord out on a physical machine. In most cases you will want to use
the \fB shutdown\fR command instead.
.IP "\fBdomid\fR \fIdomain-name\fR" 4
.IX Item "domid domain-name"
Converts a domain name to a domain id using xend's internal mapping.
2006-05-22 14:38:33 +00:00
.IP "\fBdominfo\fR \fIdomain-name, id or uuid\fR" 4
.IX Item "dominfo domain-name, id or uuid"
2006-04-10 14:15:33 +00:00
Returns basic information about the domain.
.IP "\fBdomname\fR \fIdomain-id\fR" 4
.IX Item "domname domain-id"
convert a domain Id to domain name
2006-05-22 14:38:33 +00:00
.IP "\fBdomstate\fR \fIdomain-name, id or uuid\fR" 4
.IX Item "domstate domain-name, id or uuid"
2006-04-10 14:15:33 +00:00
Returns state about a running domain.
.IP "\fBhelp\fR optional \fIsubcommand\fR" 4
.IX Item "help optional subcommand"
Displays the short help message (i.e. common commands).
.Sp
\& \fB help\fR \fI subcommand\fR will print out a detailed help message on that sub command
.IP "\fBlist\fR" 4
.IX Item "list"
Prints information about one or more domains. If no domains are
specified it prints out information about all domains.
.Sp
An example format for the list is as follows:
.Sp
\& \fB virsh\fR list
Id Name State
.Sp
\& \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \-
.Sp
.Vb 2
\& 0 Domain-0 running
\& 2 fedora paused
.Ve
.Sp
Name is the name of the domain. \s -1ID\s 0 the domain numeric id.
State is the run state (see below).
.RS 4
.Sp
.RS 4
\& \fB \s -1STATES\s 0\fR
.Sp
The State field lists 6 states for a Xen Domain, and which ones the
current Domain is in.
=back
.RE
2006-05-22 14:38:33 +00:00
.IP "\fBrunning\fR" 4
.IX Item "running"
2006-04-10 14:15:33 +00:00
The domain is currently running on a \s -1CPU\s 0
2006-05-22 14:38:33 +00:00
.IP "\fBblocked\fR" 4
.IX Item "blocked"
2006-04-10 14:15:33 +00:00
The domain is blocked, and not running or runable. This can be caused
because the domain is waiting on \s -1IO\s 0 (a traditional wait state) or has
gone to sleep because there was nothing else for it to do.
2006-05-22 14:38:33 +00:00
.IP "\fBpaused\fR" 4
.IX Item "paused"
2006-04-10 14:15:33 +00:00
The domain has been paused, usually occurring through the administrator
2006-05-22 14:38:33 +00:00
running \fB virsh suspend\fR . When in a suspend state the domain will still
2006-04-10 14:15:33 +00:00
consume allocated resources like memory, but will not be eligible for
scheduling by the Xen hypervisor.
2006-05-22 14:38:33 +00:00
.IP "\fBin shutdown\fR" 4
.IX Item "in shutdown"
The domain is in process of dying, but hasn't completely shutdown or
crashed.
.IP "\fBshut off\fR" 4
.IX Item "shut off"
The domain is down.
.IP "\fBcrashed\fR" 4
.IX Item "crashed"
2006-04-10 14:15:33 +00:00
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 xmdomain.cfg for more info.
.RE
.RS 4
.RE
2006-05-22 14:38:33 +00:00
.IP "\fBnodeinfo\fR \fIdomain-name, id or uuid\fR" 4
.IX Item "nodeinfo domain-name, id or uuid"
2006-04-10 14:15:33 +00:00
Returns basic information about the node.
.IP "\fBquit\fR" 4
.IX Item "quit"
quit this interactive terminal
2006-05-22 14:38:33 +00:00
.IP "\fBreboot\fR \fIdomain-name, id or uuid\fR" 4
.IX Item "reboot domain-name, id or uuid"
2006-04-10 14:15:33 +00:00
Reboot a domain. This acts just as if the domain had the \fB reboot\fR
command run from the console. The command returns as soon as it has
2006-10-11 15:18:31 +00:00
started the reboot action, but it may take significantly longuer before
the domain actually reboots.
2006-04-10 14:15:33 +00:00
.Sp
For xen vm the behavior of what happens to a domain when it reboots is set by the
\& \fI on_reboot\fR parameter of the xmdomain.cfg file when the domain was
created.
.IP "\fBrestore\fR \fIstate-file\fR" 4
.IX Item "restore state-file"
Restores a domain from an \fB virsh save\fR state file. See \fI save\fR for more info.
2006-05-22 14:38:33 +00:00
.IP "\fBsave\fR \fIdomain-name, id or uuid\fR \fIstate-file\fR" 4
.IX Item "save domain-name, id or uuid state-file"
2006-04-10 14:15:33 +00:00
Saves a running domain to a state file so that it can be restored
later. Once saved, the domain will no longer be running on the
system, thus the memory allocated for the domain will be free for
other domains to use. \fB virsh restore\fR restores from this state file.
.Sp
This is roughly equivalent to doing a hibernate on a running computer,
with all the same limitations. Open network connections may be
severed upon restore, as \s -1TCP\s 0 timeouts may have expired.
2006-05-22 14:38:33 +00:00
.IP "\fBshutdown\fR \fIdomain-name, id or uuid\fR" 4
.IX Item "shutdown domain-name, id or uuid"
2006-04-10 14:15:33 +00:00
Gracefully shuts down a domain. This coordinates with the domain \s -1OS\s 0
to perform graceful shutdown, so there is no guaruntee that it will
succeed, and may take a variable length of time depending on what
services must be shutdown in the domain.
.Sp
For a xen guest vm the behavior of what happens to a domain when it reboots is set by the
\& \fI on_shutdown\fR parameter of the xmdomain.cfg file when the domain was
created.
2006-05-22 14:38:33 +00:00
.IP "\fBsuspend\fR \fIdomain-name, id or uuid\fR" 4
.IX Item "suspend domain-name, id or uuid"
Suspend a domain. When in a suspened state the domain will still consume allocated resources
such as memory, but will not be eligible for scheduling by the Xen hypervisor.
.IP "\fBresume\fR \fIdomain-name, id or uuid\fR" 4
.IX Item "resume domain-name, id or uuid"
2006-04-10 14:15:33 +00:00
Moves a domain out of the paused state. This will allow a previously
paused domain to now be eligible for scheduling by the the under lying hypervisor.
.IP "\fBversion\fR" 4
.IX Item "version"
Will print out the major version info about what this built from.
.RS 4
.Sp
.RS 4
\& \fB virsh\fR version
.Sp
Compiled against library: libvir 0.0.6
.Sp
Using library: libvir 0.0.6
.Sp
Using \s -1API:\s 0 Xen 3.0.0
.Sp
Running hypervisor: Xen 3.0.0
.RE
.RE
.RS 4
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\& \fI xm\fR \| (1), \fI xmdomain.cfg\fR \| (5), \fI xentop\fR \| (1) , <http://www.libvirt.org<sol>>
.SH "AUTHOR"
.IX Header "AUTHOR"
.Vb 2
\& Andrew Puch <apuch @ redhat.com>
\& Daniel Veillard <veillard @ redhat.com>
2006-05-22 14:38:33 +00:00
\& Karel Zak <kzak @ redhat.com>
2006-04-10 14:15:33 +00:00
.Ve
.Sp
.Vb 3
\& Based on the xm man paged by
\& Sean Dague <sean at dague dot net>
\& Daniel Stekloff <dsteklof at us dot ibm dot com>
.Ve
.SH "BUGS"
.IX Header "BUGS"
Can be seen on the RedHat buzilla page under the libvirt
<https://bugzilla.redhat.com/>