1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

feature #1112: Fix wrong paths in tm_ssh/mv remote copy

This commit is contained in:
Jaime Melis 2012-03-12 19:11:33 +01:00
parent 78dfdd2503
commit 46776157a3
3 changed files with 5 additions and 4 deletions

View File

@ -327,9 +327,8 @@ function iqn_get_vg_name {
function iqn_get_host {
IQN="$1"
TARGET=`echo "$IQN"|$CUT -d: -f2`
LV_NAME=$(iqn_get_lv_name "$IQN")
VG_NAME=$(iqn_get_vg_name "$IQN")
echo ${TARGET%%.$VG_NAME.$LV_NAME}
}

View File

@ -110,7 +110,6 @@ if is_iscsi "$DST_HOST"; then
set -e
mkdir -p $DST_DIR
$SUDO $(iscsiadm_discovery "$TARGET_HOST")
$SUDO $(iscsiadm_discovery "$TARGET_HOST")
$SUDO $(iscsiadm_login "$IQN" "$TARGET_HOST")
sleep 1
DISK_BY_PATH=\$(ls /dev/disk/by-path/*$IQN-lun-1)

View File

@ -44,6 +44,9 @@ DST_HOST=`arg_host $DST`
DST_DIR=`dirname $DST_PATH`
SRC_DS_DIR=`dirname $SRC_PATH`
SRC_VM_DIR=`basename $SRC_PATH`
if [ `is_disk $DST_PATH` -eq 1 ]; then
exit 0
fi
@ -60,7 +63,7 @@ log "Moving $SRC to $DST"
ssh_exec_and_log "$DST_HOST" "rm -rf '$DST_PATH'" \
"Error removing target path to prevent overwrite errors"
TAR_COPY="$SSH $SRC_HOST '$TAR -C $SRC_PATH/.. -cf - .'"
TAR_COPY="$SSH $SRC_HOST '$TAR -C $SRC_DS_DIR -cf - $SRC_VM_DIR'"
TAR_COPY="$TAR_COPY | $SSH $DST_HOST '$TAR -C $DST_DIR -xf -'"
exec_and_log "eval $TAR_COPY" "Error copying disk directory to target host"