X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-autoinstaller.git/blobdiff_plain/a6b4b67cebc34d1c7915f420e03b39f5ae4b448d..a485b225bf3f1923002a6b89d57e436129b8553c:/host/usr/sbin/sipb-xen-install diff --git a/host/usr/sbin/sipb-xen-install b/host/usr/sbin/sipb-xen-install index 81cea3f..6784e52 100644 --- a/host/usr/sbin/sipb-xen-install +++ b/host/usr/sbin/sipb-xen-install @@ -4,16 +4,20 @@ # In particular, it may leave ${TARGET}1 mounted somewhere in tmp. # Unmount it, then kpartx -d $TARGET to clean up. +set -e + export PATH #WTF? -LVNAME="$1" +NAME="$1" export HOSTNAME="$2" export DIST="$3" export MIRROR="$4" -export IMAGESIZE="$5" # in megabytes -export IP="$6" +export FSSIZE="$5" # in megabytes +SWAPSIZE="$6" # in megabytes +export IP="$7" export ARCH=amd64 +VGNAME=xenvg #LVSIZE=`lvs --noheadings --units M --nosuffix -o Size /dev/xenvg/d_foobar_hda | sed 's/\..*//'` @@ -21,7 +25,8 @@ if [ -z "$IP" ]; then IP=`host $HOSTNAME.xvm.mit.edu | sed 's/.* //' | head -n 1` fi -export TARGET=/dev/mapper/xenvg-$(echo "$LVNAME" | sed -e 's/-/--/g')_hda +/sbin/lvcreate -L $(($FSSIZE+$SWAPSIZE))M -n "${NAME}_hda" $VGNAME -/usr/sbin/sipb-xen-create-image +export TARGET=/dev/mapper/xenvg-"$(echo "${NAME}_hda" | sed -e 's/-/--/g')" +/usr/sbin/sipb-xen-create-image