diff --git a/ChangeLog b/ChangeLog index 46dc968e49..9d13e710ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Thu Jun 21 16:59:02 CEST 2007 Daniel Veillard + + * 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 * docs/virsh.pod: commit of original POD file for virsh man page diff --git a/docs/Makefile.am b/docs/Makefile.am index 843d8752bf..4a884852af 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -17,6 +17,9 @@ 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 web: $(PAGES) diff --git a/docs/virsh.pod b/docs/virsh.pod index bbdf92710e..7ee5c5c814 100644 --- a/docs/virsh.pod +++ b/docs/virsh.pod @@ -10,94 +10,125 @@ virsh [args] The B program is the main interface for managing virsh guest 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 [OPTIONS] + virsh [OPTIONS] -Where I is one of the sub commands listed below, I +Where I is one of the commands listed below, I is the numeric domain id, or the domain name (which will be internally -translated to domain id), and I are sub command specific +translated to domain id), and I are 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, +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 sub commands. +each of those commands. + +The B 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 command will then exit +the program. =head1 NOTES -All B opperations 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. +All B 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. This can usually be done using the command +B . Most B 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. Most B commands act asynchronously, so just because the B -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, 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. -=head1 DOMAIN SUBCOMMANDS +=head1 GENERIC COMMANDS -The following sub commands manipulate domains directly, as stated -previously most commands take domain-id as the first parameter. +The following commands are generic i.e. not specific to a domain. =over 4 -=item B optional I<--readonly> +=item B optional I -Connect to local hypervisor. This is build-in command after shell start up. +This prints a small synoposis about all commands available for B +B I will print out a detailed help message on that command. -The I<--readonly> option read-only connection +=item B -=item B I +quit this interactive terminal -Create a domain from an XML an easy way to create one if you have a pre-existing xen guest created via B create . +=item B -B +Will print out the major version info about what this built from. -virsh dumpxml to a file. +=over 4 -=item B I +B -Returns basic information about the domain. +B version -=item B I +Compiled against library: libvir 0.0.6 -Ouput the domain informations as an XML dump to stdout, this format can be used by the create sub command. +Using library: libvir 0.0.6 +Using API: Xen 3.0.0 -=item B I +Running hypervisor: Xen 3.0.0 -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 command instead. +=back -=item B I +=item B I optional I<--readonly> -Converts a domain name to a domain id using xend's internal mapping. +(Re)-Connect to the hypervisor. This is a build-in command after shell +start up, and usually get an I parameter specifying how to connect +to the hypervisor. The documentation page at L +list the values supported but the most commons are: -=item B I +=over 4 -Returns basic information about the domain. +=item xen/// -=item B I +this is used to connect to the local Xen hypervisor, this is the default -convert a domain Id to domain name +=item qemu:///system -=item B I +allow to connect locally as root to the daemon supervizing QEmu domains -Returns state about a running domain. +=item qemu:///session -=item B optional I +allow to connect locally as a normal user to the his own set of QEmu domain -Displays the short help message (i.e. common commands). +=item kvm:///system -B I will print out a detailed help message on that sub command +allow to connect locally as root to the daemon supervizing KVM domains + +=item kvm:///session + +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 + +Returns basic information about the node, like number and type of CPU, +and size of the physical memory. + +=item B + +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 =item B @@ -146,7 +177,9 @@ scheduling by the Xen hypervisor. =item B -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 @@ -159,17 +192,74 @@ restart on crash. See L for more info. The domain is in process of dying, but hasn't completely shutdown or crashed. -FIXME: Is this right? - =back -=item B I +=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 can be specified as an short integer, a name or a full UUID. -=item B +=over 4 + +=item B optional I<----disable> I + +Configure a domain to be automatically started at boot. + +The option I<----disable> disable autostarting. + +=item B I + +Connect the virtual serial console for the guest. + +=item B I + +Create a domain from an XML an easy way to create one if you have a pre-existing xen guest created via B create . + +B + +virsh dumpxml > file. + +=item B I + +Define a domain from an XML . The domain definitions is registered +but not started. + +=item B I + +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 command instead. + +=item B I + +Returns basic information about the domain. + +=item B I + +Convert a domain name or id to domain UUID + +=item B I + +Converts a domain name to a domain id using xend's internal mapping. + +=item B I + +Returns basic information about the domain. + +=item B I + +convert a domain Id to domain name + +=item B I + +Returns state about a running domain. + +=item B I + +Ouput the domain informations as an XML dump to stdout, this format can be used by the B command. -quit this interactive terminal =item B I @@ -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 severed upon restore, as TCP timeouts may have expired. +=item B I B + +Change the current memory allocation in the guest domain. This should take +effect immediately. The memory limit is specified in +kilobytes. + +=item B I B + +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 I I + +Change the number of virtual CPUs active in the guest domain. Note that +I may be limited by host, hypervisor or limit coming from the +original description of domain. + =item B I 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 parameter of the xmdomain.cfg file when the domain was created. +=item B I + +Suspend a running domain. It is kept in memory but won't be scheduled +anymore. =item B I -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. +Moves a domain out of the suspended state. This will allow a previously +suspended domain to now be eligible for scheduling by the the underlying +hypervisor. -=item B +=item B I -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. -=over 8 +=item B I -B +Returns basic information about the domain virtual CPUs, like the number of +vCPUs, the running time, the affinity to physical processors. -B version +=item B I I I -Compiled against library: libvir 0.0.6 +Pin domain VCPUs to host physical CPUs. The I number must be provided +and I is a comma separated list of physical CPU numbers. -Using library: libvir 0.0.6 +=item B I -Using API: Xen 3.0.0 - -Running hypervisor: Xen 3.0.0 +Output the IP address and port number for the VNC display. =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 on the +format of the device sections to get the most accurate set of accepted values. + +=over 4 + +=item B I I + +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 I I I optional I<--driver driver> I<--subdriver subdriver> I<--type type> I<--mode mode> + +Attach a new disk device to the domain. +I and I are paths for the files and devices. +I can be I, I or I depending on the kind of access. +I can indicate I or I as alternative to the disk default. +I can specify the two specific mode I or I. + +=item B I I I optional I<--target target> I<--mac mac> I<--script script> + +Attach a new network interface to the domain. +I can be either I to indicate a physical network device or I to indicate a bridge to a device. +I indicates the source device. +I allows to indicate the target device in the guest. +I allows to specify the MAC address of the network interface. +I