X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=scripts%2Fcreate-vm.sh;h=617ec51cf26496782725ea61379b06ac33fd8044;hb=b1b042a53d694d548a0da1cd0793ad1e9a3734ea;hp=eefd2365682aedd9acf69c92d6599019d5c31298;hpb=5f5b79fd72899bc2aeed38c0abc41ac8ddbb0252;p=infrastructure.git diff --git a/scripts/create-vm.sh b/scripts/create-vm.sh index eefd236..617ec51 100755 --- a/scripts/create-vm.sh +++ b/scripts/create-vm.sh @@ -5,18 +5,14 @@ DIRNAME=$(dirname $0) BUILD="${HOME}/git-build" -echo "Updating $BUILD" -cd $BUILD -git pull -cd - - LOGS=$HOME/machines [ -d $LOGS ] || { echo "Creating logs dir $LOGS" ; mkdir -p $LOGS; } DOMAIN=pl.sophia.inria.fr -DEFAULT_DISTRO=f20 +DEFAULT_DISTRO=f23 +DEFAULT_MEMORY=4096 CONFIRM= function usage () { @@ -26,7 +22,7 @@ function usage () { echo " -f : set distro, default is $DEFAULT_DISTRO" echo " -i : if specified, image is rsynced into /vservers" echo " warning: we cannot use an image already in /vservers..." - echo " -m : memory size in Mb - default is 512" + echo " -m : memory size in Mb - default is $DEFAULT_MEMORY" echo " -n : specify hostname if different from container" echo " -s : do not start VM" echo " container : used for /vservers/foo as well as the lxc/libvirt name" @@ -61,8 +57,14 @@ container="$1" ; shift [ -d "$BUILD" ] || usage "Could not find directory $BUILD" [ -d /vservers/$container ] && usage "container $container already exists in /vservers" +echo "Updating $BUILD" +cd $BUILD +git pull +cd - + # compute all vars from args [ -z "$DISTRO" ] && DISTRO="$DEFAULT_DISTRO" +[ -z "$MEMORY" ] && MEMORY="$DEFAULT_MEMORY" [ -z "$VM_HOSTNAME" ] && VM_HOSTNAME="$container" fqdn=$VM_HOSTNAME.$DOMAIN