source: trunk/packages/sipb-xen-autoinstaller/host/usr/sbin/sipb-xen-install @ 1119

Last change on this file since 1119 was 940, checked in by price, 16 years ago

fix spelling in xen config

File size: 898 bytes
RevLine 
[931]1#!/bin/sh
2
3# If this script is interrupted, it may not clean up after itself.
4# In particular, it may leave ${TARGET}1 mounted somewhere in tmp.
5# Unmount it, then kpartx -d $TARGET to clean up.
6
[938]7set -e
8
[931]9export PATH #WTF?
10
[938]11NAME="$1"
[931]12export HOSTNAME="$2"
13export DIST="$3"
14export MIRROR="$4"
[938]15export FSSIZE="$5"    # in megabytes
16SWAPSIZE="$6"  # in megabytes
17export IP="$7"
[931]18
19export ARCH=amd64
[938]20VGNAME=xenvg
[931]21
22#LVSIZE=`lvs --noheadings --units M --nosuffix -o Size /dev/xenvg/d_foobar_hda | sed 's/\..*//'`
23
24if [ -z "$IP" ]; then
25    IP=`host $HOSTNAME.xvm.mit.edu | sed 's/.* //' | head -n 1`
26fi
27
[938]28/sbin/lvcreate -L $(($FSSIZE+$SWAPSIZE))M -n "${NAME}_hda" $VGNAME
[931]29
[938]30export TARGET=/dev/mapper/xenvg-"$(echo "${NAME}_hda" | sed -e 's/-/--/g')"
31
[931]32/usr/sbin/sipb-xen-create-image
[939]33
[940]34echo "disk = ['phy:$VGNAME/${NAME}_hda,hda,w']" >>/etc/xen/$HOSTNAME.cfg
[939]35echo "root = '/dev/hda1 ro'" >>/etc/xen/$HOSTNAME.cfg
Note: See TracBrowser for help on using the repository browser.