* virsh.1 docs/virsh.pod docs/Makefile.am: updated the pod file

to reflect the current set of commands, added a rule in the Makefile
  to regenerate the man page, and regenerated.
Daniel
This commit is contained in:
Daniel Veillard 2007-06-21 15:00:17 +00:00
parent 4fdec95d6b
commit 8fe24e137f
4 changed files with 592 additions and 166 deletions

View File

@ -1,3 +1,9 @@
Thu Jun 21 16:59:02 CEST 2007 Daniel Veillard <veillard@redhat.com>
* virsh.1 docs/virsh.pod docs/Makefile.am: updated the pod file
to reflect the current set of commands, added a rule in the Makefile
to regenerate the man page, and regenerated.
Thu Jun 21 09:38:12 CEST 2007 Daniel Veillard <veillard@redhat.com> Thu Jun 21 09:38:12 CEST 2007 Daniel Veillard <veillard@redhat.com>
* docs/virsh.pod: commit of original POD file for virsh man page * docs/virsh.pod: commit of original POD file for virsh man page

View File

@ -17,6 +17,9 @@ man_MANS=
all: web $(top_builddir)/NEWS $(man_MANS) all: web $(top_builddir)/NEWS $(man_MANS)
virsh.1: virsh.pod
pod2man -c "Virtualization Support" virsh.pod > virsh.1 && cp virsh.1 $(top_builddir)
api: libvirt-api.xml libvirt-refs.xml $(APIPAGES) $(srcdir)/html/index.html api: libvirt-api.xml libvirt-refs.xml $(APIPAGES) $(srcdir)/html/index.html
web: $(PAGES) web: $(PAGES)

View File

@ -10,94 +10,125 @@ virsh <subcommand> [args]
The B<virsh> program is the main interface for managing virsh guest The B<virsh> program is the main interface for managing virsh guest
domains. The program can be used to create, pause, and shutdown domains. The program can be used to create, pause, and shutdown
domains. It can also be used to list current domains. Libvirt is a C toolkit to interract with the virtualization capabilities of recent versions of Linux (and other OSes). It is free software available under the GNU Lesser General Public License. Virtualization of the Linux Operating System means the ability to run multiple instances of Operating Systems concurently on a single hardware system where the basic resources are driven by a Linux instance. The library aim at providing long term stable C API initially for the Xen paravirtualization but should be able to integrate other virtualization mechanisms if needed. domains. It can also be used to list current domains. Libvirt is a C toolkit to interract with the virtualization capabilities of recent versions of Linux (and other OSes). It is free software available under the GNU Lesser General Public License. Virtualization of the Linux Operating System means the ability to run multiple instances of Operating Systems concurently on a single hardware system where the basic resources are driven by a Linux instance. The library aim at providing long term stable C API initially for the Xen paravirtualization but should be able to integrate other virtualization mechanisms, it currently also support QEmu and KVM.
The basic structure of every virsh command is almost always: The basic structure of most virsh usage is:
virsh <subcommand> <domain-id> [OPTIONS] virsh <command> <domain-id> [OPTIONS]
Where I<subcommand> is one of the sub commands listed below, I<domain-id> Where I<command> is one of the commands listed below, I<domain-id>
is the numeric domain id, or the domain name (which will be internally is the numeric domain id, or the domain name (which will be internally
translated to domain id), and I<OPTIONS> are sub command specific translated to domain id), and I<OPTIONS> are command specific
options. There are a few exceptions to this rule in the cases where 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, the command in question acts on all domains, the entire machine,
or directly on the xen hypervisor. Those exceptions will be clear for or directly on the xen hypervisor. Those exceptions will be clear for
each of those sub commands. each of those commands.
The B<virsh> 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 B<quit> command will then exit
the program.
=head1 NOTES =head1 NOTES
All B<virsh> opperations rely upon the libvirt library. All B<virsh> operations rely upon the libvirt library.
For any virsh commands to run xend/qemu, or what ever virtual library that libvirt suports. For this reason you should start xend/qemu as a service when your system first boots using xen/qemu. For any virsh commands to run xend/qemu, or what ever virtual library that libvirt suports. 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
B<service start libvirtd> .
Most B<virsh> commands require root privledges to run due to the Most B<virsh> commands require root privledges to run due to the
communications channels used to talk to the hypervisor. Running as communications channels used to talk to the hypervisor. Running as
non root will return an error. non root will return an error.
Most B<virsh> commands act asynchronously, so just because the B<virsh> Most B<virsh> commands act asynchronously, so just because the B<virsh>
command returned, doesn't mean the action is complete. This is program returned, doesn't mean the action is complete. This is
important, as many operations on domains, like create and shutdown, important, as many operations on domains, like create and shutdown,
can take considerable time (30 seconds or more) to bring the machine 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 into a fully compliant state. If you want to know when one of these
actions has finished you must poll through virsh list periodically. actions has finished you must poll through virsh list periodically.
=head1 DOMAIN SUBCOMMANDS =head1 GENERIC COMMANDS
The following sub commands manipulate domains directly, as stated The following commands are generic i.e. not specific to a domain.
previously most commands take domain-id as the first parameter.
=over 4 =over 4
=item B<connect> optional I<--readonly> =item B<help> optional I<command>
Connect to local hypervisor. This is build-in command after shell start up. This prints a small synoposis about all commands available for B<virsh>
B<help> I<command> will print out a detailed help message on that command.
The I<--readonly> option read-only connection =item B<quit>
=item B<create> I<FILE> quit this interactive terminal
Create a domain from an XML <file> an easy way to create one if you have a pre-existing xen guest created via B<xm> create <XMLFILE>. =item B<version>
Will print out the major version info about what this built from.
=over 4
B<Example> B<Example>
virsh dumpxml <domain-name or id> to a file. B<virsh> version
=item B<dinfo> I<domain-name or id> Compiled against library: libvir 0.0.6
Returns basic information about the domain. Using library: libvir 0.0.6
=item B<dumpxml> I<domain-name or id> Using API: Xen 3.0.0
Ouput the domain informations as an XML dump to stdout, this format can be used by the create sub command. Running hypervisor: Xen 3.0.0
=back
=item B<destroy> I<domain-name or id> =item B<connect> I<URI> optional I<--readonly>
Immediately terminate the domain domain-id. This doesn't give the domain (Re)-Connect to the hypervisor. This is a build-in command after shell
OS any chance to react, and it the equivalent of ripping the power start up, and usually get an I<URI> parameter specifying how to connect
cord out on a physical machine. In most cases you will want to use to the hypervisor. The documentation page at L<http://libvirt.org/uri.html>
the B<shutdown> command instead. list the values supported but the most commons are:
=item B<domid> I<domain-name> =over 4
Converts a domain name to a domain id using xend's internal mapping. =item xen///
=item B<dominfo> I<domain-name or id> this is used to connect to the local Xen hypervisor, this is the default
Returns basic information about the domain. =item qemu:///system
=item B<domname> I<domain-id> allow to connect locally as root to the daemon supervizing QEmu domains
convert a domain Id to domain name =item qemu:///session
=item B<domstate> I<domain-name or id> allow to connect locally as a normal user to the his own set of QEmu domain
Returns state about a running domain. =item kvm:///system
=item B<help> optional I<subcommand> allow to connect locally as root to the daemon supervizing KVM domains
Displays the short help message (i.e. common commands). =item kvm:///session
B<help> I<subcommand> will print out a detailed help message on that sub command allow to connect locally as a normal user to the his own set of KVM domain
=back
For remote access see the documetnation page on how to make URIs.
The I<--readonly> option allows for read-only connection
=item B<nodeinfo>
Returns basic information about the node, like number and type of CPU,
and size of the physical memory.
=item B<capabilities>
Print an XML document describing the capabilities of the hypervisor
we are currently connected to. This includes a section on the host
capabilities in terms of CPU and features, and a set of description
for each kind of guest which can be virtualized. For a more complete
description see the description at:
L<http://libvirt.org/format.html#Capa1>
=item B<list> =item B<list>
@ -146,7 +177,9 @@ scheduling by the Xen hypervisor.
=item B<s - shutdown> =item B<s - shutdown>
FIXME: Why would you ever see this state? The domain is in the process of shutting down, i.e. the guest operating system
has been notified and should be in the process of stopping its operations
gracefully.
=item B<c - crashed> =item B<c - crashed>
@ -159,17 +192,74 @@ restart on crash. See L<xmdomain.cfg> for more info.
The domain is in process of dying, but hasn't completely shutdown or The domain is in process of dying, but hasn't completely shutdown or
crashed. crashed.
FIXME: Is this right?
=back =back
=item B<nodeinfo> I<domain-name or id> =head1 DOMAIN COMMANDS
Returns basic information about the node. The following commands manipulate domains directly, as stated
previously most commands take domain-id as the first parameter. The
I<domain-id> can be specified as an short integer, a name or a full UUID.
=item B<quit> =over 4
=item B<autostart> optional I<----disable> I<domain-id>
Configure a domain to be automatically started at boot.
The option I<----disable> disable autostarting.
=item B<console> I<domain-id>
Connect the virtual serial console for the guest.
=item B<create> I<FILE>
Create a domain from an XML <file> an easy way to create one if you have a pre-existing xen guest created via B<xm> create <XMLFILE>.
B<Example>
virsh dumpxml <domain-id> > file.
=item B<define> I<FILE>
Define a domain from an XML <file>. The domain definitions is registered
but not started.
=item B<destroy> I<domain-id>
Immediately terminate the domain domain-id. 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 B<dominfo> I<domain-id>
Returns basic information about the domain.
=item B<domuuid> I<domain-name-or-id>
Convert a domain name or id to domain UUID
=item B<domid> I<domain-name>
Converts a domain name to a domain id using xend's internal mapping.
=item B<dominfo> I<domain-id>
Returns basic information about the domain.
=item B<domname> I<domain-id>
convert a domain Id to domain name
=item B<domstate> I<domain-id>
Returns state about a running domain.
=item B<dumpxml> I<domain-id>
Ouput the domain informations as an XML dump to stdout, this format can be used by the B<create> command.
quit this interactive terminal
=item B<reboot> I<domain-id> =item B<reboot> I<domain-id>
@ -197,6 +287,24 @@ This is roughly equivalent to doing a hibernate on a running computer,
with all the same limitations. Open network connections may be with all the same limitations. Open network connections may be
severed upon restore, as TCP timeouts may have expired. severed upon restore, as TCP timeouts may have expired.
=item B<setmem> I<domain-id> B<kilobytes>
Change the current memory allocation in the guest domain. This should take
effect immediately. The memory limit is specified in
kilobytes.
=item B<setmaxmem> I<domain-id> B<kilobytes>
Change the maximum memory allocation limit in the guest domain. This should
not change the current memory use. The memory limit is specified in
kilobytes.
=item B<setvcpus> I<domain-id> I<count>
Change the number of virtual CPUs active in the guest domain. Note that
I<count> may be limited by host, hypervisor or limit coming from the
original description of domain.
=item B<shutdown> I<domain-id> =item B<shutdown> I<domain-id>
Gracefully shuts down a domain. This coordinates with the domain OS Gracefully shuts down a domain. This coordinates with the domain OS
@ -208,31 +316,147 @@ For a xen guest vm the behavior of what happens to a domain when it reboots is s
I<on_shutdown> parameter of the xmdomain.cfg file when the domain was I<on_shutdown> parameter of the xmdomain.cfg file when the domain was
created. created.
=item B<suspend> I<domain-id>
Suspend a running domain. It is kept in memory but won't be scheduled
anymore.
=item B<resume> I<domain-id> =item B<resume> I<domain-id>
Moves a domain out of the paused state. This will allow a previously Moves a domain out of the suspended state. This will allow a previously
paused domain to now be eligible for scheduling by the the under lying hypervisor. suspended domain to now be eligible for scheduling by the the underlying
hypervisor.
=item B<version> =item B<undefine> I<domain-id>
Will print out the major version info about what this built from. Undefine the configuration for an inactive domain. Since it's not running
the domain name or UUId must be used as the I<domain-id>.
=over 8 =item B<vcpuinfo> I<domain-id>
B<Example> Returns basic information about the domain virtual CPUs, like the number of
vCPUs, the running time, the affinity to physical processors.
B<virsh> version =item B<vcpupin> I<domain-id> I<vcpu> I<cpulist>
Compiled against library: libvir 0.0.6 Pin domain VCPUs to host physical CPUs. The I<vcpu> number must be provided
and I<cpulist> is a comma separated list of physical CPU numbers.
Using library: libvir 0.0.6 =item B<vncdisplay> I<domain-id>
Using API: Xen 3.0.0 Output the IP address and port number for the VNC display.
Running hypervisor: Xen 3.0.0
=back =back
=head1 DEVICES COMMANDS
The following commands manipulate devices associated to domains.
The domain-id can be specified as an short integer, a name or a full UUID.
To better understand the values allowed as options for the command
reading the documentation at L<http://libvirt.org/format.html> on the
format of the device sections to get the most accurate set of accepted values.
=over 4
=item B<attach-device> I<domain-id> I<FILE>
Attach a device to the domain, using a device definition in an XML file.
See the documentation to learn about libvirt XML format for a device.
=item B<attach-disk> I<domain-id> I<source> I<target> optional I<--driver driver> I<--subdriver subdriver> I<--type type> I<--mode mode>
Attach a new disk device to the domain.
I<source> and I<target> are paths for the files and devices.
I<driver> can be I<file>, I<tap> or I<phy> depending on the kind of access.
I<type> can indicate I<cdrom> or I<floppy> as alternative to the disk default.
I<mode> can specify the two specific mode I<readonly> or I<shareable>.
=item B<attach-interface> I<domain-id> I<type> I<source> optional I<--target target> I<--mac mac> I<--script script>
Attach a new network interface to the domain.
I<type> can be either I<network> to indicate a physical network device or I<bridge> to indicate a bridge to a device.
I<source> indicates the source device.
I<target> allows to indicate the target device in the guest.
I<mac> allows to specify the MAC address of the network interface.
I<script> allows to specify a path to a script handling a bridge instead of
the default one.
=item B<detach-device> I<domain-id> I<FILE>
Detach a device from the domain, takes the same kind of XML descriptions
as command B<attach-device>.
=item B<detach-disk> I<domain-id> I<target>
Detach a disk device from a domain. The I<target> is the device as seen
from the domain.
=item B<detach-interface> I<domain-id> I<type> optional I<--mac mac>
Detatch a network interface from a domain.
I<type> can be either I<network> to indicate a physical network device or I<bridge> to indicate a bridge to a device.
It is recommended to use the I<mac> option to distinguish between the interfaces
if more than one are present on the domain.
=back
=head1 VIRTUAL NETWORKS COMMANDS
The following commands manipulate networks. Libvirt has the capability to
define virtual networks which can then be used by domains and linked to
actual network dvices. For more detailed informations about this feature
see the documentation at L<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 UUID.
=over 4
=item B<net-autostart> I<network> optional I<--disable>
Configure a virtual network to be automatically started at boot.
The I<--disable> option disable autostarting.
=item B<net-create> I<file>
Create a virtual network from an XML I<file>, see the documentation to get
a description of the XML network format used by libvirt.
=item B<net-define> I<file>
Define a virtual network from an XML I<file>, the network is just defined but
not instanciated.
=item B<net-destroy> I<network>
Destroy a given virtual network specified by its name or UUID. This takes
effect immediately.
=item B<net-dumpxml> I<network>
Output the virtual network information as an XML dump to stdout.
=item B<net-list> optional I<--inactive> or I<--all>
Returns the list of active networks, if I<--all> is specified this will also
include defined but inactive networks, if I<--inactive> is specified only the
inactive ones will be listed.
=item B<net-name> I<network-UUID>
Convert a network UUID to network name.
=item B<net-start> I<network>
Start a (previously defined) inactive network.
=item B<net-undefine> I<network>
Undefine the configuration for an inactive network.
=item B<net-uuid> I<network-name>
Convert a network name to network UUID.
=back =back
=head1 SEE ALSO =head1 SEE ALSO

407
virsh.1
View File

@ -1,4 +1,4 @@
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
.\" .\"
.\" Standard preamble: .\" Standard preamble:
.\" ======================================================================== .\" ========================================================================
@ -128,8 +128,8 @@
.rm #[ #] #H #V #F C .rm #[ #] #H #V #F C
.\" ======================================================================== .\" ========================================================================
.\" .\"
.IX Title "VIRSH.POD.1 1" .IX Title "VIRSH 1"
.TH VIRSH.POD.1 1 "2006-04-06" "perl v5.8.6" "User Contributed Perl Documentation" .TH VIRSH 1 "2007-06-21" "perl v5.8.8" "Virtualization Support"
.SH "NAME" .SH "NAME"
virsh \- management user interface virsh \- management user interface
.SH "SYNOPSIS" .SH "SYNOPSIS"
@ -138,75 +138,115 @@ virsh <subcommand> [args]
.SH "DESCRIPTION" .SH "DESCRIPTION"
.IX Header "DESCRIPTION" .IX Header "DESCRIPTION"
The \fBvirsh\fR program is the main interface for managing virsh guest The \fBvirsh\fR program is the main interface for managing virsh guest
domains. The program can be used to create, suspend, resume, save, and shutdown domains. The program can be used to create, pause, and shutdown
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\s0 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\s0 initially for the Xen paravirtualization but should be able to integrate other virtualization mechanisms if needed. domains. It can also be used to list current domains. Libvirt is a C toolkit to interract with the virtualization capabilities of recent versions of Linux (and other OSes). It is free software available under the \s-1GNU\s0 Lesser General Public License. Virtualization of the Linux Operating System means the ability to run multiple instances of Operating Systems concurently 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\s0 initially for the Xen paravirtualization but should be able to integrate other virtualization mechanisms, it currently also support QEmu and \s-1KVM\s0.
.PP .PP
The basic structure of every virsh command is almost always: The basic structure of most virsh usage is:
.PP .PP
.Vb 1 .Vb 1
\& virsh <subcommand> <domain-id|name|uuid> [OPTIONS] \& virsh <command> <domain-id> [OPTIONS]
.Ve .Ve
.PP .PP
Where \fIsubcommand\fR is one of the sub commands listed below, \fIdomain-id\fR Where \fIcommand\fR is one of the commands listed below, \fIdomain-id\fR
is the numeric domain id, or the domain name (which will be internally is the numeric domain id, or the domain name (which will be internally
translated to domain id), and \fI\s-1OPTIONS\s0\fR are sub command specific translated to domain id), and \fI\s-1OPTIONS\s0\fR are command specific
options. There are a few exceptions to this rule in the cases where 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, the command in question acts on all domains, the entire machine,
or directly on the xen hypervisor. Those exceptions will be explained for or directly on the xen hypervisor. Those exceptions will be clear for
each of those sub commands. each of those commands.
.PP
The \fBvirsh\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 \fBquit\fR command will then exit
the program.
.SH "NOTES" .SH "NOTES"
.IX Header "NOTES" .IX Header "NOTES"
All \fBvirsh\fR operations rely upon the libvirt library. All \fBvirsh\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. For any virsh commands to run xend/qemu, or what ever virtual library that libvirt suports. 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
\&\fBservice start libvirtd\fR .
.PP .PP
Most \fBvirsh\fR commands require root privledges to run due to the Most \fBvirsh\fR commands require root privledges to run due to the
communications channels used to talk to the hypervisor. Running as communications channels used to talk to the hypervisor. Running as
non root will return an error. non root will return an error.
.PP .PP
Most \fBvirsh\fR commands act asynchronously, so just because the \fBvirsh\fR Most \fBvirsh\fR commands act asynchronously, so just because the \fBvirsh\fR
command returned, doesn't mean the action is complete. This is program returned, doesn't mean the action is complete. This is
important, as many operations on domains, like create and shutdown, important, as many operations on domains, like create and shutdown,
can take considerable time (30 seconds or more) to bring the machine 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 into a fully compliant state. If you want to know when one of these
actions has finished you must poll through virsh list periodically. actions has finished you must poll through virsh list periodically.
.SH "DOMAIN SUBCOMMANDS" .SH "GENERIC COMMANDS"
.IX Header "DOMAIN SUBCOMMANDS" .IX Header "GENERIC COMMANDS"
The following sub commands manipulate domains directly, as stated The following commands are generic i.e. not specific to a domain.
previously most commands take domain-id as the first parameter. .IP "\fBhelp\fR optional \fIcommand\fR" 4
.IP "\fBconnect\fR optional \fI\-\-readonly\fR" 4 .IX Item "help optional command"
.IX Item "connect optional --readonly" This prints a small synoposis about all commands available for \fBvirsh\fR
Connect to local hypervisor. This is build-in command after shell start up. \&\fBhelp\fR \fIcommand\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"
Will print out the major version info about what this built from.
.RS 4
.Sp .Sp
The \fI\-\-readonly\fR option read-only connection .RS 4
.IP "\fBcreate\fR \fI\s-1FILE\s0\fR" 4 \&\fBExample\fR
.IX Item "create FILE"
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>.
.IP "\fBdumpxml\fR \fIdomain-name, id or uuid\fR" 4
.IX Item "dumpxml domain-name, id or uuid"
Ouput the domain informations as an \s-1XML\s0 dump to stdout, this format can be used by the create sub command.
.IP "\fBdestroy\fR \fIdomain-name, id or uuid\fR" 4
.IX Item "destroy domain-name, id or uuid"
Immediately terminate the domain domain\-id. This doesn't give the domain
\&\s-1OS\s0 any chance to react, and it is the equivalent of ripping the power
cord out on a physical machine. In most cases you will want to use
the \fBshutdown\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.
.IP "\fBdominfo\fR \fIdomain-name, id or uuid\fR" 4
.IX Item "dominfo domain-name, id or uuid"
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
.IP "\fBdomstate\fR \fIdomain-name, id or uuid\fR" 4
.IX Item "domstate domain-name, id or uuid"
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 .Sp
\&\fBhelp\fR \fIsubcommand\fR will print out a detailed help message on that sub command \&\fBvirsh\fR version
.Sp
Compiled against library: libvir 0.0.6
.Sp
Using library: libvir 0.0.6
.Sp
Using \s-1API:\s0 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\s0\fR parameter specifying how to connect
to the hypervisor. The documentation page at <http://libvirt.org/uri.html>
list the values supported but the most commons are:
.RS 4
.IP "xen///" 4
.IX Item "xen///"
this is used to connect to the local Xen hypervisor, this is the default
.IP "qemu:///system" 4
.IX Item "qemu:///system"
allow to connect locally as root to the daemon supervizing QEmu domains
.IP "qemu:///session" 4
.IX Item "qemu:///session"
allow to connect locally as a normal user to the his own set of QEmu domain
.IP "kvm:///system" 4
.IX Item "kvm:///system"
allow to connect locally as root to the daemon supervizing \s-1KVM\s0 domains
.IP "kvm:///session" 4
.IX Item "kvm:///session"
allow to connect locally as a normal user to the his own set of \s-1KVM\s0 domain
.RE
.RS 4
.Sp
For remote access see the documetnation page on how to make URIs.
The \fI\-\-readonly\fR option allows for read-only connection
.RE
.IP "\fBnodeinfo\fR" 4
.IX Item "nodeinfo"
Returns basic information about the node, like number and type of \s-1CPU\s0,
and size of the physical memory.
.IP "\fBcapabilities\fR" 4
.IX Item "capabilities"
Print an \s-1XML\s0 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\s0 and features, and a set of description
for each kind of guest which can be virtualized. For a more complete
description see the description at:
<http://libvirt.org/format.html#Capa1>
.IP "\fBlist\fR" 4 .IP "\fBlist\fR" 4
.IX Item "list" .IX Item "list"
Prints information about one or more domains. If no domains are Prints information about one or more domains. If no domains are
@ -235,47 +275,93 @@ The State field lists 6 states for a Xen Domain, and which ones the
current Domain is in. current Domain is in.
=back =back
.RE .RE
.IP "\fBrunning\fR" 4 .IP "\fBr \- running\fR" 4
.IX Item "running" .IX Item "r - running"
The domain is currently running on a \s-1CPU\s0 The domain is currently running on a \s-1CPU\s0
.IP "\fBblocked\fR" 4 .IP "\fBb \- blocked\fR" 4
.IX Item "blocked" .IX Item "b - blocked"
The domain is blocked, and not running or runable. This can be caused The domain is blocked, and not running or runable. This can be caused
because the domain is waiting on \s-1IO\s0 (a traditional wait state) or has because the domain is waiting on \s-1IO\s0 (a traditional wait state) or has
gone to sleep because there was nothing else for it to do. gone to sleep because there was nothing else for it to do.
.IP "\fBpaused\fR" 4 .IP "\fBp \- paused\fR" 4
.IX Item "paused" .IX Item "p - paused"
The domain has been paused, usually occurring through the administrator The domain has been paused, usually occurring through the administrator
running \fBvirsh suspend\fR. When in a suspend state the domain will still running \fBxm pause\fR. When in a paused state the domain will still
consume allocated resources like memory, but will not be eligible for consume allocated resources like memory, but will not be eligible for
scheduling by the Xen hypervisor. scheduling by the Xen hypervisor.
.IP "\fBin shutdown\fR" 4 .IP "\fBs \- shutdown\fR" 4
.IX Item "in shutdown" .IX Item "s - shutdown"
The domain is in process of dying, but hasn't completely shutdown or The domain is in the process of shutting down, i.e. the guest operating system
crashed. has been notified and should be in the process of stopping its operations
.IP "\fBshut off\fR" 4 gracefully.
.IX Item "shut off" .IP "\fBc \- crashed\fR" 4
The domain is down. .IX Item "c - crashed"
.IP "\fBcrashed\fR" 4
.IX Item "crashed"
The domain has crashed, which is always a violent ending. Usually The domain has crashed, which is always a violent ending. Usually
this state can only occur if the domain has been configured not to this state can only occur if the domain has been configured not to
restart on crash. See xmdomain.cfg for more info. restart on crash. See xmdomain.cfg for more info.
.IP "\fBd \- dying\fR" 4
.IX Item "d - dying"
The domain is in process of dying, but hasn't completely shutdown or
crashed.
.RE .RE
.RS 4 .RS 4
.RE .SH "DOMAIN COMMANDS"
.IP "\fBnodeinfo\fR \fIdomain-name, id or uuid\fR" 4 .IX Header "DOMAIN COMMANDS"
.IX Item "nodeinfo domain-name, id or uuid" The following commands manipulate domains directly, as stated
Returns basic information about the node. previously most commands take domain-id as the first parameter. The
.IP "\fBquit\fR" 4 \&\fIdomain-id\fR can be specified as an short integer, a name or a full \s-1UUID\s0.
.IX Item "quit" .IP "\fBautostart\fR optional \fI\-\-\-\-disable\fR \fIdomain-id\fR" 4
quit this interactive terminal .IX Item "autostart optional ----disable domain-id"
.IP "\fBreboot\fR \fIdomain-name, id or uuid\fR" 4 Configure a domain to be automatically started at boot.
.IX Item "reboot domain-name, id or uuid" .Sp
The option \fI\-\-\-\-disable\fR disable autostarting.
.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"
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>.
.Sp
\&\fBExample\fR
.Sp
virsh dumpxml <domain\-id> > file.
.IP "\fBdefine\fR \fI\s-1FILE\s0\fR" 4
.IX Item "define FILE"
Define a domain from an \s-1XML\s0 <file>. The domain definitions is registered
but not started.
.IP "\fBdestroy\fR \fIdomain-id\fR" 4
.IX Item "destroy domain-id"
Immediately terminate the domain domain\-id. This doesn't give the domain
\&\s-1OS\s0 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 \fBshutdown\fR command instead.
.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\s0
.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.
.IP "\fBdominfo\fR \fIdomain-id\fR" 4
.IX Item "dominfo domain-id"
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
.IP "\fBdomstate\fR \fIdomain-id\fR" 4
.IX Item "domstate domain-id"
Returns state about a running domain.
.IP "\fBdumpxml\fR \fIdomain-id\fR" 4
.IX Item "dumpxml domain-id"
Ouput the domain informations as an \s-1XML\s0 dump to stdout, this format can be used by the \fBcreate\fR command.
.IP "\fBreboot\fR \fIdomain-id\fR" 4
.IX Item "reboot domain-id"
Reboot a domain. This acts just as if the domain had the \fBreboot\fR Reboot a domain. This acts just as if the domain had the \fBreboot\fR
command run from the console. The command returns as soon as it has command run from the console. The command returns as soon as it has
started the reboot action, but it may take significantly longuer before executed the reboot action, which may be significantly before the
the domain actually reboots. domain actually reboots.
.Sp .Sp
For xen vm the behavior of what happens to a domain when it reboots is set by the For xen vm the behavior of what happens to a domain when it reboots is set by the
\&\fIon_reboot\fR parameter of the xmdomain.cfg file when the domain was \&\fIon_reboot\fR parameter of the xmdomain.cfg file when the domain was
@ -283,8 +369,8 @@ created.
.IP "\fBrestore\fR \fIstate-file\fR" 4 .IP "\fBrestore\fR \fIstate-file\fR" 4
.IX Item "restore state-file" .IX Item "restore state-file"
Restores a domain from an \fBvirsh save\fR state file. See \fIsave\fR for more info. Restores a domain from an \fBvirsh save\fR state file. See \fIsave\fR for more info.
.IP "\fBsave\fR \fIdomain-name, id or uuid\fR \fIstate-file\fR" 4 .IP "\fBsave\fR \fIdomain-id\fR \fIstate-file\fR" 4
.IX Item "save domain-name, id or uuid state-file" .IX Item "save domain-id state-file"
Saves a running domain to a state file so that it can be restored 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 later. Once saved, the domain will no longer be running on the
system, thus the memory allocated for the domain will be free for system, thus the memory allocated for the domain will be free for
@ -293,8 +379,23 @@ other domains to use. \fBvirsh restore\fR restores from this state file.
This is roughly equivalent to doing a hibernate on a running computer, This is roughly equivalent to doing a hibernate on a running computer,
with all the same limitations. Open network connections may be with all the same limitations. Open network connections may be
severed upon restore, as \s-1TCP\s0 timeouts may have expired. severed upon restore, as \s-1TCP\s0 timeouts may have expired.
.IP "\fBshutdown\fR \fIdomain-name, id or uuid\fR" 4 .IP "\fBsetmem\fR \fIdomain-id\fR \fBkilobytes\fR" 4
.IX Item "shutdown domain-name, id or uuid" .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.
.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
not change the current memory use. The memory limit is specified in
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
\&\fIcount\fR may be limited by host, hypervisor or limit coming from the
original description of domain.
.IP "\fBshutdown\fR \fIdomain-id\fR" 4
.IX Item "shutdown domain-id"
Gracefully shuts down a domain. This coordinates with the domain \s-1OS\s0 Gracefully shuts down a domain. This coordinates with the domain \s-1OS\s0
to perform graceful shutdown, so there is no guaruntee that it will to perform graceful shutdown, so there is no guaruntee that it will
succeed, and may take a variable length of time depending on what succeed, and may take a variable length of time depending on what
@ -303,41 +404,129 @@ services must be shutdown in the domain.
For a xen guest vm the behavior of what happens to a domain when it reboots is set by the For a xen guest vm the behavior of what happens to a domain when it reboots is set by the
\&\fIon_shutdown\fR parameter of the xmdomain.cfg file when the domain was \&\fIon_shutdown\fR parameter of the xmdomain.cfg file when the domain was
created. created.
.IP "\fBsuspend\fR \fIdomain-name, id or uuid\fR" 4 .IP "\fBsuspend\fR \fIdomain-id\fR" 4
.IX Item "suspend domain-name, id or uuid" .IX Item "suspend domain-id"
Suspend a domain. When in a suspened state the domain will still consume allocated resources Suspend a running domain. It is kept in memory but won't be scheduled
such as memory, but will not be eligible for scheduling by the Xen hypervisor. anymore.
.IP "\fBresume\fR \fIdomain-name, id or uuid\fR" 4 .IP "\fBresume\fR \fIdomain-id\fR" 4
.IX Item "resume domain-name, id or uuid" .IX Item "resume domain-id"
Moves a domain out of the paused state. This will allow a previously Moves a domain out of the suspended state. This will allow a previously
paused domain to now be eligible for scheduling by the the under lying hypervisor. suspended domain to now be eligible for scheduling by the the underlying
.IP "\fBversion\fR" 4 hypervisor.
.IX Item "version" .IP "\fBundefine\fR \fIdomain-id\fR" 4
Will print out the major version info about what this built from. .IX Item "undefine domain-id"
.RS 4 Undefine the configuration for an inactive domain. Since it's not running
.Sp the domain name or UUId must be used as the \fIdomain-id\fR.
.RS 4 .IP "\fBvcpuinfo\fR \fIdomain-id\fR" 4
\&\fBvirsh\fR version .IX Item "vcpuinfo domain-id"
.Sp Returns basic information about the domain virtual CPUs, like the number of
Compiled against library: libvir 0.0.6 vCPUs, the running time, the affinity to physical processors.
.Sp .IP "\fBvcpupin\fR \fIdomain-id\fR \fIvcpu\fR \fIcpulist\fR" 4
Using library: libvir 0.0.6 .IX Item "vcpupin domain-id vcpu cpulist"
.Sp Pin domain VCPUs to host physical CPUs. The \fIvcpu\fR number must be provided
Using \s-1API:\s0 Xen 3.0.0 and \fIcpulist\fR is a comma separated list of physical \s-1CPU\s0 numbers.
.Sp .IP "\fBvncdisplay\fR \fIdomain-id\fR" 4
Running hypervisor: Xen 3.0.0 .IX Item "vncdisplay domain-id"
Output the \s-1IP\s0 address and port number for the \s-1VNC\s0 display.
.RE .RE
.RS 4
.SH "DEVICES COMMANDS"
.IX Header "DEVICES COMMANDS"
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\s0.
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\s0 file.
See the documentation to learn about libvirt \s-1XML\s0 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.
\&\fIsource\fR and \fItarget\fR are paths for the files and devices.
\&\fIdriver\fR can be \fIfile\fR, \fItap\fR or \fIphy\fR depending on the kind of access.
\&\fItype\fR can indicate \fIcdrom\fR or \fIfloppy\fR as alternative to the disk default.
\&\fImode\fR can specify the two specific mode \fIreadonly\fR or \fIshareable\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.
\&\fItype\fR can be either \fInetwork\fR to indicate a physical network device or \fIbridge\fR to indicate a bridge to a device.
\&\fIsource\fR indicates the source device.
\&\fItarget\fR allows to indicate the target device in the guest.
\&\fImac\fR allows to specify the \s-1MAC\s0 address of the network interface.
\&\fIscript\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\s0 descriptions
as command \fBattach-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 \fItarget\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"
Detatch a network interface from a domain.
\&\fItype\fR can be either \fInetwork\fR to indicate a physical network device or \fIbridge\fR to indicate a bridge to a device.
It is recommended to use the \fImac\fR option to distinguish between the interfaces
if more than one are present on the domain.
.RE
.RS 4
.SH "VIRTUAL NETWORKS COMMANDS"
.IX Header "VIRTUAL NETWORKS COMMANDS"
The following commands manipulate networks. Libvirt has the capability to
define virtual networks which can then be used by domains and linked to
actual network dvices. For more detailed informations about this feature
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\s0.
.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\s0 \fIfile\fR, see the documentation to get
a description of the \s-1XML\s0 network format used by libvirt.
.IP "\fBnet-define\fR \fIfile\fR" 4
.IX Item "net-define file"
Define a virtual network from an \s-1XML\s0 \fIfile\fR, the network is just defined but
not instanciated.
.IP "\fBnet-destroy\fR \fInetwork\fR" 4
.IX Item "net-destroy network"
Destroy a given virtual network specified by its name or \s-1UUID\s0. 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\s0 dump to stdout.
.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\s0 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\s0.
.RE .RE
.RS 4 .RS 4
.SH "SEE ALSO" .SH "SEE ALSO"
.IX Header "SEE ALSO" .IX Header "SEE ALSO"
\&\fIxm\fR\|(1), \fIxmdomain.cfg\fR\|(5), \fIxentop\fR\|(1) , <http://www.libvirt.org<sol>> \&\fIxm\fR\|(1), \fIxmdomain.cfg\fR\|(5), \fIxentop\fR\|(1) , <http://www.libvirt.org/>
.SH "AUTHOR" .SH "AUTHOR"
.IX Header "AUTHOR" .IX Header "AUTHOR"
.Vb 2 .Vb 2
\& Andrew Puch <apuch @ redhat.com> \& Andrew Puch <apuch @ redhat.com>
\& Daniel Veillard <veillard @ redhat.com> \& Daniel Veillard <veillard @ redhat.com>
\& Karel Zak <kzak @ redhat.com>
.Ve .Ve
.Sp .Sp
.Vb 3 .Vb 3
@ -347,5 +536,9 @@ Running hypervisor: Xen 3.0.0
.Ve .Ve
.SH "BUGS" .SH "BUGS"
.IX Header "BUGS" .IX Header "BUGS"
Can be seen on the RedHat buzilla page under the libvirt Bugs can be view on the RedHat buzilla page under the libvirt
<https://bugzilla.redhat.com/> <https://bugzilla.redhat.com/>
.Sp
<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>
.Sp
=