Skip to content

Commit

Permalink
B #4089: Fix mkfs for fs_lvm (#1074)
Browse files Browse the repository at this point in the history
(cherry picked from commit d245a0f)
  • Loading branch information
xorel authored and rsmontero committed Apr 8, 2021
1 parent aefdb0c commit 5b4a841
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/tm_mad/fs_lvm/mkimage
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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++]}"
Expand All @@ -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
Expand Down

0 comments on commit 5b4a841

Please sign in to comment.