1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-02-28 17:57:22 +03:00

Feature #4238: Create a new set of ISCSI drivers instead

of reusing the DEV drivers
This commit is contained in:
Jaime Melis 2015-12-22 10:03:58 +01:00
parent d0f15994f4
commit 3504486828
24 changed files with 54 additions and 27 deletions

View File

@ -285,6 +285,7 @@ VAR_DIRS="$VAR_LOCATION/remotes \
$VAR_LOCATION/remotes/tm/lvm \
$VAR_LOCATION/remotes/tm/ceph \
$VAR_LOCATION/remotes/tm/dev \
$VAR_LOCATION/remotes/tm/iscsi \
$VAR_LOCATION/remotes/hooks \
$VAR_LOCATION/remotes/hooks/ft \
$VAR_LOCATION/remotes/datastore \
@ -294,6 +295,7 @@ VAR_DIRS="$VAR_LOCATION/remotes \
$VAR_LOCATION/remotes/datastore/lvm \
$VAR_LOCATION/remotes/datastore/ceph \
$VAR_LOCATION/remotes/datastore/dev \
$VAR_LOCATION/remotes/datastore/iscsi \
$VAR_LOCATION/remotes/auth \
$VAR_LOCATION/remotes/auth/plain \
$VAR_LOCATION/remotes/auth/ssh \
@ -419,6 +421,7 @@ INSTALL_FILES=(
TM_LVM_FILES:$VAR_LOCATION/remotes/tm/lvm
TM_CEPH_FILES:$VAR_LOCATION/remotes/tm/ceph
TM_DEV_FILES:$VAR_LOCATION/remotes/tm/dev
TM_ISCSI_FILES:$VAR_LOCATION/remotes/tm/iscsi
TM_DUMMY_FILES:$VAR_LOCATION/remotes/tm/dummy
DATASTORE_DRIVER_COMMON_SCRIPTS:$VAR_LOCATION/remotes/datastore/
DATASTORE_DRIVER_DUMMY_SCRIPTS:$VAR_LOCATION/remotes/datastore/dummy
@ -427,6 +430,7 @@ INSTALL_FILES=(
DATASTORE_DRIVER_LVM_SCRIPTS:$VAR_LOCATION/remotes/datastore/lvm
DATASTORE_DRIVER_CEPH_SCRIPTS:$VAR_LOCATION/remotes/datastore/ceph
DATASTORE_DRIVER_DEV_SCRIPTS:$VAR_LOCATION/remotes/datastore/dev
DATASTORE_DRIVER_ISCSI_SCRIPTS:$VAR_LOCATION/remotes/datastore/iscsi
NETWORK_FILES:$VAR_LOCATION/remotes/vnm
NETWORK_8021Q_FILES:$VAR_LOCATION/remotes/vnm/802.1Q
NETWORK_VXLAN_FILES:$VAR_LOCATION/remotes/vnm/vxlan
@ -975,6 +979,7 @@ NETWORK_VMWARE_FILES="src/vnm_mad/remotes/vmware/clean \
# - LVM TM, $VAR_LOCATION/tm/lvm
# - CEPH TM, $VAR_LOCATION/tm/ceph
# - DEV TM, $VAR_LOCATION/tm/dev
# - ISCSI TM, $VAR_LOCATION/tm/iscsi
#-------------------------------------------------------------------------------
TM_FILES="src/tm_mad/tm_common.sh"
@ -1126,6 +1131,20 @@ TM_DEV_FILES="src/tm_mad/dev/clone \
src/tm_mad/dev/failmigrate \
src/tm_mad/dev/delete"
TM_ISCSI_FILES="src/tm_mad/iscsi/clone \
src/tm_mad/iscsi/ln \
src/tm_mad/iscsi/mv \
src/tm_mad/iscsi/mvds \
src/tm_mad/iscsi/cpds \
src/tm_mad/iscsi/premigrate \
src/tm_mad/iscsi/postmigrate \
src/tm_mad/iscsi/snap_create \
src/tm_mad/iscsi/snap_create_live \
src/tm_mad/iscsi/snap_delete \
src/tm_mad/iscsi/snap_revert \
src/tm_mad/iscsi/failmigrate \
src/tm_mad/iscsi/delete"
#-------------------------------------------------------------------------------
# Datastore drivers, to be installed under $REMOTES_LOCATION/datastore
# - Dummy Image Repository, $REMOTES_LOCATION/datastore/dummy
@ -1202,6 +1221,16 @@ DATASTORE_DRIVER_DEV_SCRIPTS="src/datastore_mad/remotes/dev/cp \
src/datastore_mad/remotes/dev/snap_flatten \
src/datastore_mad/remotes/dev/clone"
DATASTORE_DRIVER_ISCSI_SCRIPTS="src/datastore_mad/remotes/iscsi/cp \
src/datastore_mad/remotes/iscsi/mkfs \
src/datastore_mad/remotes/iscsi/stat \
src/datastore_mad/remotes/iscsi/rm \
src/datastore_mad/remotes/iscsi/monitor \
src/datastore_mad/remotes/iscsi/snap_delete \
src/datastore_mad/remotes/iscsi/snap_revert \
src/datastore_mad/remotes/iscsi/snap_flatten \
src/datastore_mad/remotes/iscsi/clone"
#-------------------------------------------------------------------------------
# Migration scripts for onedb command, to be installed under $LIB_LOCATION
#-------------------------------------------------------------------------------

View File

@ -0,0 +1 @@
../common/not_supported.sh

View File

@ -0,0 +1 @@
../dev/cp

View File

@ -0,0 +1 @@
../common/not_supported.sh

View File

@ -0,0 +1 @@
../dev/monitor

View File

@ -0,0 +1 @@
../dev/rm

View File

@ -0,0 +1 @@
../common/not_supported.sh

View File

@ -0,0 +1 @@
../common/not_supported.sh

View File

@ -0,0 +1 @@
../common/not_supported.sh

View File

@ -0,0 +1 @@
../dev/stat

View File

@ -26,8 +26,9 @@
SRC=$1
DST=$2
VM_ID=$3
DS_ID=$4
VMID=$3
DSID=$4
if [ -z "${ONE_LOCATION}" ]; then
TMCOMMON=/var/lib/one/remotes/tm/tm_common.sh
@ -35,8 +36,6 @@ else
TMCOMMON=$ONE_LOCATION/var/remotes/tm/tm_common.sh
fi
DRIVER_PATH=$(dirname $0)
. $TMCOMMON
DST_PATH=`arg_path $DST`
@ -45,37 +44,14 @@ DST_DIR=`dirname $DST_PATH`
SRC_PATH=`arg_path $SRC`
DISK_ID=$(echo $DST|awk -F. '{print $NF}')
#-------------------------------------------------------------------------------
# Create DST path
#-------------------------------------------------------------------------------
ssh_make_path $DST_HOST $DST_DIR
#-------------------------------------------------------------------------------
# Get Image information
#-------------------------------------------------------------------------------
XPATH="${DRIVER_PATH}/../../datastore/xpath.rb --stdin"
unset i j XPATH_ELEMENTS
while IFS= read -r -d '' element; do
XPATH_ELEMENTS[i++]="$element"
done < <(onevm show -x $VM_ID| $XPATH \
/VM/TEMPLATE/DISK[DISK_ID=$DISK_ID]/TYPE)
TYPE="${XPATH_ELEMENTS[j++]}"
#-------------------------------------------------------------------------------
# Link (ln) SRC into DST
#-------------------------------------------------------------------------------
if [ "$TYPE" = "ISCSI" ]; then
# No need to do anything
exit 0
fi
log "Linking $SRC_PATH in $DST"
ssh_exec_and_log $DST_HOST \

1
src/tm_mad/iscsi/clone Symbolic link
View File

@ -0,0 +1 @@
../common/dummy.sh

1
src/tm_mad/iscsi/cpds Symbolic link
View File

@ -0,0 +1 @@
../common/not_supported.sh

1
src/tm_mad/iscsi/delete Symbolic link
View File

@ -0,0 +1 @@
../common/dummy.sh

View File

@ -0,0 +1 @@
../common/failmigrate

1
src/tm_mad/iscsi/ln Symbolic link
View File

@ -0,0 +1 @@
../common/dummy.sh

1
src/tm_mad/iscsi/mv Symbolic link
View File

@ -0,0 +1 @@
../common/dummy.sh

1
src/tm_mad/iscsi/mvds Symbolic link
View File

@ -0,0 +1 @@
../common/dummy.sh

View File

@ -0,0 +1 @@
../common/postmigrate

1
src/tm_mad/iscsi/premigrate Symbolic link
View File

@ -0,0 +1 @@
../common/premigrate

View File

@ -0,0 +1 @@
../common/not_supported.sh

View File

@ -0,0 +1 @@
../common/not_supported.sh

View File

@ -0,0 +1 @@
../common/not_supported.sh

View File

@ -0,0 +1 @@
../common/not_supported.sh