X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=scripts%2Fcreate-vm.sh;h=e96d70f087adf4de1d50cdb493bb604e4862ace1;hb=47fc5b84b0f4b58d2dcb63431308c5397de27ae7;hp=f8b0e57c2d0142c4f28562184c7dd7513ca6ada5;hpb=67525894a7d00aaf6055e625930f5d29268eed4d;p=infrastructure.git diff --git a/scripts/create-vm.sh b/scripts/create-vm.sh index f8b0e57..e96d70f 100755 --- a/scripts/create-vm.sh +++ b/scripts/create-vm.sh @@ -16,7 +16,8 @@ LOGS=$HOME/machines DOMAIN=pl.sophia.inria.fr -DEFAULT_DISTRO=f20 +DEFAULT_DISTRO=f21 +DEFAULT_MEMORY=4096 CONFIRM= function usage () { @@ -26,7 +27,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" @@ -40,7 +41,7 @@ function usage () { } # using HOSTNAME won't work as this is already set in environment -while getopts "cf:i:m:n:h" flag; do +while getopts "cf:i:m:n:sh" flag; do case $flag in c) CONFIRM=true ;; f) DISTRO=$OPTARG ;; @@ -63,6 +64,7 @@ container="$1" ; shift # 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