diff --git a/src/datastore_mad/remotes/vmfs/mkfs b/src/datastore_mad/remotes/vmfs/mkfs index 54139b5076..355284cce1 100755 --- a/src/datastore_mad/remotes/vmfs/mkfs +++ b/src/datastore_mad/remotes/vmfs/mkfs @@ -93,6 +93,11 @@ log "Making raw filesystem of ${SIZE}M at [$DS_ID]$DST_FOLDER on $DST_HOST" IMAGE_FORMAT=vmdk VMWARE_DISK_TYPE=`echo $FSTYPE|cut -d'_' -f 2` +echo "$VMWARE_DISK_TYPE" | grep '\\|\\|\' + +if [ $? -eq 1 ] ; then + VMWARE_DISK_TYPE="thin" +fi if [ "$USE_SSH" == "yes" ]; then $SSH $DST_HOST $VMKFSTOOLS -U [$DS_ID]$DST_FOLDER/disk.vmdk &> /dev/null diff --git a/src/datastore_mad/remotes/vmfs/rm b/src/datastore_mad/remotes/vmfs/rm index d929ad4118..93fcae6da7 100755 --- a/src/datastore_mad/remotes/vmfs/rm +++ b/src/datastore_mad/remotes/vmfs/rm @@ -68,8 +68,8 @@ vmfs_set_up log "Removing $SRC from the image repository" -if [ "$USE_SSH" == "yes" ]; then - if [ -n $DS_ID -a -n $DST_FOLDER ]; then +if [ "$USE_SSH" == "yes" ]; then + if [ -n $DS_ID -a -n $SRC_FOLDER ]; then ssh_exec_and_log $DST_HOST "rm -rf $SRC" "Error deleting $SRC" fi else @@ -77,10 +77,10 @@ else FILES_TO_ERASE=`vifs $VI_PARAMS --dir [$DS_ID]$SRC_FOLDER|grep -v "Content Listing"|grep -v "\-\-\-\-\-\-\-\-"|egrep -v "^[[:space:]]*$"` for file in $FILES_TO_ERASE; do exec_and_log "vifs $VI_PARAMS --force --rm [$DS_ID]$SRC_FOLDER/$file" \ - "Cannot delete $DST_FOLDER/$file in $DST_HOST" + "Cannot delete $SRC_FOLDER/$file in $DST_HOST" done - exec_and_log "vifs $VI_PARAMS --force --rm [$DS_ID]$DST_FOLDER" \ - "Cannot delete $DST_FOLDER in $DST_HOST" + exec_and_log "vifs $VI_PARAMS --force --rm [$DS_ID]$SRC_FOLDER" \ + "Cannot delete $SRC_FOLDER in $DST_HOST" fi exit 0 diff --git a/src/mad/sh/scripts_common.sh b/src/mad/sh/scripts_common.sh index 23cb6502fd..c269f94de5 100644 --- a/src/mad/sh/scripts_common.sh +++ b/src/mad/sh/scripts_common.sh @@ -282,10 +282,8 @@ function mkfs_command { ;; "vmdk_"*) VMWARE_DISK_TYPE=`echo $FSTYPE|cut -d'_' -f 2` - echo "WHICH_SUDO=\$(which sudo) ; \ - [ ! -z \"\$WHICH_SUDO\" -a -f \"\$WHICH_SUDO\" ] && SUDO=\"sudo\" ; \ - \$SUDO $VMKFSTOOLS -U $DST/disk.vmdk; \ - \$SUDO $VMKFSTOOLS -c ${SIZE}M -d ${VMWARE_DISK_TYPE} $DST/disk.vmdk" + echo "$VMKFSTOOLS -U $DST/disk.vmdk; \ + $VMKFSTOOLS -c ${SIZE}M -d ${VMWARE_DISK_TYPE} $DST/disk.vmdk" return 0 ;; *) @@ -416,7 +414,7 @@ function is_iscsi { fi } -# Checks wether $IMAGE_TYPE is CDROM +# Checks wether $IMAGE_TYPE is CDROM function is_cdrom { [ "$IMAGE_TYPE" = "1" ] }