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

tm_nfs now fixes urls that point to VM_DIR remotelly

git-svn-id: http://svn.opennebula.org/one/trunk@894 3034c82b-c49b-4eb3-8279-a7acafdc01c0
This commit is contained in:
Javier Fontán Muiños 2009-10-26 15:39:04 +00:00
parent cbc442949f
commit 8fe27e0f48
8 changed files with 65 additions and 0 deletions

View File

@ -28,9 +28,13 @@ fi
. $TMCOMMON
get_vmdir
SRC_PATH=`arg_path $SRC`
DST_PATH=`arg_path $DST`
fix_paths
log "$1 $2"
log "DST: $DST_PATH"

View File

@ -38,8 +38,12 @@ fi
. $TMCOMMON
get_vmdir
DST_PATH=`arg_path $DST`
fix_dst_path
DST_DIR=`dirname $DST_PATH`
ISO_DIR=$DST_DIR/isofiles

View File

@ -28,7 +28,11 @@ fi
. $TMCOMMON
get_vmdir
SRC_PATH=`arg_path $SRC`
fix_src_path
log "Deleting $SRC_PATH"
exec_and_log "rm -rf $SRC_PATH"

View File

@ -28,9 +28,13 @@ fi
. $TMCOMMON
get_vmdir
SRC_PATH=`arg_path $SRC`
DST_PATH=`arg_path $DST`
fix_dst_path
DST_DIR=`dirname $DST_PATH`
log "Creating directory $DST_DIR"

View File

@ -25,11 +25,16 @@ fi
. $TMCOMMON
get_vmdir
SIZE=$1
FSTYPE=$2
DST=$3
DST_PATH=`arg_path $DST`
fix_dst_path
DST_DIR=`dirname $DST_PATH`
exec_and_log "mkdir -p $DST_DIR"

View File

@ -28,7 +28,12 @@ fi
. $TMCOMMON
get_vmdir
DST_PATH=`arg_path $DST`
fix_dst_path
DST_DIR=`dirname $DST_PATH`
log "Creating directory $DST_DIR"

View File

@ -30,9 +30,13 @@ fi
. $TMCOMMON
get_vmdir
SRC_PATH=`arg_path $SRC`
DST_PATH=`arg_path $DST`
fix_paths
if [ "$SRC_PATH" == "$DST_PATH" ]; then
log "Will not move, source and destination are equal"
else

View File

@ -15,6 +15,41 @@
# limitations under the License. #
#--------------------------------------------------------------------------- #
if [ -z "$ONE_LOCATION" ]; then
ONE_CONF=/etc/one/oned.conf
ONE_LOCAL_VAR=/var/lib/one
else
ONE_CONF=$ONE_LOCATION/etc/oned.conf
ONE_LOCAL_VAR=$ONE_LOCATION/var
fi
function get_vmdir
{
VMDIR=`cat $ONE_CONF | grep ^VM_DIR= | cut -d= -f2`
}
function fix_paths
{
if [ -n "$VMDIR" ]; then
SRC_PATH=${SRC_PATH/$VMDIR/$ONE_LOCAL_VAR}
DST_PATH=${DST_PATH/$VMDIR/$ONE_LOCAL_VAR}
fi
}
function fix_src_path
{
if [ -n "$VMDIR" ]; then
SRC_PATH=${SRC_PATH/$VMDIR/$ONE_LOCAL_VAR}
fi
}
function fix_dst_path
{
if [ -n "$VMDIR" ]; then
DST_PATH=${DST_PATH/$VMDIR/$ONE_LOCAL_VAR}
fi
}
# Used for log messages
SCRIPT_NAME=`basename $0`