 +
 +    pdisk:*)
 +        log "Persistent disk handling $SRC $DST"
-+        DST_HOST=`arg_host $DST`
 +        exec_and_log "$SSH -t -t $DST_HOST /usr/sbin/attach-persistent-disk.sh $SRC $DST_PATH" \
-+            "Failed to create persistent disk $DST_PATH"
++            "Failed to clone persistent disk $DST_PATH"
++        exec_and_log "echo \"$SSH -t -t $DST_HOST /usr/sbin/detach-persistent-disk.sh $VM_ID\" > /tmp/pdisk.$VM_ID" \
++           "Failed to write persistent disk properties"
 +        ;;
 +
 +    *)

+exec_and_log "$SSH $DST_HOST chmod ug+w,o-rwx $DST_PATH"
 
diff --git a/src/tm_mad/nfs/tm_clone.sh b/src/tm_mad/nfs/tm_clone.sh
index 62c33fc..3433700 100755
--- a/src/tm_mad/nfs/tm_clone.sh
+++ b/src/tm_mad/nfs/tm_clone.sh
@@ -31,6 +31,7 @@ get_vmdir
 
 SRC_PATH=`arg_path $SRC`
 DST_PATH=`arg_path $DST`
+DST_HOST=`arg_host $DST`
 
 fix_paths
 
@@ -41,21 +42,53 @@ DST_DIR=`dirname $DST_PATH`
 
 log "Creating directory $DST_DIR"
 exec_and_log "mkdir -p $DST_DIR"

+exec_and_log "chmod ug+w,o-rwx $DST_PATH"
 
diff --git a/src/tm_mad/ssh/tm_clone.sh b/src/tm_mad/ssh/tm_clone.sh
index 71800d1..c7333c5 100755
--- a/src/tm_mad/ssh/tm_clone.sh
+++ b/src/tm_mad/ssh/tm_clone.sh
@@ -33,6 +33,8 @@ DST_PATH=`arg_path $DST`
 SRC_HOST=`arg_host $SRC`
 DST_HOST=`arg_host $DST`
 
+VM_DIR=`dirname $SRC_PATH`
+VM_ID=`basename $VM_DIR`
 
 log_debug "$1 $2"
 log_debug "DST: $DST_PATH"
@@ -43,19 +45,52 @@ log "Creating directory $DST_DIR"
 exec_and_log "$SSH $DST_HOST mkdir -p $DST_DIR" \
     "Error creating directory $DST_DIR"
 
