Revision 3754e88d

View differences:

src/mad/sh/scripts_common.sh
250 250
            echo "$MKSWAP $DST"
251 251
            return 0
252 252
            ;;
253
        "vmdk_*")
254
            VMWARE_DISK_TYPE=`echo $FSTYPE|cut -d'_' -f 1`
253
        "vmdk_"*)
254
            VMWARE_DISK_TYPE=`echo $FSTYPE|cut -d'_' -f 2`
255 255
            echo "WHICH_SUDO=\$(which sudo) ; \
256 256
                  [ ! -z \"\$WHICH_SUDO\" -a -f \"\$WHICH_SUDO\" ] && SUDO=\"sudo\" ; \
257
                  $SUDO $VMKFSTOOLS -U $DST/disk.vmdk; \
258
                  $SUDO $VMKFSTOOLS -c ${SIZE}M -d ${VMWARE_DISK_TYPE} $DST_PATH/disk.vmdk"
257
                  \$SUDO $VMKFSTOOLS -U $DST/disk.vmdk; \
258
                  \$SUDO $VMKFSTOOLS -c ${SIZE}M -d ${VMWARE_DISK_TYPE} $DST/disk.vmdk"
259 259
            return 0
260 260
            ;;
261 261
        *)
src/tm_mad/vmware/mkimage
44 44
#-------------------------------------------------------------------------------
45 45
DST_PATH=`arg_path $DST`
46 46
DST_HOST=`arg_host $DST`
47
DST_DIR=`dirname $DST_PATH`
47 48

  
48
ssh_make_path $DST_HOST $DST_PATH
49
ssh_make_path $DST_HOST $DST_DIR
49 50

  
50 51
#-------------------------------------------------------------------------------
51 52
# Make the new image (file-based)
52 53
#-------------------------------------------------------------------------------
53 54
MKFS_CMD=`mkfs_command $DST_PATH $FSTYPE $SIZE`
54 55

  
56
CREATE_IMAGE="mkdir -p $DST_PATH"
57
 
55 58
MKSCRIPT=$(cat <<EOF
56 59
export PATH=/usr/sbin:/sbin:\$PATH
60
$CREATE_IMAGE
57 61
$MKFS_CMD
58 62
EOF
59 63
)
60 64

  
61 65
log "Making filesystem of ${SIZE}M and type $FSTYPE at $DST"
62 66

  
63
ssh_exec_and_log $DST_HOST "$MKSCRIPT" "Could not create image $DST_PATH/disk.vmdk"
67
ssh_exec_and_log $DST_HOST "$MKSCRIPT" "Could not create image $DST_PATH"
64 68

  
65 69
exit 0

Also available in: Unified diff