diff --git a/src/datastore_mad/remotes/vmfs/clone b/src/datastore_mad/remotes/vmfs/clone index 67d958ea60..36ef27e23b 100755 --- a/src/datastore_mad/remotes/vmfs/clone +++ b/src/datastore_mad/remotes/vmfs/clone @@ -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" \ diff --git a/src/datastore_mad/remotes/vmfs/cp b/src/datastore_mad/remotes/vmfs/cp index d3b7134e2f..76f0ab6373 100755 --- a/src/datastore_mad/remotes/vmfs/cp +++ b/src/datastore_mad/remotes/vmfs/cp @@ -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 diff --git a/src/datastore_mad/remotes/vmfs/mkfs b/src/datastore_mad/remotes/vmfs/mkfs index b21b925a42..8232a8337e 100755 --- a/src/datastore_mad/remotes/vmfs/mkfs +++ b/src/datastore_mad/remotes/vmfs/mkfs @@ -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" diff --git a/src/datastore_mad/remotes/vmfs/rm b/src/datastore_mad/remotes/vmfs/rm index 48d28b1809..b393c802c1 100755 --- a/src/datastore_mad/remotes/vmfs/rm +++ b/src/datastore_mad/remotes/vmfs/rm @@ -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" diff --git a/src/datastore_mad/remotes/vmfs/vmfsrc b/src/datastore_mad/remotes/vmfs/vmfsrc index bb6463166c..9809cff282 100644 --- a/src/datastore_mad/remotes/vmfs/vmfsrc +++ b/src/datastore_mad/remotes/vmfs/vmfsrc @@ -15,4 +15,4 @@ #--------------------------------------------------------------------------- # TMP_DIR=/var/lib/one/tmp -SSH=no +USE_SSH=no diff --git a/src/tm_mad/vmware/clone b/src/tm_mad/vmware/clone index 52cdf9b8e9..1bc1df13c3 100755 --- a/src/tm_mad/vmware/clone +++ b/src/tm_mad/vmware/clone @@ -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 <