2009-04-19 15:10:45 +00:00
. \" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.07)
2006-04-10 14:15:33 +00:00
. \"
. \" 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
2009-04-19 15:10:45 +00:00
. \" double quote, and \*(R" will give a right double quote. \*(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 -
2006-04-10 14:15:33 +00:00
.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\}
. \"
2009-04-19 15:10:45 +00:00
. \" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n (.g .ds Aq \(aq
.el .ds Aq '
. \"
2006-04-10 14:15:33 +00:00
. \" 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.
2009-04-19 15:10:45 +00:00
.ie \nF \{ \
2006-04-10 14:15:33 +00:00
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
. .
. nr % 0
. rr F
. \}
2009-04-19 15:10:45 +00:00
.el \{ \
. de IX
. .
. \}
2006-04-10 14:15:33 +00:00
. \"
. \" 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
. \" ========================================================================
. \"
2007-06-21 15:00:17 +00:00
.IX Title "VIRSH 1"
2009-04-19 15:10:45 +00:00
.TH VIRSH 1 "2009-04-16" "libvirt-0.6.2" "Virtualization Support"
. \" For nroff, turn off justification. Always turn off hyphenation; it makes
. \" way too many mistakes in technical documents.
.if n .ad l
.nh
2006-04-10 14:15:33 +00:00
.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
2007-06-21 15:00:17 +00:00
domains. The program can be used to create, pause, and shutdown
2007-08-14 07:02:18 +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, it currently also support QEmu and \s -1KVM\s 0.
2006-04-10 14:15:33 +00:00
.PP
2007-06-21 15:00:17 +00:00
The basic structure of most virsh usage is:
2006-04-10 14:15:33 +00:00
.PP
.Vb 1
2009-04-19 15:10:45 +00:00
\& virsh <command> <domain\- id> [OPTIONS]
2006-04-10 14:15:33 +00:00
.Ve
.PP
2007-06-21 15:00:17 +00:00
Where \fI command\fR is one of the commands listed below, \fI domain-id\fR
2006-04-10 14:15:33 +00:00
is the numeric domain id, or the domain name (which will be internally
2007-06-21 15:00:17 +00:00
translated to domain id), and \fI \s -1OPTIONS\s 0\fR are command specific
2006-04-10 14:15:33 +00:00
options. There are a few exceptions to this rule in the cases where
2007-06-21 15:00:17 +00:00
the 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 commands.
.PP
The \fB virsh\fR program can be used either to run one command at a time
by giving the command as an argument on the command line, or as a shell
if no command is given in the command line, it will then start a minimal
interpreter waiting for your commands and the \fB quit\fR command will then exit
the program.
2006-04-10 14:15:33 +00:00
.SH "NOTES"
.IX Header "NOTES"
2006-10-11 15:18:31 +00:00
All \fB virsh\fR operations rely upon the libvirt library.
2007-08-14 07:02:18 +00:00
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
2009-04-20 11:55:53 +00:00
\& \fB service libvirtd start\fR .
2006-04-10 14:15:33 +00:00
.PP
2007-08-14 07:02:18 +00:00
Most \fB virsh\fR commands require root privileges to run due to the
2006-04-10 14:15:33 +00:00
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
2007-06-21 15:00:17 +00:00
program returned, doesn't mean the action is complete. This is
2006-04-10 14:15:33 +00:00
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.
2007-06-21 15:00:17 +00:00
.SH "GENERIC COMMANDS"
.IX Header "GENERIC COMMANDS"
The following commands are generic i.e. not specific to a domain.
.IP "\fBhelp\fR optional \fIcommand\fR" 4
.IX Item "help optional command"
2007-08-14 07:02:18 +00:00
This prints a small synopsis about all commands available for \fB virsh\fR
2007-06-21 15:00:17 +00:00
\& \fB help\fR \fI command\fR will print out a detailed help message on that command.
.IP "\fBquit\fR" 4
.IX Item "quit"
quit this interactive terminal
.IP "\fBversion\fR" 4
.IX Item "version"
2008-02-05 19:27:37 +00:00
Will print out the major version info about what this built from.
2007-06-21 15:00:17 +00:00
.RS 4
2006-04-10 14:15:33 +00:00
.Sp
2007-06-21 15:00:17 +00:00
.RS 4
2008-02-05 19:27:37 +00:00
\& \fB Example\fR
2007-06-21 15:00:17 +00:00
.Sp
2008-02-05 19:27:37 +00:00
\& \fB virsh\fR version
2006-04-10 14:15:33 +00:00
.Sp
2008-02-05 19:27:37 +00:00
Compiled against library: libvir 0.0.6
2007-06-21 15:00:17 +00:00
.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
.RE
.IP "\fBconnect\fR \fI\s-1URI\s0\fR optional \fI\-\-readonly\fR" 4
.IX Item "connect URI optional --readonly"
(Re)\- Connect to the hypervisor. This is a build-in command after shell
start up, and usually get an \fI \s -1URI\s 0\fR parameter specifying how to connect
to the hypervisor. The documentation page at <http://libvirt.org/uri.html>
2007-07-23 09:35:59 +00:00
list the values supported but the most common are:
2007-06-21 15:00:17 +00:00
.RS 4
2007-06-21 15:46:04 +00:00
.IP "xen:///" 4
.IX Item "xen:///"
2007-06-21 15:00:17 +00:00
this is used to connect to the local Xen hypervisor, this is the default
.IP "qemu:///system" 4
.IX Item "qemu:///system"
2008-03-17 10:27:31 +00:00
allow to connect locally as root to the daemon supervising QEmu and \s -1KVM\s 0 domains
2007-06-21 15:00:17 +00:00
.IP "qemu:///session" 4
.IX Item "qemu:///session"
2009-04-19 15:10:45 +00:00
allow to connect locally as a normal user to his own set of QEmu and \s -1KVM\s 0 domains
2007-06-21 15:00:17 +00:00
.RE
.RS 4
.Sp
2007-08-14 07:02:18 +00:00
For remote access see the documentation page on how to make URIs.
2007-06-21 15:00:17 +00:00
The \fI \- \- readonly\fR option allows for read-only connection
.RE
2008-04-15 15:20:43 +00:00
.IP "\fBuri\fR" 4
.IX Item "uri"
Prints the hypervisor canonical \s -1URI\s 0, can be useful in shell mode.
.IP "\fBhostname\fR" 4
.IX Item "hostname"
Print the hypervisor hostname.
2007-06-21 15:00:17 +00:00
.IP "\fBnodeinfo\fR" 4
.IX Item "nodeinfo"
Returns basic information about the node, like number and type of \s -1CPU\s 0,
and size of the physical memory.
.IP "\fBcapabilities\fR" 4
.IX Item "capabilities"
Print an \s -1XML\s 0 document describing the capabilities of the hypervisor
we are currently connected to. This includes a section on the host
capabilities in terms of \s -1CPU\s 0 and features, and a set of description
for each kind of guest which can be virtualized. For a more complete
2007-07-23 09:35:59 +00:00
description see:
2007-06-21 15:00:17 +00:00
<http://libvirt.org/format.html#Capa1>
2008-03-14 11:08:03 +00:00
The \s -1XML\s 0 also show the \s -1NUMA\s 0 topology information if available.
2006-04-10 14:15:33 +00:00
.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
2008-02-05 19:27:37 +00:00
Id Name State
2006-04-10 14:15:33 +00:00
.Sp
2008-02-05 19:27:37 +00:00
\& \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \- \-
2006-04-10 14:15:33 +00:00
.Sp
.Vb 2
2009-04-19 15:10:45 +00:00
\& 0 Domain\- 0 running
2006-04-10 14:15:33 +00:00
\& 2 fedora paused
.Ve
.Sp
2008-02-05 19:27:37 +00:00
Name is the name of the domain. \s -1ID\s 0 the domain numeric id.
2009-04-19 15:10:45 +00:00
State is the run state (see below).
2006-04-10 14:15:33 +00:00
.Sp
\& \fB \s -1STATES\s 0\fR
.Sp
2009-04-19 15:10:45 +00:00
The State field lists 6 states for a domain, and which ones the
current domain is in.
.RS 4
.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
2009-04-19 15:10:45 +00:00
.IP "\fBidle\fR" 4
.IX Item "idle"
The domain is idle, and not running or runnable. This can be caused
2006-04-10 14:15:33 +00:00
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.
2009-04-19 15:10:45 +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
2009-04-19 15:10:45 +00:00
running \fB virsh suspend\fR . When in a paused state the domain will still
2006-04-10 14:15:33 +00:00
consume allocated resources like memory, but will not be eligible for
2009-04-19 15:10:45 +00:00
scheduling by the hypervisor.
.IP "\fBshutdown\fR" 4
.IX Item "shutdown"
2007-06-21 15:00:17 +00:00
The domain is in the process of shutting down, i.e. the guest operating system
2008-02-05 19:27:37 +00:00
has been notified and should be in the process of stopping its operations
2007-06-21 15:00:17 +00:00
gracefully.
2009-04-19 15:10:45 +00:00
.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
2009-04-19 15:10:45 +00:00
restart on crash.
.IP "\fBdying\fR" 4
.IX Item "dying"
2007-06-21 15:00:17 +00:00
The domain is in process of dying, but hasn't completely shutdown or
crashed.
2006-04-10 14:15:33 +00:00
.RE
.RS 4
2009-04-19 15:10:45 +00:00
.RE
.IP "\fBfreecell\fR optional \fIcellno\fR" 4
.IX Item "freecell optional cellno"
Prints the available amount of memory on the machine or within a
\& \s -1NUMA\s 0 cell if \fI cellno\fR is provided.
2007-06-21 15:00:17 +00:00
.SH "DOMAIN COMMANDS"
.IX Header "DOMAIN COMMANDS"
The following commands manipulate domains directly, as stated
previously most commands take domain-id as the first parameter. The
\& \fI domain-id\fR can be specified as an short integer, a name or a full \s -1UUID\s 0.
2007-06-21 15:46:04 +00:00
.IP "\fBautostart\fR optional \fI\-\-disable\fR \fIdomain-id\fR" 4
.IX Item "autostart optional --disable domain-id"
2007-06-21 15:00:17 +00:00
Configure a domain to be automatically started at boot.
.Sp
2007-06-21 15:46:04 +00:00
The option \fI \- \- disable\fR disable autostarting.
2007-06-21 15:00:17 +00:00
.IP "\fBconsole\fR \fIdomain-id\fR" 4
.IX Item "console domain-id"
Connect the virtual serial console for the guest.
.IP "\fBcreate\fR \fI\s-1FILE\s0\fR" 4
.IX Item "create FILE"
2009-04-19 15:10:45 +00:00
Create a domain from an \s -1XML\s 0 <file>. An easy way to create the \s -1XML\s 0 <file> is to use the \fB dumpxml\fR command to obtain the definition of a pre-existing guest.
2007-06-21 15:00:17 +00:00
.Sp
\& \fB Example\fR
.Sp
2008-02-05 19:27:37 +00:00
virsh dumpxml <domain\- id> > file.
2007-06-21 15:00:17 +00:00
.IP "\fBdefine\fR \fI\s-1FILE\s0\fR" 4
.IX Item "define FILE"
Define a domain from an \s -1XML\s 0 <file>. The domain definitions is registered
but not started.
.IP "\fBdestroy\fR \fIdomain-id\fR" 4
.IX Item "destroy domain-id"
2009-04-19 15:10:45 +00:00
Immediately terminate the domain domain-id. This doesn't give the domain
2007-06-21 15:00:17 +00:00
\& \s -1OS\s 0 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 \fB shutdown\fR command instead.
2008-04-15 15:20:43 +00:00
.IP "\fBdomblkstat\fR \fIdomain\fR \fIblock-device\fR" 4
.IX Item "domblkstat domain block-device"
Get device block stats for a running domain.
.IP "\fBdomifstat\fR \fIdomain\fR \fIinterface-device\fR" 4
.IX Item "domifstat domain interface-device"
Get network interface stats for a running domain.
2007-06-21 15:00:17 +00:00
.IP "\fBdominfo\fR \fIdomain-id\fR" 4
.IX Item "dominfo domain-id"
Returns basic information about the domain.
.IP "\fBdomuuid\fR \fIdomain-name-or-id\fR" 4
.IX Item "domuuid domain-name-or-id"
Convert a domain name or id to domain \s -1UUID\s 0
2008-04-15 15:20:43 +00:00
.IP "\fBdomid\fR \fIdomain-name-or-uuid\fR" 4
.IX Item "domid domain-name-or-uuid"
Convert a domain name (or \s -1UUID\s 0) to a domain id
2007-06-21 15:00:17 +00:00
.IP "\fBdominfo\fR \fIdomain-id\fR" 4
.IX Item "dominfo domain-id"
Returns basic information about the domain.
2008-04-15 15:20:43 +00:00
.IP "\fBdomname\fR \fIdomain-id-or-uuid\fR" 4
.IX Item "domname domain-id-or-uuid"
Convert a domain Id (or \s -1UUID\s 0) to domain name
2007-06-21 15:00:17 +00:00
.IP "\fBdomstate\fR \fIdomain-id\fR" 4
.IX Item "domstate domain-id"
Returns state about a running domain.
2008-04-15 15:20:43 +00:00
.IP "\fBdump\fR \fIdomain-id\fR \fIcorefilepath\fR" 4
.IX Item "dump domain-id corefilepath"
Dumps the core of a domain to a file for analysis.
2007-06-21 15:00:17 +00:00
.IP "\fBdumpxml\fR \fIdomain-id\fR" 4
.IX Item "dumpxml domain-id"
2008-03-14 11:08:03 +00:00
Output the domain information as an \s -1XML\s 0 dump to stdout, this format can be used by the \fB create\fR command.
2009-04-19 15:10:45 +00:00
.IP "\fBedit\fR \fIdomain-id\fR" 4
.IX Item "edit domain-id"
Edit the \s -1XML\s 0 configuration file for a domain.
.Sp
This is equivalent to:
virsh dumpxml domain > domain.xml
edit domain.xml
virsh define domain.xml
except that it does some error checking.
.Sp
The editor used can be supplied by the \f (CW$EDITOR\fR environment
variable, or if that is not defined defaults to \f (CW\* (C`vi\* (C'\fR .
2008-04-15 15:20:43 +00:00
.IP "\fBmigrate\fR optional \fI\-\-live\fR \fIdomain-id\fR \fIdesturi\fR \fImigrateuri\fR" 4
.IX Item "migrate optional --live domain-id desturi migrateuri"
Migrate domain to another host. Add \- \- live for live migration. The \fI desturi\fR
is the connection \s -1URI\s 0 of the destination host, and \fI migrateuri\fR is the
migration \s -1URI\s 0, which usually can be omitted.
2007-06-21 15:00:17 +00:00
.IP "\fBreboot\fR \fIdomain-id\fR" 4
.IX Item "reboot domain-id"
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
2007-06-21 15:00:17 +00:00
executed the reboot action, which may be significantly before the
domain actually reboots.
2006-04-10 14:15:33 +00:00
.Sp
2009-04-19 15:10:45 +00:00
The exact behavior of a domain when it reboots is set by the
\& \fI on_reboot\fR parameter in the domain's \s -1XML\s 0 definition.
2006-04-10 14:15:33 +00:00
.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.
2007-06-21 15:00:17 +00:00
.IP "\fBsave\fR \fIdomain-id\fR \fIstate-file\fR" 4
.IX Item "save domain-id 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.
2009-04-19 15:10:45 +00:00
.IP "\fBschedinfo\fR optional \fI\-\-set\fR \fBparameter=value\fR \fIdomain-id\fR" 4
.IX Item "schedinfo optional --set parameter=value domain-id"
.PD 0
2008-04-15 15:20:43 +00:00
.IP "\fBschedinfo\fR optional \fI\-\-weight\fR \fBnumber\fR optional \fI\-\-cap\fR \fBnumber\fR \fIdomain-id\fR" 4
.IX Item "schedinfo optional --weight number optional --cap number domain-id"
2009-04-19 15:10:45 +00:00
.PD
Allows to show (and set) the domain scheduler parameters.
.Sp
\& \fB Note\fR : The weight and cap parameters are defined only for the
\& \s -1XEN_CREDIT\s 0 scheduler and are now \fI \s -1DEPRECATED\s 0\fR .
2007-06-21 15:00:17 +00:00
.IP "\fBsetmem\fR \fIdomain-id\fR \fBkilobytes\fR" 4
.IX Item "setmem domain-id kilobytes"
Change the current memory allocation in the guest domain. This should take
effect immediately. The memory limit is specified in
kilobytes.
2008-04-15 15:20:43 +00:00
.Sp
For Xen, you can only adjust the memory of a running domain if the
domain is paravirtualized or running the \s -1PV\s 0 balloon driver.
2007-06-21 15:00:17 +00:00
.IP "\fBsetmaxmem\fR \fIdomain-id\fR \fBkilobytes\fR" 4
.IX Item "setmaxmem domain-id kilobytes"
Change the maximum memory allocation limit in the guest domain. This should
2008-02-05 19:27:37 +00:00
not change the current memory use. The memory limit is specified in
2007-06-21 15:00:17 +00:00
kilobytes.
.IP "\fBsetvcpus\fR \fIdomain-id\fR \fIcount\fR" 4
.IX Item "setvcpus domain-id count"
Change the number of virtual CPUs active in the guest domain. Note that
2008-02-05 19:27:37 +00:00
\& \fI count\fR may be limited by host, hypervisor or limit coming from the
2007-06-21 15:00:17 +00:00
original description of domain.
2008-04-15 15:20:43 +00:00
.Sp
For Xen, you can only adjust the virtual CPUs of a running domain if
the domain is paravirtualized.
2007-06-21 15:00:17 +00:00
.IP "\fBshutdown\fR \fIdomain-id\fR" 4
.IX Item "shutdown domain-id"
2006-04-10 14:15:33 +00:00
Gracefully shuts down a domain. This coordinates with the domain \s -1OS\s 0
2007-08-14 07:02:18 +00:00
to perform graceful shutdown, so there is no guarantee that it will
2006-04-10 14:15:33 +00:00
succeed, and may take a variable length of time depending on what
2008-02-05 19:27:37 +00:00
services must be shutdown in the domain.
2006-04-10 14:15:33 +00:00
.Sp
2009-04-19 15:10:45 +00:00
The exact behavior of a domain when it shuts down is set by the
\& \fI on_shutdown\fR parameter in the domain's \s -1XML\s 0 definition.
2008-04-15 15:20:43 +00:00
.IP "\fBstart\fR \fIdomain-name\fR" 4
.IX Item "start domain-name"
Start a (previously defined) inactive domain.
2007-06-21 15:00:17 +00:00
.IP "\fBsuspend\fR \fIdomain-id\fR" 4
.IX Item "suspend domain-id"
Suspend a running domain. It is kept in memory but won't be scheduled
anymore.
.IP "\fBresume\fR \fIdomain-id\fR" 4
.IX Item "resume domain-id"
Moves a domain out of the suspended state. This will allow a previously
2008-01-29 17:43:28 +00:00
suspended domain to now be eligible for scheduling by the underlying
2007-06-21 15:00:17 +00:00
hypervisor.
2007-07-26 08:41:16 +00:00
.IP "\fBttyconsole\fR \fIdomain-id\fR" 4
.IX Item "ttyconsole domain-id"
Output the device used for the \s -1TTY\s 0 console of the domain. If the information
2007-08-14 07:02:18 +00:00
is not available the processes will provide an exit code of 1.
2007-06-21 15:00:17 +00:00
.IP "\fBundefine\fR \fIdomain-id\fR" 4
.IX Item "undefine domain-id"
Undefine the configuration for an inactive domain. Since it's not running
the domain name or UUId must be used as the \fI domain-id\fR .
.IP "\fBvcpuinfo\fR \fIdomain-id\fR" 4
.IX Item "vcpuinfo domain-id"
Returns basic information about the domain virtual CPUs, like the number of
vCPUs, the running time, the affinity to physical processors.
.IP "\fBvcpupin\fR \fIdomain-id\fR \fIvcpu\fR \fIcpulist\fR" 4
.IX Item "vcpupin domain-id vcpu cpulist"
Pin domain VCPUs to host physical CPUs. The \fI vcpu\fR number must be provided
and \fI cpulist\fR is a comma separated list of physical \s -1CPU\s 0 numbers.
.IP "\fBvncdisplay\fR \fIdomain-id\fR" 4
.IX Item "vncdisplay domain-id"
2007-07-26 08:41:16 +00:00
Output the \s -1IP\s 0 address and port number for the \s -1VNC\s 0 display. If the information
2007-08-14 07:02:18 +00:00
is not available the processes will provide an exit code of 1.
2009-04-19 15:10:45 +00:00
.SH "DEVICE COMMANDS"
.IX Header "DEVICE COMMANDS"
2007-06-21 15:00:17 +00:00
The following commands manipulate devices associated to domains.
The domain-id can be specified as an short integer, a name or a full \s -1UUID\s 0.
To better understand the values allowed as options for the command
reading the documentation at <http://libvirt.org/format.html> on the
format of the device sections to get the most accurate set of accepted values.
.IP "\fBattach-device\fR \fIdomain-id\fR \fI\s-1FILE\s0\fR" 4
.IX Item "attach-device domain-id FILE"
Attach a device to the domain, using a device definition in an \s -1XML\s 0 file.
See the documentation to learn about libvirt \s -1XML\s 0 format for a device.
.IP "\fBattach-disk\fR \fIdomain-id\fR \fIsource\fR \fItarget\fR optional \fI\-\-driver driver\fR \fI\-\-subdriver subdriver\fR \fI\-\-type type\fR \fI\-\-mode mode\fR" 4
.IX Item "attach-disk domain-id source target optional --driver driver --subdriver subdriver --type type --mode mode"
Attach a new disk device to the domain.
\& \fI source\fR and \fI target\fR are paths for the files and devices.
\& \fI driver\fR can be \fI file\fR , \fI tap\fR or \fI phy\fR depending on the kind of access.
\& \fI type\fR can indicate \fI cdrom\fR or \fI floppy\fR as alternative to the disk default.
\& \fI mode\fR can specify the two specific mode \fI readonly\fR or \fI shareable\fR .
.IP "\fBattach-interface\fR \fIdomain-id\fR \fItype\fR \fIsource\fR optional \fI\-\-target target\fR \fI\-\-mac mac\fR \fI\-\-script script\fR" 4
.IX Item "attach-interface domain-id type source optional --target target --mac mac --script script"
Attach a new network interface to the domain.
\& \fI type\fR can be either \fI network\fR to indicate a physical network device or \fI bridge\fR to indicate a bridge to a device.
\& \fI source\fR indicates the source device.
\& \fI target\fR allows to indicate the target device in the guest.
\& \fI mac\fR allows to specify the \s -1MAC\s 0 address of the network interface.
\& \fI script\fR allows to specify a path to a script handling a bridge instead of
the default one.
.IP "\fBdetach-device\fR \fIdomain-id\fR \fI\s-1FILE\s0\fR" 4
.IX Item "detach-device domain-id FILE"
Detach a device from the domain, takes the same kind of \s -1XML\s 0 descriptions
as command \fB attach-device\fR .
.IP "\fBdetach-disk\fR \fIdomain-id\fR \fItarget\fR" 4
.IX Item "detach-disk domain-id target"
Detach a disk device from a domain. The \fI target\fR is the device as seen
from the domain.
.IP "\fBdetach-interface\fR \fIdomain-id\fR \fItype\fR optional \fI\-\-mac mac\fR" 4
.IX Item "detach-interface domain-id type optional --mac mac"
2007-08-14 07:02:18 +00:00
Detach a network interface from a domain.
2007-06-21 15:00:17 +00:00
\& \fI type\fR can be either \fI network\fR to indicate a physical network device or \fI bridge\fR to indicate a bridge to a device.
It is recommended to use the \fI mac\fR option to distinguish between the interfaces
if more than one are present on the domain.
2009-04-19 15:10:45 +00:00
.SH "VIRTUAL NETWORK COMMANDS"
.IX Header "VIRTUAL NETWORK COMMANDS"
2007-06-21 15:00:17 +00:00
The following commands manipulate networks. Libvirt has the capability to
define virtual networks which can then be used by domains and linked to
2008-03-14 11:08:03 +00:00
actual network devices. For more detailed information about this feature
2007-06-21 15:00:17 +00:00
see the documentation at <http://libvirt.org/format.html#Net1> . A lot
of the command for virtual networks are similar to the one used for domains,
but the way to name a virtual network is either by its name or \s -1UUID\s 0.
.IP "\fBnet-autostart\fR \fInetwork\fR optional \fI\-\-disable\fR" 4
.IX Item "net-autostart network optional --disable"
Configure a virtual network to be automatically started at boot.
The \fI \- \- disable\fR option disable autostarting.
.IP "\fBnet-create\fR \fIfile\fR" 4
.IX Item "net-create file"
Create a virtual network from an \s -1XML\s 0 \fI file\fR , see the documentation to get
2008-02-05 19:27:37 +00:00
a description of the \s -1XML\s 0 network format used by libvirt.
2007-06-21 15:00:17 +00:00
.IP "\fBnet-define\fR \fIfile\fR" 4
.IX Item "net-define file"
Define a virtual network from an \s -1XML\s 0 \fI file\fR , the network is just defined but
2007-08-14 07:02:18 +00:00
not instantiated.
2007-06-21 15:00:17 +00:00
.IP "\fBnet-destroy\fR \fInetwork\fR" 4
.IX Item "net-destroy network"
Destroy a given virtual network specified by its name or \s -1UUID\s 0. This takes
effect immediately.
.IP "\fBnet-dumpxml\fR \fInetwork\fR" 4
.IX Item "net-dumpxml network"
Output the virtual network information as an \s -1XML\s 0 dump to stdout.
2009-04-19 15:10:45 +00:00
.IP "\fBnet-edit\fR \fInetwork\fR" 4
.IX Item "net-edit network"
Edit the \s -1XML\s 0 configuration file for a network.
.Sp
This is equivalent to:
virsh net-dumpxml network > network.xml
edit network.xml
virsh define network.xml
except that it does some error checking.
.Sp
The editor used can be supplied by the \f (CW$EDITOR\fR environment
variable, or if that is not defined defaults to \f (CW\* (C`vi\* (C'\fR .
2007-06-21 15:00:17 +00:00
.IP "\fBnet-list\fR optional \fI\-\-inactive\fR or \fI\-\-all\fR" 4
.IX Item "net-list optional --inactive or --all"
Returns the list of active networks, if \fI \- \- all\fR is specified this will also
include defined but inactive networks, if \fI \- \- inactive\fR is specified only the
inactive ones will be listed.
.IP "\fBnet-name\fR \fInetwork-UUID\fR" 4
.IX Item "net-name network-UUID"
Convert a network \s -1UUID\s 0 to network name.
.IP "\fBnet-start\fR \fInetwork\fR" 4
.IX Item "net-start network"
Start a (previously defined) inactive network.
.IP "\fBnet-undefine\fR \fInetwork\fR" 4
.IX Item "net-undefine network"
Undefine the configuration for an inactive network.
.IP "\fBnet-uuid\fR \fInetwork-name\fR" 4
.IX Item "net-uuid network-name"
Convert a network name to network \s -1UUID\s 0.
2007-07-23 09:35:59 +00:00
.SH "ENVIRONMENT"
.IX Header "ENVIRONMENT"
2009-04-19 15:10:45 +00:00
The following environment variables can be set to alter the behaviour
of \f (CW\* (C`virsh\* (C'\fR
2007-07-23 09:35:59 +00:00
.IP "\s-1VIRSH_DEFAULT_CONNECT_URI\s0" 4
.IX Item "VIRSH_DEFAULT_CONNECT_URI"
The hypervisor to connect to by default. Set this to a \s -1URI\s 0, in the same
format as accepted by the \fB connect\fR option.
2009-04-19 15:10:45 +00:00
.IP "LIBVIRT_DEBUG=LEVEL" 4
.IX Item "LIBVIRT_DEBUG=LEVEL"
Turn on verbose debugging of all libvirt \s -1API\s 0 calls. Valid levels are
.RS 4
.IP "\(bu" 4
LIBVIRT_DEBUG=1
.Sp
Messages at level \s -1DEBUG\s 0 or above
.IP "\(bu" 4
LIBVIRT_DEBUG=2
.Sp
Messages at level \s -1INFO\s 0 or above
.IP "\(bu" 4
LIBVIRT_DEBUG=3
.Sp
Messages at level \s -1WARNING\s 0 or above
.IP "\(bu" 4
LIBVIRT_DEBUG=4
.Sp
Messages at level \s -1ERROR\s 0 or above
2007-07-23 09:35:59 +00:00
.RE
.RS 4
2009-04-19 15:10:45 +00:00
.Sp
For further information about debugging options consult \f (CW\* (C`http://libvirt.org/logging.html\* (C'\fR
.RE
.SH "BUGS"
.IX Header "BUGS"
Report any bugs discovered to the libvirt community via the mailing
list \f (CW\* (C`http://libvirt.org/contact.html\* (C'\fR or bug tracker \f (CW\* (C`http://libvirt.org/bugs.html\* (C'\fR .
Alternatively report bugs to your software distributor / vendor.
.SH "AUTHORS"
.IX Header "AUTHORS"
2006-04-10 14:15:33 +00:00
.Vb 2
2008-02-05 19:27:37 +00:00
\& Andrew Puch <apuch @ redhat.com>
2006-04-10 14:15:33 +00:00
\& Daniel Veillard <veillard @ redhat.com>
2009-04-19 15:10:45 +00:00
\&
\& Based on the xm man page by:
2006-04-10 14:15:33 +00:00
\& Sean Dague <sean at dague dot net>
\& Daniel Stekloff <dsteklof at us dot ibm dot com>
.Ve
2009-04-19 15:10:45 +00:00
.SH "COPYRIGHT"
.IX Header "COPYRIGHT"
Copyright (C) 2005, 2007\- 2009 Red Hat, Inc.
.SH "LICENSE"
.IX Header "LICENSE"
virsh is distributed under the terms of the \s -1GNU\s 0 \s -1LGPL\s 0 v2+.
This is free software; see the source for copying conditions. There
is \s -1NO\s 0 warranty; not even for \s -1MERCHANTABILITY\s 0 or \s -1FITNESS\s 0 \s -1FOR\s 0 A \s -1PARTICULAR\s 0
\& \s -1PURPOSE\s 0
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\& \fI virt\- install\fR \| (1), \fI virt\- xml\- validate\fR \| (1), \fI virt\- top\fR \| (1), \fI virt\- mem\fR \| (1), \fI virt\- df\fR \| (1), <http://www.libvirt.org/>