From 66a25715b075280553ad015b47f861c563502243 Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Thu, 19 Sep 2013 16:07:29 +0200 Subject: [PATCH] Ceph should clone images in the target HOST, not in the BRIDGE_LIST --- src/tm_mad/ceph/clone | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/src/tm_mad/ceph/clone b/src/tm_mad/ceph/clone index 995f541744..df419ff8ba 100755 --- a/src/tm_mad/ceph/clone +++ b/src/tm_mad/ceph/clone @@ -36,31 +36,8 @@ fi DRIVER_PATH=$(dirname $0) source $TMCOMMON -source ${DRIVER_PATH}/../../datastore/ceph/ceph.conf -#------------------------------------------------------------------------------- -# Get Image information -#------------------------------------------------------------------------------- - -DISK_ID=$(echo "$DST_PATH" | $AWK -F. '{print $NF}') - -XPATH="${DRIVER_PATH}/../../datastore/xpath.rb --stdin" - -unset i XPATH_ELEMENTS - -while IFS= read -r -d '' element; do - XPATH_ELEMENTS[i++]="$element" -done < <(onedatastore show -x $DS_ID | $XPATH \ - /DATASTORE/TEMPLATE/HOST) - -unset i - -CEPH_HOST="${XPATH_ELEMENTS[i++]}" - -if [ -z "$CEPH_HOST" ]; then - error_message "Datastore template missing 'HOST' attribute." - exit -1 -fi +DST_HOST=`arg_host $DST` #------------------------------------------------------------------------------- # Compute the destination image name @@ -75,6 +52,6 @@ RBD_DST="${SRC_PATH}-${VM_ID}-${DISK_ID}" # Clone the image #------------------------------------------------------------------------------- -ssh_exec_and_log "$CEPH_HOST" "$RBD copy $SRC_PATH $RBD_DST" \ - "Error cloning $SRC_PATH to $RBD_DST in $CEPH_HOST" +ssh_exec_and_log "$DST_HOST" "$RBD copy $SRC_PATH $RBD_DST" \ + "Error cloning $SRC_PATH to $RBD_DST in $DST_HOST" exit 0