chiark / gitweb /
working on config and docs
authorIan Jackson <ian@anarres>
Wed, 27 Sep 2006 16:17:58 +0000 (17:17 +0100)
committerIan Jackson <ian@anarres>
Wed, 27 Sep 2006 16:17:58 +0000 (17:17 +0100)
xen/config-vars [new file with mode: 0644]
xen/default-config
xen/setup
xen/tail-config
xen/with-testbed

diff --git a/xen/config-vars b/xen/config-vars
new file mode 100644 (file)
index 0000000..63aee6e
--- /dev/null
@@ -0,0 +1,39 @@
+adt_testbed_ram                256 [Mby]
+       Physical RAM allocated for each testbed instance while
+       creating and running.
+
+adt_freeze_ram         32 [Mby]
+       Physical RAM size for frozen image; we reduce the testbed
+       to this before freezing it and grow it again when we resume
+       it.
+
+adt_filesys_size       1G
+       Size of base filesystem image.  Should be big enough to
+       contain all of the software under test and all of its working
+       space, as no running testbed can ever use more than this
+       (despite copy-on-write).
+
+adt_filesys_snapsize   500M
+       Space to allocate for copy-on-write snapshot data.  This is
+       the maximum amount of data that a running testbed can use.
+       This value should be less than the adt_filesys_size.
+
+adt_filesys_cowchunk   8 [Mby]
+       Copy-on-write chunk size.
+
+adt_nominum            adt
+       Namespace prefix for Xen domains, LVM volumes, devmapper
+       devices, entries in /dev, files in /var, and so on.  You may
+       run several instances of the adt virtualisation system with
+       different nominums and they won't interact.
+
+adt_lvm_vg             the system's LVM volume group if there is only one
+       LVM volume group to create base filesystem image in.
+
+adt_kernel             the booted kernel file /boot/xen*`uname -r`
+       Kernel to boot in the testbed image
+
+adt_ramdisk            <kernel>.initrd.img
+       Initial ramdisk to provide to the testbid image.
+       "none" means do not provide an initial ramdisk.
+
index 31e80c69963a58f3dc4f7d39cc16c935bf52424b..bb414a5518476c6084453e524812479c82745397 100644 (file)
@@ -1,10 +1,7 @@
-tbmem=256
-frzmem=32
-fssize=1G
-snapsize=100M
-cowchunk=8
+adt_testbed_ram=256
+adt_freeze_ram=32
+adt_filesys_size=1G
+adt_filesys_snapsize=100M
+adt_filesys_cowchunk=8
 
 adt_nominum=${adt_nominum}
-
-sshkey=/root/.ssh/id_dsa_${adt_nominum}
-playbase=/var/lib/autopkgtest/xenlvm-play
index b3c9b697decb433383b01128627e8f801cf5885d..786e62f229f510ca6d54cad917b226f89299ad8f 100755 (executable)
--- a/xen/setup
+++ b/xen/setup
@@ -6,8 +6,8 @@ lvchange -a n $lvcowdata ||:
 lvremove $lvbase ||:
 lvremove $lvcowdata ||:
 
-lvcreate -L $fssize -n $lvbase $vg
-lvcreate -L $snapsize -n $ncowdata $vg
+lvcreate -L $adt_filesys_size -n $lvbase $adt_lvm_vg
+lvcreate -L $adt_filesys_snapsize -n $ncowdata $adt_lvm_vg
 #dd if=/dev/zero of=$lvbase
 mkfs -t ext3 $lvbase
 
@@ -30,7 +30,7 @@ adt_host_ipaddr=`adnshost -t a +Do +Dt +Dc $adt_host_hostname`
 
 cat <<END >$adt_xmconfig
 kernel = "$kernel"
-memory = $tbmem
+memory = $adt_testbed_ram
 root = "/dev/hda1"
 extra = "ro console=tty0"
 disk = [ "phy:$lvfsptrrhs,hda1,w" ]
@@ -64,10 +64,10 @@ while true; do
        sleep 2
 done
 
-xm mem-set $xmname $frzmem
+xm mem-set $xmname $adt_freeze_ram
 retries=10
 while sleep 1; do
-  if xm mem-max $xmname $frzmem; then break; fi
+  if xm mem-max $xmname $adt_freeze_ram; then break; fi
   if [ $retries -le 0 ]; then echo >&2 'cannot reduce memory'; exit 1; fi
   retries=$(($retries-1))
 done
index ea4acf86f1a864cf1f51cca6892df1681a2f3a5e..22494f7b49f4d546b9feca1deb03489a2784197c 100644 (file)
@@ -1,4 +1,4 @@
-case "$adt_vg" in
+case "$adt_lvm_vg" in
 '')
        echo "searching for default volume group ..."
        vgdisplay_out=`vgdisplay -c`
@@ -7,7 +7,7 @@ case "$adt_vg" in
        *"
 "*)            fail 'several volume groups, config must specify which';;
        esac
-       $adt_vg=${vgdisplay_out%%:*}
+       $adt_lvm_vg=${vgdisplay_out%%:*}
        echo "system has one volume group, $adt_vg, using that."
        ;;
 esac
index b98289b65e0ec8a9508bc47c8ea14aab33816a71..f1212c8473e4a6785204d626b04337e4944fd9bb 100755 (executable)
@@ -8,18 +8,18 @@ trap 'exit 127' 0
 
 modprobe dm-snapshot ||:
 
-#dd if=/dev/zero of=/dev/$lvcowdata bs=512 count=$cowchunk status=noxfer
+#dd if=/dev/zero of=/dev/$lvcowdata bs=512 count=$adt_filesys_cowchunk status=noxfer
 
 bdsize=$(blockdev --getsize $lvbase)
 dmsetup create $nsnap <<END
-0 $bdsize snapshot $lvbase $lvcowdata n $cowchunk
+0 $bdsize snapshot $lvbase $lvcowdata n $adt_filesys_cowchunk
 END
 
 mkdir -p /dev/${pfx}_fs
 ln -s $lvsnap $lvfsptr
 
 xm restore $play/xen-save
-xm mem-set $xmname $tbmem
+xm mem-set $xmname $adt_testbed_ram
 udevsettle
 
 set +e