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

feature #1437: Make DS_ID a parameter in vmfs_create_remote_path

This commit is contained in:
Tino Vazquez 2012-09-28 15:06:24 +02:00
parent 0b427dde45
commit 7d49f9cbcb
3 changed files with 8 additions and 8 deletions

View File

@ -88,7 +88,7 @@ set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" "$UMASK"
vmfs_set_up
vmfs_create_remote_path
vmfs_create_remote_path $DS_ID
# ------------ Prepare for a possible download in the front-end -------------

View File

@ -78,6 +78,8 @@ set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" "$UMASK"
vmfs_set_up
vmfs_create_remote_path $DS_ID
# ------------ Image to save_as disk, no need to create a FS ------------
if [ "$FSTYPE" = "save_as" ]; then
@ -93,15 +95,11 @@ IMAGE_FORMAT=vmdk
VMWARE_DISK_TYPE=`echo $FSTYPE|cut -d'_' -f 2`
if [ "$USE_SSH" == "yes" ]; then
ssh_exec_and_log $DST_HOST "mkdir -p /vmfs/volumes/$DS_ID/$DST_FOLDER" \
"Could not create disk directory /vmfs/volumes/$DS_ID/$DST_FOLDER on $DST_HOST"
$SSH $DST_HOST $VMKFSTOOLS -U [$DS_ID]$DST_FOLDER/disk.vmdk
ssh_exec_and_log $DST_HOST "$VMKFSTOOLS -c ${SIZE}M -d ${VMWARE_DISK_TYPE} /vmfs/volumes/$DS_ID/$DST_FOLDER/disk.vmdk" \
"Cannot create [$DS_ID] $DST_FOLDER/disk.vmdk on $DST_HOST"
else
$VMKFSTOOLS $VI_PARAMS -U [$DS_ID]$DST_FOLDER/disk.vmdk &> /dev/null
exec_and_log "vifs $VI_PARAMS --mkdir [$IDS_ID]$DST_FOLDER" \
"Cannot create [$DS_ID] $DST_FOLDER on $DST_HOST"
exec_and_log "$VMKFSTOOLS $VI_PARAMS -c ${SIZE}M -d ${VMWARE_DISK_TYPE} [$DS_ID]$DST_FOLDER/disk.vmdk" \
"Cannot create $DS_ID]$DST_FOLDER/disk.vmdk on $DST_HOST"
fi

View File

@ -411,12 +411,14 @@ function iqn_get_host {
}
function vmfs_crate_remote_path {
DS_ID=$1
# Create DST in DST_HOST
if [ "$USE_SSH" == "yes" ]; then
ssh_make_path $DST_HOST $DST
exec_and_log "ssh_make_path $DST_HOST $DST" \
"Cannot create $DST in $DST_HOST"
else
exec_and_log "vifs $VI_PARAMS --mkdir [$DS_ID]$DST_FOLDER" \
"Cannot create $DST in $DST_HOST"
exec_and_log "vifs $VI_PARAMS --mkdir [$DS_ID]$DST_FOLDER" \
"Cannot create [$DS_ID]$DST_FOLDER in $DST_HOST"
fi
}