From: Ian Campbell Subject: Re: [PATCH DOCDAY] introduce an xl man page in pod format Date: Mon, 31 Oct 2011 09:25:37 +0000 Message-ID: <1320053137.23193.9.camel@zakaz.uk.xensource.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Stefano Stabellini Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Thu, 2011-10-27 at 17:19 +0100, Stefano Stabellini wrote: > This is the initial version of an xl man page, based on the old xm man > page. > Almost every command implemented in xl should be present, a notable > exception are the tmem commands that are currently missing. > Further improvements and clarifications to this man page are very welcome. I had a thought over the weekend... It took me a while to get used to but the git style of a manpage per subcommand and having "git COMMAND --help" spawn man of that page works really well. A long list of subcommands such as this gets a bit unwieldy. Having a page per command also means you can take advantage of e.g. a SEE ALSO for each command individually and things like that. I think you've got all the content already it's just a matter of separating it. If we were feeling sneaky we could probably arrange for the build to fail if no man page is available for a command listed in xl_cmdtable.c };-) Ian. > > Signed-off-by: Stefano Stabellini > > diff -r 39aa9b2441da docs/man/xl.pod.1 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 > +++ b/docs/man/xl.pod.1 Thu Oct 27 15:59:03 2011 +0000 > @@ -0,0 +1,805 @@ > +=head1 NAME > + > +XL - Xen management tool, based on LibXenlight > + > +=head1 SYNOPSIS > + > +B I [I] > + > +=head1 DESCRIPTION > + > +The B program is the new tool for managing Xen guest > +domains. The program can be used to create, pause, and shutdown > +domains. It can also be used to list current domains, enable or pin > +VCPUs, and attach or detach virtual block devices. > +The old B tool is deprecated and should not be used. > + > +The basic structure of every B command is almost always: > + > +=over 2 > + > +B I [I] I > + > +=back > + > +Where I is one of the subcommands listed below, I > +is the numeric domain id, or the domain name (which will be internally > +translated to domain id), and I are subcommand specific > +options. There are a few exceptions to this rule in the cases where > +the subcommand in question acts on all domains, the entire machine, > +or directly on the Xen hypervisor. Those exceptions will be clear for > +each of those subcommands. > + > +=head1 NOTES > + > +Most B operations rely upon B and B: make > +sure you start the script B at boot time to > +initialize all the daemons needed by B. > + > +In the most common network configuration, you need to setup a bridge in dom0 > +named B in order to have a working network in the guest domains. > +Please refer to the documentation of your Linux distribution to know how to > +setup the bridge. > + > +Most B commands require root privileges to run due to the > +communications channels used to talk to the hypervisor. Running as > +non root will return an error. > + > +=head1 DOMAIN SUBCOMMANDS > + > +The following subcommands manipulate domains directly. As stated > +previously, most commands take I as the first parameter. > + > +=over 4 > + > +=item B [I] I > + > +The create subcommand requires a config file: see L for > +full details of that file format and possible options. > + > +I can either be an absolute path to a file, or a relative > +path to a file located in /etc/xen. > + > +Create will return B as the domain is started. This B +not> mean the guest OS in the domain has actually booted, or is > +available for input. > + > +B > + > +=over 4 > + > +=item B<-q>, B<--quiet> > + > +No console output. > + > +=item B<-f=FILE>, B<--defconfig=FILE> > + > +Use the given configuration file. > + > +=item B<-n>, B<--dryrun> > + > +Dry run - prints the resulting configuration in SXP but does not create > +the domain. > + > +=item B<-p> > + > +Leave the domain paused after it is created. > + > +=item B<-c> > + > +Attach console to the domain as soon as it has started. This is > +useful for determining issues with crashing domains. > + > +=back > + > +B > + > +=over 4 > + > +=item I > + > + xl create DebianLenny > + > +This creates a domain with the file /etc/xen/DebianLenny, and returns as > +soon as it is run. > + > +=back > + > +=item B I > + > +Attach to domain I's console. If you've set up your domains to > +have a traditional log in console this will look much like a normal > +text log in screen. > + > +Use the key combination Ctrl+] to detach the domain console. > + > +=item B [I] I > + > +Attach to domain's VNC server, forking a vncviewer process. > + > +B > + > +=over 4 > + > +=item I<--autopass> > + > +Pass VNC password to vncviewer via stdin. > + > +=back > + > +=item B I > + > +Immediately terminate the domain I. This doesn't give the > +domain OS any chance to react, and is 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 > + > +Converts a domain name to a domain id. > + > +=item B I > + > +Converts a domain id to a domain name. > + > +=item B I I > + > +Change the domain name of I to I. > + > +=item B I [I] > + > +Dumps the virtual machine's memory for the specified domain to the > +I specified, without pausing the domain. The dump file will > +be written to a distribution specific directory for dump files. Such > +as: /var/lib/xen/dump or /var/xen/dump. > + > +=item B [I<--long>] > + > +Displays the short help message (i.e. common commands). > + > +The I<--long> option prints out the complete set of B subcommands, > +grouped by function. > + > +=item B [I] [I ...] > + > +Prints information about one or more domains. If no domains are > +specified it prints out information about all domains. > + > + > +B > + > +=over 4 > + > +=item B<-l>, B<--long> > + > +The output for B is not the table view shown below, but > +instead presents the data in SXP compatible format. > + > +=item B<-Z>, B<--context> > +Also prints the security labels. > + > +=item B<-v>, B<--verbose> > + > +Also prints the domain UUIDs, the shutdown reason and security labels. > + > +=back > + > +B > + > +An example format for the list is as follows: > + > + Name ID Mem VCPUs State Time(s) > + Domain-0 0 750 4 r----- 11794.3 > + win 1 1019 1 r----- 0.3 > + linux 2 2048 2 r----- 5624.2 > + > +Name is the name of the domain. ID the numeric domain id. Mem is the > +desired amount of memory to allocate to the domain (although it may > +not be the currently allocated amount). VCPUs is the number of > +virtual CPUs allocated to the domain. State is the run state (see > +below). Time is the total run time of the domain as accounted for by > +Xen. > + > +B > + > +The State field lists 6 states for a Xen domain, and which ones the > +current domain is in. > + > +=over 4 > + > +=item B > + > +The domain is currently running on a CPU. > + > +=item B > + > +The domain is blocked, and not running or runnable. This can be caused > +because the domain is waiting on IO (a traditional wait state) or has > +gone to sleep because there was nothing else for it to do. > + > +=item B

> + > +The domain has been paused, usually occurring through the administrator > +running B. When in a paused state the domain will still > +consume allocated resources like memory, but will not be eligible for > +scheduling by the Xen hypervisor. > + > +=item B > + > +FIXME: Why would you ever see this state? > + > +=item B > + > +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 L for more info. > + > +=item B > + > +The domain is in process of dying, but hasn't completely shutdown or > +crashed. > + > +FIXME: Is this right? > + > +=back > + > +B > + > +=over 4 > + > +The Time column is deceptive. Virtual IO (network and block devices) > +used by domains requires coordination by Domain0, which means that > +Domain0 is actually charged for much of the time that a DomainU is > +doing IO. Use of this time value to determine relative utilizations > +by domains is thus very suspect, as a high IO workload may show as > +less utilized than a high CPU workload. Consider yourself warned. > + > +=back > + > +=item B I I > + > +Specify the maximum amount of memory the domain is able to use, appending 't' > +for terabytes, 'g' for gigabytes, 'm' for megabytes, 'k' for kilobytes and 'b' > +for bytes. > + > +The mem-max value may not correspond to the actual memory used in the > +domain, as it may balloon down its memory to give more back to the OS. > + > +=item B I I > + > +Set the domain's used memory using the balloon driver; append 't' for > +terabytes, 'g' for gigabytes, 'm' for megabytes, 'k' for kilobytes and 'b' for > +bytes. > + > +Because this operation requires cooperation from the domain operating > +system, there is no guarantee that it will succeed. This command will > +definitely not work unless the domain has the required paravirt > +driver. > + > +B There is no good way to know in advance how small of a > +mem-set will make a domain unstable and cause it to crash. Be very > +careful when using this command on running domains. > + > +=item B [I] I I > + > +Migrate a domain to another host machine. By default B relies on ssh as a > +transport mechanism between the two hosts. > + > +B > + > +=over 4 > + > +=item B<-s> I > + > +Use instead of ssh. String will be passed to sh. If empty, run > + instead of ssh xl migrate-receive [-d -e]. > + > +=item B<-e> > + > +On the new host, do not wait in the background (on ) for the death of the > +domain. > + > +=item B<-C> I > + > +Send instead of config file from creation. > + > +=back > + > +=item B I > + > +Pause a domain. When in a paused state the domain will still consume > +allocated resources such as memory, but will not be eligible for > +scheduling by the Xen hypervisor. > + > +=item B [I] I > + > +Reboot a domain. This acts just as if the domain had the B > +command run from the console. The command returns as soon as it has > +executed the reboot action, which may be significantly before the > +domain actually reboots. > + > +The behavior of what happens to a domain when it reboots is set by the > +B parameter of the xldomain.cfg file when the domain was > +created. > + > +=item B [I] [I] I > + > +Build a domain from an B state file. See B for more info. > + > +B > + > +=over 4 > + > +=item B<-p> > + > +Do not unpause domain after restoring it. > + > +=item B<-e> > + > +Do not wait in the background for the death of the domain on the new host. > + > +=item B<-d> > + > +Enable debug messages. > + > +=back > + > +=item B [I] I I [I] > + > +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, unless the -c option is used. > +B restores from this checkpoint file. > +Passing a config file argument allows the user to manually select the VM config > +file used to create the domain. > + > + > +=over 4 > + > +=item B<-c> > + > +Leave domain running after creating the snapshot. > + > +=back > + > + > +=item B [I] I > + > +Gracefully shuts down a domain. This coordinates with the domain OS > +to perform graceful shutdown, so there is no guarantee that it will > +succeed, and may take a variable length of time depending on what > +services must be shutdown in the domain. The command returns > +immediately after signally the domain unless that B<-w> flag is used. > + > +The behavior of what happens to a domain when it reboots is set by the > +B parameter of the xldomain.cfg file when the domain was > +created. > + > +B > + > +=over 4 > + > +=item B<-w> > + > +Wait for the domain to complete shutdown before returning. > + > +=back > + > +=item B I I > + > +Send a I signal to the domain. For more > +information on available magic sys req operations, see sysrq.txt in > +your Linux Kernel sources. > + > +=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 Xen hypervisor. > + > +=item B I I > + > +Enables the I virtual CPUs for the domain in question. > +Like mem-set, this command can only allocate up to the maximum virtual > +CPU count configured at boot for the domain. > + > +If the I is smaller than the current number of active > +VCPUs, the highest number VCPUs will be hotplug removed. This may be > +important for pinning purposes. > + > +Attempting to set the VCPUs to a number larger than the initially > +configured VCPU count is an error. Trying to set VCPUs to < 1 will be > +quietly ignored. > + > +Because this operation requires cooperation from the domain operating > +system, there is no guarantee that it will succeed. This command will > +not work with a full virt domain. > + > +=item B [I] > + > +Lists VCPU information for a specific domain. If no domain is > +specified, VCPU information for all domains will be provided. > + > +=item B I I I > + > +Pins the VCPU to only run on the specific CPUs. The keyword > +B can be used to apply the I list to all VCPUs in the > +domain. > + > +Normally VCPUs can float between available CPUs whenever Xen deems a > +different run state is appropriate. Pinning can be used to restrict > +this, by ensuring certain VCPUs can only run on certain physical > +CPUs. > + > +=item B I I