chiark / gitweb /
Fix filename pattern bug which can prevent automatic keypair generation (false claim...
[autopkgtest.git] / xen / README
1 ========== Introduction ==========
2
3 Basic approach:
4     1. Get yourself a working Xen dom0 setup, eg according to
5         https://wiki.ubuntu.com/XenOnEdgy
6     2. Configure adtxenlvm:
7         - assign a fixed IP address for the host and the testbed
8         - create DNS entries (forward and reverse)
9            for the testbed hostname edgy.adt.<your.domain.here>
10         - read below about settings you might want to set
11            creating /etc/autopkgtest/xenlvm_adt_config if needed
12     3. adt-xenlvm-setup
13     4. adt-xenlvm-with-testbed
14     5. adt-xenlvm-on-testbed
15
16 In some more detail, there are four main programs provided:
17
18   adt-xenlvm-setup [<config settings>]
19         Creates the snapshot.  Broadly speaking, does the following:
20         - deletes any existing snapshot, virtual machine, etc.
21         - creates a new lvm volume and filesystem for the snapshot base
22         - runs debootstrap to install a system into the new filesystem
23         - makes necessary config changes to the testbed and the host
24         - boots the testbed and waits for it to start
25         - freezes the testbed into a snapshot file
26         After this, you can run with-testbed.
27
28   adt-xenlvm-with-testbed [<config settings>] [<master> [<args...>]]
29         Starts the testbed and runs <master> _on the HOST_.  When
30         <master> finishes, the testbed state will be discarded.  While
31         <master> is running, you can interact with the testbed.  If
32         <master> is not specified, you get an interactive shell.
33
34   adt-xenlvm-on-testbed [<config settings>] [<command and args>]
35         Runs <command and args> on the running testbed.  A <master>
36         child of adt-xenlvm-with-testbed must be running, or the
37         behaviour is not defined.  However, adt-xenlvm-on-testbed does
38         not need to be a descendent of adt-xenlvm-with-testbed.
39         The arguments <command and args> are passed to ssh verbatim
40         and are therefore subject to ssh's unpleasant mangling.
41
42   adt-xenlvm-cleanup [<config settings>]
43         Cleans up any running testbed state.  This is not normally
44         needed, as adt-xenlvm-with-testbed and adt-xenlvm-setup run it
45         at appropriate moments.  However, if one of these should fail
46         and it is desirable to reclaim any resources used by the
47         testbed, cleanup will do this job.
48
49   adt-xenlvm-purge [<config settings>]
50         Deletes all of the data for the testbed.  Ie, undoes
51         the effects of adt-xenlvm-setup.
52
53 In each case [<config settings>] is zero or more arguments of the form
54   --<config-var>=<value>
55 where <config-var> is one of the configuration items listed below.
56 (On the command line, the configuration item name may be spelled with
57 either hyphens or underscores.)  Also, `--' may be used to indicate the
58 end of the config vars.
59
60 Note that there is NO LOCKING.  If you run more than one of either
61 adt-xenlvm-with-testbed or adt-xenlvm-setup (or one of each)
62 simultaneously, the behaviour is not defined, except that the host
63 will definitely not be trashed, and just two or more copies of
64 adt-xenlvm-with-testbed at once has no bad effects that
65 adt-xenlvm-cleanup won't fix.
66
67
68 ========== Configuration ==========
69
70 The configuration is read as follows:
71  1. set all variables whose defaults are fixed strings to
72      those built-in default values
73  2. process the command line arguments
74  3. read the user configuration file (sourced by bash)
75      this file must not use fds 10 onwards, which may have been used
76      for other purposes by other adtxenlvm machinery
77  4. process the command line arguments again, so they
78      can easily be made to override the user configuration file
79  5. calculate the values for variables which haven't been set
80      and whose default values depend on circumstances (including
81      on other variables)
82
83 ---------- Items which definitely need attention ----------
84
85 adt_guests_domain       .<domain-of-host_hostname>
86 adt_guest_hostname      <distro>.[<nominum>.]<domain>
87 adt_guest_ipaddr        from looking hostname up in the DNS
88         Hostname and IP address for the testbed.
89         If the configuration specifies one of the address and hostname
90         but not the other, the missing information will be found with
91         a DNS lookup.  If neither is specified, adt_guests_domain is
92         used; if it starts with `.' then <distro>.<nominum> is
93         prepended; otherwise just <distro>. is prepended.  NOTE: some
94         effort by the local network administrator to allocate an IP
95         address (and ideally create DNS entries) is essential.  It is
96         not possible to use DHCP for IP address allocation for the
97         testbed.
98
99 ---------- Firewall policy items ----------
100
101 adt_fw_localmirrors     <none>
102         List of IP addresses of local mirrors, to which the
103         testbed should allowed to make HTTP requests.
104
105 adt_fw_testbedclients   <host_ipaddr>
106         List of IP addresses of hosts which will be allowed to make
107         connections into the testbed system.
108
109 adt_fw_prohibnets       192.168.0.0/24 172.16.0.0/12 10.0.0.0/8
110         List of network ranges with which the testbed will be
111         prohibited from communicating, notwithstanding
112         allowglobalports.
113
114 adt_fw_allowglobalports <none>
115         List of ports to which the testbed will be allowed to make
116         outgoing connections.
117
118 adt_fw_hook             <config> with _config replaced with _fwhook
119                          or none if <config> doesn't end in _config
120         bash fragment to source during firewall setup
121
122 adt_sshauthkeys_hook    <config> with _config replaced with _sshauthkeys
123                          or none if <config> doesn't end in _config
124         list of authorized keys to append to testbed's
125         /root/.ssh/authorized_keys.
126
127 ---------- Items that are likely to need attention ----------
128
129 adt_kernel              Xen kernel matching /boot/xen*`uname -r`
130         Kernel to boot in the testbed image
131
132 adt_ramdisk             initrd.img-* where <kernel> is vmlinuz-*
133         Initial ramdisk to provide to the testbid image.
134         "none" means do not provide an initial ramdisk.
135
136 adt_modules             /lib/modules/`uname -r`
137         Directory with modules to be copied into the testbed.
138
139 adt_lvm_vg              the system's LVM volume group if there is only one
140         LVM volume group to create base filesystem image in.
141
142 adt_distro              host system's distribution
143         Distribution name (eg, `edgy', `feisty', `sarge', `etch').
144
145 adt_pbuilder_args       <none>
146         Extra arguments to pass to pbuilder.
147
148 adt_lvm_erasebase       true
149         Whether the base filesystem image needs to be filled with
150         zeroes.  If you are going to be using the image only locally
151         and so don't care whether the base image contains bits of
152         previous data from the disk, you may set this to `no'.
153
154 adt_debootstrap_includemore     <empty>
155 adt_debootstrap_include         libc6-xen,openssh-server,ed
156         Comma-separated lists of packages for --include option to
157         debootstrap.  It is best to set includemore.
158
159 adt_debootstrap_components      *
160         Components of the distribution to consider.  (Eg, `main'.)
161
162 adt_debootstrap_mirrors         <empty string>
163 adt_debootstrap_script          <empty string>
164         Third and fourth arguments to debootstrap.
165
166 adt_setup_hook                  <config> with _config replaced with
167                                  _setuphook, as for adt_fw_hook
168         Program to run at last moment before we freeze the image.
169         Will be invoked with one argument: the directory containing
170         the root of the testbed.  In the future more arguments may be
171         defined, so the hook script should not fail if more are
172         supplied.  The supplied hook value will be split at
173         whitespace before execution as if
174                 $adt_setup_hook /path/to/root
175         was run from within a shellscript.
176
177 ---------- Tuning parameters ----------
178
179 adt_fs_type             ext3
180 adt_fs_mkfs_args        <none>
181         Filesystem type and any additional arguments to mkfs.  If
182         _args contains whitespace, it results in multiple arguments;
183         it is not possible to pass whitespace-containing arguments to
184         mkfs.
185
186 adt_testbed_ram         256 [Mby]
187         Physical RAM allocated for each testbed instance while
188         creating and running.
189
190 adt_freeze_ram          32 [Mby]
191         Physical RAM size for frozen image; we reduce the testbed
192         to this before freezing it and grow it again when we resume
193         it.
194
195 adt_fs_size             1G
196         Size of base filesystem image.  Should be big enough to
197         contain all of the software under test and all of its working
198         space, as no running testbed can ever use more than this
199         (despite copy-on-write).
200
201 adt_fs_snapsize         500M
202         Space to allocate for copy-on-write snapshot data.  This is
203         the maximum amount of data that a running testbed can use.
204         This value should be less than the adt_fs_size.
205
206 adt_fs_cowchunk         8 [Mby]
207         Copy-on-write chunk size.
208
209 adt_vm_reduce_retries   10 [seconds]
210         Time to wait for VM to reduce its memory following
211         xm mem-set.
212
213 ---------- Configuration for advanced uses ----------
214
215 adt_config              /etc/autopkgtest/xenlvm_<nominum>_conf
216
217 adt_ssh_keytype         dsa
218 adt_ssh_privkey         /root/.ssh/id_<ssh_keytype>_<nominum>
219 adt_ssh_pubkey          <ssh_privkey>.pub
220 adt_ssh_keyident_args   -i <ssh_privkey>
221 adt_ssh_keygen_args     -t <ssh_keytype>
222         SSH keypair to use for authentication to the testbed.
223         If the pubkey file and privkey file do not exist and
224         correspond to each other, a new key will be generated.
225         The best combinations of these variables to set are:
226           keytype [& keygen_args] - just change the key type
227           privkey [& keygen_args] - generate/use a different keypair
228           pubkey, keyident_args - use an existing key via agent etc.,
229                 privkey is ignored if pubkey and keyident_args
230                 are set and pubkey file exists
231
232 adt_nominum             adt
233         Namespace prefix for Xen domains, LVM volumes, devmapper
234         devices, entries in /dev, files in /var, and so on.  You may
235         run several instances of the adt virtualisation system with
236         different nominums and they won't interact.  It is best for
237         this to be a legal DNS label (using alphanumerics and hyphens
238         only); normally it when it is used to construct an identifier
239         it will be separated by other parts by underscores `_', so
240         they should be avoided.
241
242 adt_guest_macaddr       00:16:3e:7c:aa:7f
243 adt_net_vifscript       /etc/xen/scripts/vif-route-adt
244
245 adt_normaluser          adtxenu
246         Create a normal user account of this name, with disabled
247         password.
248
249 ---------- Items which should not usually need to be changed ----------
250
251 adt_host_hostname       `hostname -f`
252 adt_host_ipaddr         from looking hostname up in the DNS
253         Hostname and IP address for the host, ie the Xen dom0 system.
254         If the configuration specifies one of the address and hostname
255         but not the other, the missing information will be found with
256         a DNS lookup.  Note that if the host system uses a dynamically
257         allocated DHCP address, things will go wrong when the address
258         changes.
259
260 adt_playbase            /var/lib/autopkgtest/xenlvm
261         Base of filesystem playground areas.
262
263 adt_play                <playbase>/<nominum>_<distro>
264         Playground area for this particular testbed construction and
265         data.
266
267 adt_xmconfig            <play>/xmconfig
268         Xen virtual machine creation configuration for xm create.
269         This file will be (over)written during testbed setup.
270
271 adt_lvm_baselv          <nominum>_<distro>_base
272 adt_lvm_cowdatalv       <nominum>_<distro>_cowdata
273         LVM volume for base filesystem image, and copy-on-write
274         buffer.  Will be created during testbed setup, destroying any
275         previous volume if necessary.  This is the logical volume name
276         not including /dev/<lvm_vg>.
277
278 adt_devmapper_cowdev    <nominum>_<distro>_snap
279         devmapper device for copy-on-write image used by testbed when
280         running.  This is the device name in the devmapper namespace,
281         ie not including /dev/mapper.
282
283 adt_fslink_dir          adt-xenlvm
284 adt_fslink_name         <nominum>_<distro>_fs
285         Directory in /dev, and filename in that directory, where the
286         scripts put the symlink used to trick Xen into using a
287         different block device on resume than was used for creation.
288
289 adt_xmname              <nominum>_<distro>
290         Xen virtual machine name, as passed to xm create.