Merge branch 'feature-2970'

This commit is contained in:
Javi Fontan committed 2014-06-24 12:28:36 +02:00
commit 390637da37
21 files changed
+268 -2

No files matched your search

+21
View File
@@ -273,6 +273,7 @@ VAR_DIRS="$VAR_LOCATION/remotes \
$VAR_LOCATION/remotes/tm/vmfs \
$VAR_LOCATION/remotes/tm/lvm \
$VAR_LOCATION/remotes/tm/ceph \
$VAR_LOCATION/remotes/tm/dev \
$VAR_LOCATION/remotes/hooks \
$VAR_LOCATION/remotes/hooks/ft \
$VAR_LOCATION/remotes/datastore \
@@ -281,6 +282,7 @@ VAR_DIRS="$VAR_LOCATION/remotes \
$VAR_LOCATION/remotes/datastore/vmfs \
$VAR_LOCATION/remotes/datastore/lvm \
$VAR_LOCATION/remotes/datastore/ceph \
$VAR_LOCATION/remotes/datastore/dev \
$VAR_LOCATION/remotes/auth \
$VAR_LOCATION/remotes/auth/plain \
$VAR_LOCATION/remotes/auth/ssh \
@@ -431,6 +433,7 @@ INSTALL_FILES=(
TM_VMFS_FILES:$VAR_LOCATION/remotes/tm/vmfs
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_DUMMY_FILES:$VAR_LOCATION/remotes/tm/dummy
DATASTORE_DRIVER_COMMON_SCRIPTS:$VAR_LOCATION/remotes/datastore/
DATASTORE_DRIVER_DUMMY_SCRIPTS:$VAR_LOCATION/remotes/datastore/dummy
@@ -438,6 +441,7 @@ INSTALL_FILES=(
DATASTORE_DRIVER_VMFS_SCRIPTS:$VAR_LOCATION/remotes/datastore/vmfs
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
NETWORK_FILES:$VAR_LOCATION/remotes/vnm
NETWORK_8021Q_FILES:$VAR_LOCATION/remotes/vnm/802.1Q
NETWORK_DUMMY_FILES:$VAR_LOCATION/remotes/vnm/dummy
@@ -902,6 +906,7 @@ NETWORK_VMWARE_FILES="src/vnm_mad/remotes/vmware/clean \
# - VMWARE TM, $VAR_LOCATION/tm/vmware
# - LVM TM, $VAR_LOCATION/tm/lvm
# - CEPH TM, $VAR_LOCATION/tm/ceph
# - DEV TM, $VAR_LOCATION/tm/dev
#-------------------------------------------------------------------------------
TM_FILES="src/tm_mad/tm_common.sh"
@@ -993,6 +998,15 @@ TM_CEPH_FILES="src/tm_mad/ceph/clone \
src/tm_mad/ceph/postmigrate \
src/tm_mad/ceph/delete"
TM_DEV_FILES="src/tm_mad/dev/clone \
src/tm_mad/dev/ln \
src/tm_mad/dev/mv \
src/tm_mad/dev/mvds \
src/tm_mad/dev/cpds \
src/tm_mad/dev/premigrate \
src/tm_mad/dev/postmigrate \
src/tm_mad/dev/delete"
#-------------------------------------------------------------------------------
# Datastore drivers, to be installed under $REMOTES_LOCATION/datastore
# - Dummy Image Repository, $REMOTES_LOCATION/datastore/dummy
@@ -1043,6 +1057,13 @@ DATASTORE_DRIVER_CEPH_SCRIPTS="src/datastore_mad/remotes/ceph/cp \
src/datastore_mad/remotes/ceph/clone \
src/datastore_mad/remotes/ceph/ceph.conf"
DATASTORE_DRIVER_DEV_SCRIPTS="src/datastore_mad/remotes/dev/cp \
src/datastore_mad/remotes/dev/mkfs \
src/datastore_mad/remotes/dev/stat \
src/datastore_mad/remotes/dev/rm \
src/datastore_mad/remotes/dev/monitor \
src/datastore_mad/remotes/dev/clone"
#-------------------------------------------------------------------------------
# Migration scripts for onedb command, to be installed under $LIB_LOCATION
#-------------------------------------------------------------------------------
+7 -2
View File
@@ -443,7 +443,7 @@ VM_MAD = [
TM_MAD = [
executable = "one_tm",
arguments = "-t 15 -d dummy,lvm,shared,fs_lvm,qcow2,ssh,vmfs,ceph"
arguments = "-t 15 -d dummy,lvm,shared,fs_lvm,qcow2,ssh,vmfs,ceph,dev"
]
#*******************************************************************************
@@ -461,7 +461,7 @@ TM_MAD = [
DATASTORE_MAD = [
executable = "one_datastore",
arguments = "-t 15 -d dummy,fs,vmfs,lvm,ceph"
arguments = "-t 15 -d dummy,fs,vmfs,lvm,ceph,dev"
]
#*******************************************************************************
@@ -758,3 +758,8 @@ TM_MAD_CONF = [
TM_MAD_CONF = [
name = "ceph", ln_target = "NONE", clone_target = "SELF", shared = "yes"
]
TM_MAD_CONF = [
name = "dev", ln_target = "NONE", clone_target = "SELF", shared = "yes"
]
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
# -------------------------------------------------------------------------- #
# Copyright 2002-2014, OpenNebula Project (OpenNebula.org), C12G Labs #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
script_name=$(basename $0)
echo "$script_name: Operation not supported" &>2
exit 1
+1
View File
@@ -0,0 +1 @@
../common/not_supported.sh
+55
View File
@@ -0,0 +1,55 @@
#!/bin/bash
# -------------------------------------------------------------------------- #
# Copyright 2002-2014, OpenNebula Project (OpenNebula.org), C12G Labs #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
###############################################################################
# This script is used to copy a VM image (SRC) to the image repository as DST
# Several SRC types are supported
###############################################################################
# -------- Set up the environment to source common tools & conf ------------
if [ -z "${ONE_LOCATION}" ]; then
LIB_LOCATION=/usr/lib/one
else
LIB_LOCATION=$ONE_LOCATION/lib
fi
. $LIB_LOCATION/sh/tm_common.sh
DRIVER_PATH=$(dirname $0)
source ${DRIVER_PATH}/../libfs.sh
# -------- Get cp and datastore arguments from OpenNebula core ------------
DRV_ACTION=$1
ID=$2
UTILS_PATH="${DRIVER_PATH}/.."
XPATH="$UTILS_PATH/xpath.rb -b $DRV_ACTION"
unset i XPATH_ELEMENTS
while IFS= read -r -d '' element; do
XPATH_ELEMENTS[i++]="$element"
done < <($XPATH /DS_DRIVER_ACTION_DATA/IMAGE/PATH)
SRC="${XPATH_ELEMENTS[0]}"
echo "$SRC"
+1
View File
@@ -0,0 +1 @@
../common/not_supported.sh
+23
View File
@@ -0,0 +1,23 @@
#!/bin/bash
# -------------------------------------------------------------------------- #
# Copyright 2002-2014, OpenNebula Project (OpenNebula.org), C12G Labs #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
echo "USED_MB=0"
echo "TOTAL_MB=1"
echo "FREE_MB=1"
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
# -------------------------------------------------------------------------- #
# Copyright 2002-2014, OpenNebula Project (OpenNebula.org), C12G Labs #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
exit 0
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
# -------------------------------------------------------------------------- #
# Copyright 2002-2014, OpenNebula Project (OpenNebula.org), C12G Labs #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
echo "0"
+24
View File
@@ -0,0 +1,24 @@
#!/bin/bash
# -------------------------------------------------------------------------- #
# Copyright 2002-2014, OpenNebula Project (OpenNebula.org), C12G Labs #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
script_name=$(basename $0)
echo "$script_name: Operation not supported" &>2
exit 1
+1
View File
@@ -0,0 +1 @@
ln
+1
View File
@@ -0,0 +1 @@
../common/context
+1
View File
@@ -0,0 +1 @@
../common/not_supported.sh
+1
View File
@@ -0,0 +1 @@
../common/dummy.sh
+62
View File
@@ -0,0 +1,62 @@
#!/bin/bash
# -------------------------------------------------------------------------- #
# Copyright 2002-2014, OpenNebula Project (OpenNebula.org), C12G Labs #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
# clone fe:SOURCE host:remote_system_ds/disk.i vmid dsid
# - fe is the front-end hostname
# - SOURCE is the path of the disk image in the form DS_BASE_PATH/disk
# - host is the target host to deploy the VM
# - remote_system_ds is the path for the system datastore in the host
# - vmid is the id of the VM
# - dsid is the target datastore (0 is the system datastore)
SRC=$1
DST=$2
VMID=$3
DSID=$4
if [ -z "${ONE_LOCATION}" ]; then
TMCOMMON=/var/lib/one/remotes/tm/tm_common.sh
else
TMCOMMON=$ONE_LOCATION/var/remotes/tm/tm_common.sh
fi
. $TMCOMMON
DST_PATH=`arg_path $DST`
DST_HOST=`arg_host $DST`
DST_DIR=`dirname $DST_PATH`
SRC_PATH=`arg_path $SRC`
#-------------------------------------------------------------------------------
# Create DST path
#-------------------------------------------------------------------------------
ssh_make_path $DST_HOST $DST_DIR
#-------------------------------------------------------------------------------
# Link (ln) SRC into DST
#-------------------------------------------------------------------------------
log "Linking $SRC_PATH in $DST"
ssh_exec_and_log $DST_HOST \
"cd $DST_DIR; rm $DST_PATH ; ln -s $SRC_PATH $DST_PATH" \
"Error linking $SRC to $DST"
exit 0
+1
View File
@@ -0,0 +1 @@
../common/dummy.sh
+1
View File
@@ -0,0 +1 @@
../common/dummy.sh
+1
View File
@@ -0,0 +1 @@
../common/dummy.sh
+1
View File
@@ -0,0 +1 @@
../common/dummy.sh
+1
View File
@@ -0,0 +1 @@
../common/postmigrate
+1
View File
@@ -0,0 +1 @@
../common/premigrate