From d9f231dd743bbc1eb2a4866197901f884f2f8d0e Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 27 Sep 2006 17:17:58 +0100 Subject: [PATCH] working on config and docs --- xen/config-vars | 39 +++++++++++++++++++++++++++++++++++++++ xen/default-config | 13 +++++-------- xen/setup | 10 +++++----- xen/tail-config | 4 ++-- xen/with-testbed | 6 +++--- 5 files changed, 54 insertions(+), 18 deletions(-) create mode 100644 xen/config-vars diff --git a/xen/config-vars b/xen/config-vars new file mode 100644 index 0000000..63aee6e --- /dev/null +++ b/xen/config-vars @@ -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 .initrd.img + Initial ramdisk to provide to the testbid image. + "none" means do not provide an initial ramdisk. + diff --git a/xen/default-config b/xen/default-config index 31e80c6..bb414a5 100644 --- a/xen/default-config +++ b/xen/default-config @@ -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 diff --git a/xen/setup b/xen/setup index b3c9b69..786e62f 100755 --- 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 <$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 diff --git a/xen/tail-config b/xen/tail-config index ea4acf8..22494f7 100644 --- a/xen/tail-config +++ b/xen/tail-config @@ -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 diff --git a/xen/with-testbed b/xen/with-testbed index b98289b..f1212c8 100755 --- a/xen/with-testbed +++ b/xen/with-testbed @@ -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 <