ia64/xen-unstable

view tools/examples/README @ 1372:5a6113c65ead

bitkeeper revision 1.891.1.12 (40a248b0WTGoOa9206iWkyGN0mTPNw)

Allow forcing of IRQ trigger-type to edge or level
(NB. DANGEROUS!).
author kaf24@scramble.cl.cam.ac.uk
date Wed May 12 15:54:24 2004 +0000 (2004-05-12)
parents 0eac2a407546
children 04a0d90a1547 0a4b76b6b5a0
line source
1 Xen Control Tools - Example Scripts
2 ===================================
4 This directory contains a set of example scripts for common Xen operations.
5 For many operations you will either be able to use these scripts directly, or
6 incorporate code from them into your own scripts.
8 The Xc and xenctl.utils Python modules provide an API for accessing all this
9 functionality - and more - from your own Python programs. These libraries may
10 contain features for which there aren't yet example scripts written for...
12 If you write a useful script and would like to share it, please do
13 send it (preferably with a little summary to go in this file) to
14 <xen-devel@lists.sourceforge.net> so we can add it to this directory.
16 xc_dom_control.py
17 - general tool for controling running domains
18 Usage: xc_dom_control.py [command] <params>
20 stop [dom] -- pause a domain
21 start [dom] -- un-pause a domain
22 shutdown [dom] [[-w]] -- request a domain to shutdown (can specify 'all')
23 (optionally wait for complete shutdown)
24 destroy [dom] -- immediately terminate a domain
25 pincpu [dom] [cpu] -- pin a domain to the specified CPU
26 suspend [dom] [file] -- write domain's memory to a file and terminate
27 (resume by re-running xc_dom_create with -L option)
28 unwatch [dom] -- kill the auto-restart daemon for a domain
29 list -- print info about all domains
30 listvbds -- print info about all virtual block devs
31 cpu_bvtset [dom] [mcuadv] [warp] [warpl] [warpu]
32 -- set BVT scheduling parameters for domain
33 cpu_bvtslice [slice] -- set default BVT scheduler slice
34 cpu_atropos_set [dom] [period] [slice] [latency] [xtratime]
35 -- set Atropos scheduling parameters for domain
36 cpu_rrobin_slice [slice] -- set Round Robin scheduler slice
37 vif_stats [dom] [vif] -- get stats for a given network vif
38 vif_addip [dom] [vif] [ip] -- add an IP address to a given vif
39 vif_setsched [dom] [vif] [bytes] [usecs] -- rate limit vif bandwidth
40 vif_getsched [dom] [vif] -- print vif's scheduling parameters
41 vbd_add [dom] [uname] [dev] [mode] -- make disk/partition uname available to
42 domain as dev e.g. 'vbd_add 2 phy:sda3 hda1 w'
43 vbd_remove [dom] [dev] -- remove disk or partition attached as 'dev'
46 xc_dom_create.py
47 - This tool is used to create and start new domains. It reads defaults
48 from a file written in Python, having allowed variables to be set and
49 passed into the file. Further command line arguments allow the
50 defaults to be overridden. The defaults for each parameter are listed
51 in [] brackets. Arguments are as follows:
53 Arguments to control the parsing of the defaults file:
54 -f config_file -- Use the specified defaults script.
55 Default: ['/etc/xc/defaults']
56 -L state_file -- Load virtual machine memory state from state_file
57 -D foo=bar -- Set variable foo=bar before parsing config
58 E.g. '-D vmid=3;ip=1.2.3.4'
59 -h -- Print extended help message, including all arguments
60 -n -- Dry run only, don't actually create domain
61 -q -- Quiet - write output only to the system log
64 The config file 'defaults' requires the following variable to be defined:
65 vmid -- Numeric identifier for the new domain, used to calculate
66 the VM's IP address and root partition. E.g. -Dvmid=1
69 Arguments to override current config read from 'defaults':
70 -k image -- Path to kernel image ['']
71 -r ramdisk -- Path to ramdisk (or empty) ['']
72 -b builder_fn -- Function to use to build domain ['']
73 -m mem_size -- Initial memory allocation in MB [0MB]
74 -N domain_name -- Set textual name of domain ['']
75 -a auto_restart -- Restart domain on exit, yes/no ['0']
76 -e vbd_expert -- Saftey catch to avoid some disk accidents ['0']
77 -d udisk,dev,rw -- Add disk, partition, or virtual disk to domain. E.g. to
78 make partion sda4 available to the domain as hda1 with
79 read-write access: '-b phy:sda4,hda1,rw' To add
80 multiple disks use multiple -d flags or seperate with ';'
81 Default: ['']
82 -i vfr_ipaddr -- Add IP address to the list which Xen will route to
83 the domain. Use multiple times to add more IP addrs.
84 Default: ['']
86 Args to override the kernel command line, which is concatenated from these:
87 -I cmdline_ip -- Override 'ip=ipaddr:nfsserv:gateway:netmask::eth0:off'
88 Default: ['']
89 -R cmdline_root -- Override root device parameters.
90 Default: ['']
91 -E cmdline_extra -- Override extra kernel args and rc script env vars.
92 Default: ['']
96 xc_vd_tool.py
97 - tool for manipulating virtual disks
98 Usage: xc_vd_tool command <params>
100 initalise [dev] [[ext_size]] - init. a physcial partition to store vd's
101 create [size] [[expiry]] - allocate a vd of specified size (and expiry)
102 delete [vdid] - delete a vd
103 import [filename] [[expiry]] - create a vd and populate w/ image from file
104 export [vdid] [filename] - copy vd's contents to a file
105 setexpiry [vdid] [[expiry]] - update the expiry time for a vd
106 list - list all the unexpired virtual disks
107 undelete [vdid] [[expiry]] - attempts to recover an expired vd
108 freespace - print out the amount of space in free pool
110 notes:
111 vdid - the virtual disk's identity string
112 size - measured in MB
113 expiry - is the expiry time of the virtual disk in seconds from now
114 (0 = don't expire)
115 device - physical partition to 'format' to hold vd's. e.g. hda4
116 ext_size - extent size (default 64MB)
119 xendomains
120 This is a Sys-V init script for RedHat systems.
122 - Usage: xendomains {start|stop|status}
124 start -- starts all the domains with config files in /etc/xc/auto/
125 stop -- stops ALL running domains, waiting for them to shutdown cleanly
126 (if possible) before returning
127 status -- prints a list of the running domains, the same as
128 "xc_dom_control.py list"
130 On a RedHat system it should be possible to issue commands to this
131 script using the "service" command and to configure if / when it is
132 run automatically, using the "chkconfig" command.
134 xend
135 This is a Sys-V init script for RedHat systems, which can be used to
136 start the Xen Daemon (xend) at boot time.
138 - Usage: xend {start|stop|status|restart|reload}