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

B #4089: Fix mkfs for fs_lvm (#1074)

(cherry picked from commit d245a0fe9b51aa0056208f393f9c928ca4d5829e)
This commit is contained in:
Jan Orel 2021-04-07 13:25:52 +02:00 committed by Ruben S. Montero
parent 955c2160ba
commit 112cf19998
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

View File

@ -30,13 +30,16 @@ VM_ID=$4
if [ -z "${ONE_LOCATION}" ]; then
TMCOMMON=/var/lib/one/remotes/tm/tm_common.sh
LIB_LOCATION=/usr/lib/one
else
TMCOMMON=$ONE_LOCATION/var/remotes/tm/tm_common.sh
LIB_LOCATION=$ONE_LOCATION/lib
fi
DRIVER_PATH=$(dirname $0)
source $TMCOMMON
source $LIB_LOCATION/sh/scripts_common.sh
source ${DRIVER_PATH}/../../datastore/libfs.sh
source ${DRIVER_PATH}/../../etc/tm/fs_lvm/fs_lvm.conf
source ${DRIVER_PATH}/../../etc/datastore/datastore.conf
@ -63,7 +66,7 @@ unset i j XPATH_ELEMENTS
while IFS= read -r -d '' element; do
XPATH_ELEMENTS[i++]="$element"
done < <(onevm show -x $VMID | $XPATH \
done < <(onevm show -x $VM_ID | $XPATH \
/VM/TEMPLATE/DISK[DISK_ID=$DISK_ID]/FS)
FS="${XPATH_ELEMENTS[j++]}"
@ -90,6 +93,9 @@ exclusive "${LOCK}" 120 ssh_exec_and_log "$DST_HOST" "$CREATE_CMD" \
"Error creating LV named $LV_NAME"
MKIMAGE_CMD=$(cat <<EOF
# prints function content
$(type contains| grep -v 'is a function')
set -e -o pipefail
export PATH=/usr/sbin:/sbin:\$PATH