mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
feature #1437: Fix por choice of env var name (facepalm)
This commit is contained in:
parent
68f294873c
commit
569d36b267
@ -65,7 +65,7 @@ DST=`generate_image_path`
|
||||
DST_FOLDER=`basename $DST`
|
||||
DST_HOST=`get_destination_host $(dirname $0)`
|
||||
|
||||
if [ "$SSH" != "yes" ]; then
|
||||
if [ "$USE_SSH" != "yes" ]; then
|
||||
USERNAME=`echo $(cat $VMWARERC |grep ":username:"|cut -d":" -f 3|tr -d '"')`
|
||||
PASSWORD=`echo $(cat $VMWARERC |grep ":password:"|cut -d":" -f 3|tr -d '"')`
|
||||
VI_PARAMS="--server $DST_HOST --username $USERNAME --password $PASSWORD"
|
||||
@ -75,7 +75,7 @@ fi
|
||||
|
||||
log "Copying local image $SRC to the image repository"
|
||||
|
||||
if [ "$SSH" == "yes" ]; then
|
||||
if [ "$USE_SSH" == "yes" ]; then
|
||||
ssh_exec_and_log "$VMKFSTOOLS $VI_PARAMS $SRC $DST" "Error copying $SRC to $DST"
|
||||
else
|
||||
exec_and_log "vifs $VI_PARAMS --copy [$DS_ID]$SRC_FOLDER [$DS_ID]$DST_FOLDER" \
|
||||
|
@ -76,14 +76,14 @@ DST_FOLDER=`basename $FE_DST`
|
||||
DST="/vmfs/volumes/$DS_ID/$DST_FOLDER"
|
||||
DST_HOST=`get_destination_host $(dirname $0)`
|
||||
|
||||
if [ "$SSH" != "yes" ]; then
|
||||
if [ "$USE_SSH" != "yes" ]; then
|
||||
USERNAME=`echo $(cat $VMWARERC |grep ":username:"|cut -d":" -f 3|tr -d '"')`
|
||||
PASSWORD=`echo $(cat $VMWARERC |grep ":password:"|cut -d":" -f 3|tr -d '"')`
|
||||
VI_PARAMS="--server $DST_HOST --username $USERNAME --password $PASSWORD"
|
||||
fi
|
||||
|
||||
# Create DST in DST_HOST
|
||||
if [ "$SSH" == "yes" ]; then
|
||||
if [ "$USE_SSH" == "yes" ]; then
|
||||
ssh_make_path $DST_HOST $DST
|
||||
else
|
||||
exec_and_log "vifs $VI_PARAMS --mkdir [$DS_ID]$DST_FOLDER" \
|
||||
@ -141,7 +141,7 @@ if [ ! -f $SRC/disk.vmdk ]; then
|
||||
fi
|
||||
|
||||
# Make the final hop, front-end -> VMFS Datastore
|
||||
if [ "$SSH" == "yes" ]; then
|
||||
if [ "$USE_SSH" == "yes" ]; then
|
||||
exec_and_log "$SCP -r $SRC $DST" "Error copying $SRC to $DST through SCP"
|
||||
else
|
||||
cd $SRC
|
||||
|
@ -71,7 +71,7 @@ DST_DIR=`dirname $DST`
|
||||
DST_FOLDER=`basename $DST`
|
||||
DST_HOST=`get_destination_host $(dirname $0)`
|
||||
|
||||
if [ "$SSH" != "yes" ]; then
|
||||
if [ "$USE_SSH" != "yes" ]; then
|
||||
USERNAME=`echo $(cat $VMWARERC |grep ":username:"|cut -d":" -f 3|tr -d '"')`
|
||||
PASSWORD=`echo $(cat $VMWARERC |grep ":password:"|cut -d":" -f 3|tr -d '"')`
|
||||
VI_PARAMS="--server $DST_HOST --username $USERNAME --password $PASSWORD"
|
||||
@ -91,7 +91,7 @@ log "Making filesystem of ${SIZE}M (with no format) at [$IMAGE_DS_ID]$DST_FOLDER
|
||||
IMAGE_FORMAT=vmdk
|
||||
VMWARE_DISK_TYPE=`echo $FSTYPE|cut -d'_' -f 2`
|
||||
|
||||
if [ "$SSH" == "yes" ]; then
|
||||
if [ "$USE_SSH" == "yes" ]; then
|
||||
ssh_exec_and_log $DST_HOST "mkdir -p /vmfs/volumes/$IMAGE_DS_ID/$DST_FOLDER" \
|
||||
"Could not create disk directory /vmfs/volumes/$IMAGE_DS_ID/$DST_FOLDER on $DST_HOST"
|
||||
ssh_exec_and_log $DST_HOST "$VMKFSTOOLS -U [$IMAGE_DS_ID]$DST_FOLDER/disk.vmdk"
|
||||
|
@ -55,9 +55,9 @@ SRC="${XPATH_ELEMENTS[0]}"
|
||||
DS_NAME="${XPATH_ELEMENTS[1]}"
|
||||
|
||||
DST_HOST=`get_destination_host $(dirname $0)`
|
||||
DST_FOLDER=`basename $(dirname $SRC)`
|
||||
DST_FOLDER=`basename $SRC`
|
||||
|
||||
if [ "$SSH" != "yes" ]; then
|
||||
if [ "$USE_SSH" != "yes" ]; then
|
||||
USERNAME=`echo $(cat $VMWARERC |grep ":username:"|cut -d":" -f 3|tr -d '"')`
|
||||
PASSWORD=`echo $(cat $VMWARERC |grep ":password:"|cut -d":" -f 3|tr -d '"')`
|
||||
VI_PARAMS="--server $DST_HOST --username $USERNAME --password $PASSWORD"
|
||||
@ -67,7 +67,7 @@ fi
|
||||
|
||||
log "Removing $SRC from the image repository"
|
||||
|
||||
if [ "$SSH" == "yes" ]; then
|
||||
if [ "$USE_SSH" == "yes" ]; then
|
||||
if [ -n $DS_NAME -a -n $DST_FOLDER ]; then
|
||||
ssh_exec_and_log $DST_HOST "rm -rf /vmfs/volumes/$DS_NAME/$DST_FOLDER" \
|
||||
"Error deleting $SRC"
|
||||
|
@ -15,4 +15,4 @@
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
TMP_DIR=/var/lib/one/tmp
|
||||
SSH=no
|
||||
USE_SSH=no
|
||||
|
@ -54,7 +54,7 @@ DST_HOST=`arg_host $DST`
|
||||
DST_DIR=`dirname $DST_PATH`
|
||||
DST_FOLDER=`basename $DST_PATH`
|
||||
|
||||
if [ "$SSH" != "yes" ]; then
|
||||
if [ "$USE_SSH" != "yes" ]; then
|
||||
USERNAME=`echo $(cat $VMWARERC |grep ":username:"|cut -d":" -f 3|tr -d '"')`
|
||||
PASSWORD=`echo $(cat $VMWARERC |grep ":password:"|cut -d":" -f 3|tr -d '"')`
|
||||
IMAGE_DS_NAME=`basename $(dirname $SRC_PATH)`
|
||||
@ -63,7 +63,7 @@ if [ "$SSH" != "yes" ]; then
|
||||
VI_PARAMS="--server $DST_HOST --username $USERNAME --password $PASSWORD"
|
||||
fi
|
||||
|
||||
if [ "$SSH" == "yes" ]; then
|
||||
if [ "$USE_SSH" == "yes" ]; then
|
||||
ssh_make_path $DST_HOST $DST_PATH
|
||||
else
|
||||
# Two calls needed since vifs cannot do a mkdir -p
|
||||
@ -76,7 +76,7 @@ fi
|
||||
#-------------------------------------------------------------------------------
|
||||
log "Cloning $SRC_PATH in $DST"
|
||||
|
||||
if [ "$SSH" == "yes" ]; then
|
||||
if [ "$USE_SSH" == "yes" ]; then
|
||||
|
||||
CLONESCRIPT=$(cat <<EOF
|
||||
cd $DST_DIR
|
||||
|
@ -50,13 +50,13 @@ DST_HOST=`arg_host $DST`
|
||||
DST_DIR=`dirname $DST_PATH`
|
||||
DST_FOLDER=`basename $DST_PATH`
|
||||
|
||||
if [ "$SSH" != "yes" ]; then
|
||||
if [ "$USE_SSH" != "yes" ]; then
|
||||
USERNAME=`echo $(cat $VMWARERC |grep ":username:"|cut -d":" -f 3|tr -d '"')`
|
||||
PASSWORD=`echo $(cat $VMWARERC |grep ":password:"|cut -d":" -f 3|tr -d '"')`
|
||||
VI_PARAMS="--server $DST_HOST --username $USERNAME --password $PASSWORD"
|
||||
fi
|
||||
|
||||
if [ "$SSH" == "yes" ]; then
|
||||
if [ "$USE_SSH" == "yes" ]; then
|
||||
ssh_make_path $DST_HOST $DST_DIR
|
||||
else
|
||||
vifs $VI_PARAMS --mkdir [$DS_ID]$VM_ID
|
||||
@ -87,7 +87,7 @@ done
|
||||
|
||||
exec_and_log "$MKISOFS -o $ISO_FILE -J -R $ISO_DIR" "Error creating iso fs"
|
||||
|
||||
if [ "$SSH" == "yes" ]; then
|
||||
if [ "$USE_SSH" == "yes" ]; then
|
||||
exec_and_log "$SCP $ISO_FILE $DST" "Error copying context ISO to $DST"
|
||||
else
|
||||
# Copies the iso file with .iso suffix, needed for VMware CDROMs
|
||||
|
@ -55,7 +55,7 @@ fi
|
||||
|
||||
log "Deleting $DST_PATH"
|
||||
|
||||
if [ "$SSH" == "yes" ]; then
|
||||
if [ "$USE_SSH" == "yes" ]; then
|
||||
ssh_exec_and_log $DST_HOST "rm -rf $DST_PATH" "Error deleting $DST_PATH"
|
||||
else
|
||||
USERNAME=`echo $(cat $VMWARERC |grep ":username:"|cut -d":" -f 3|tr -d '"')`
|
||||
|
@ -52,7 +52,7 @@ DST_DIR=`dirname $DST_PATH`
|
||||
# Link (ln) SRC into DST
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
if [ "$SSH" == "yes" ]; then
|
||||
if [ "$USE_SSH" == "yes" ]; then
|
||||
ssh_make_path $DST_HOST $DST_PATH
|
||||
|
||||
# It's a folder, make links for all elements
|
||||
|
@ -51,7 +51,7 @@ DST_HOST=`arg_host $DST`
|
||||
DST_DIR=`dirname $DST_PATH`
|
||||
DST_FOLDER=`basename $DST_PATH`
|
||||
|
||||
if [ "$SSH" != "yes" ]; then
|
||||
if [ "$USE_SSH" != "yes" ]; then
|
||||
SYSTEM_DS_NAME=`basename $(dirname $(dirname $DST_PATH))`
|
||||
USERNAME=`echo $(cat $VMWARERC |grep ":username:"|cut -d":" -f 3|tr -d '"')`
|
||||
PASSWORD=`echo $(cat $VMWARERC |grep ":password:"|cut -d":" -f 3|tr -d '"')`
|
||||
@ -64,7 +64,7 @@ fi
|
||||
|
||||
log "Making filesystem of ${SIZE}M and type $FSTYPE at $DST"
|
||||
|
||||
if [ "$SSH" == "yes" ]; then
|
||||
if [ "$USE_SSH" == "yes" ]; then
|
||||
ssh_make_path $DST_HOST $DST_PATH
|
||||
MKFS_CMD=`mkfs_command $DST_PATH $FSTYPE $SIZE`
|
||||
|
||||
|
@ -42,7 +42,7 @@ fi
|
||||
|
||||
source $(dirname $0)/tm_vmwarerc
|
||||
|
||||
if [ "$SSH" != "yes" ]; then
|
||||
if [ "$USE_SSH" != "yes" ]; then
|
||||
USERNAME=`echo $(cat $VMWARERC |grep ":username:"|cut -d":" -f 3|tr -d '"')`
|
||||
PASSWORD=`echo $(cat $VMWARERC |grep ":password:"|cut -d":" -f 3|tr -d '"')`
|
||||
VI_PARAMS="--server $DST_HOST --username $USERNAME --password $PASSWORD"
|
||||
@ -62,7 +62,7 @@ SRC_HOST=`arg_host $SRC`
|
||||
# Move the image back to the datastore
|
||||
#-------------------------------------------------------------------------------
|
||||
|
||||
if [ "$SSH" == "yes" ]; then
|
||||
if [ "$USE_SSH" == "yes" ]; then
|
||||
|
||||
MVSCRIPT=$(cat <<EOF
|
||||
SRC_READLN=eval "$READLINK -f $SRC_PATH"
|
||||
|
@ -17,4 +17,4 @@
|
||||
# Whether the TM VMware driver should use to invoke the VMFS native commands
|
||||
# * remote API calls (value set to "no")
|
||||
# * ssh connection (value set to "yes")
|
||||
SSH=no
|
||||
USE_SSH=no
|
||||
|
Loading…
x
Reference in New Issue
Block a user