Skip to content
Snippets Groups Projects
Commit f04bb1d7 authored by Elena Gryaznova's avatar Elena Gryaznova
Browse files

b=17477

i=Adilger
check config if lustre is mounted before acc-sm run
parent ac21c0e8
No related branches found
No related tags found
No related merge requests found
...@@ -50,8 +50,20 @@ FORMAT=${FORMAT:-formatall} ...@@ -50,8 +50,20 @@ FORMAT=${FORMAT:-formatall}
CLEANUP=${CLEANUP:-stopall} CLEANUP=${CLEANUP:-stopall}
setup_if_needed() { setup_if_needed() {
mount | grep $MOUNT && return local MOUNTED=$(mounted_lustre_filesystems)
if $(echo $MOUNTED | grep -w -q $MOUNT); then
check_config $MOUNT
return
fi
echo "Lustre is not mounted, trying to do setup SETUP=$SETUP ... "
$FORMAT && $SETUP $FORMAT && $SETUP
MOUNTED=$(mounted_lustre_filesystems)
if ! $(echo $MOUNTED | grep -w -q $MOUNT); then
echo "Lustre is not mounted after setup! SETUP=$SETUP"
exit 1
fi
} }
title() { title() {
...@@ -269,7 +281,7 @@ for NAME in $CONFIGS; do ...@@ -269,7 +281,7 @@ for NAME in $CONFIGS; do
mount_client $MOUNT2 mount_client $MOUNT2
#echo "can't mount2 for '$NAME', skipping sanityN.sh" #echo "can't mount2 for '$NAME', skipping sanityN.sh"
START=: CLEAN=: bash sanityN.sh START=: CLEAN=: bash sanityN.sh
umount $MOUNT2 [ "$(mount | grep $MOUNT2)" ] && umount $MOUNT2
$DEBUG_ON $DEBUG_ON
$CLEANUP $CLEANUP
......
...@@ -1029,15 +1029,28 @@ init_facets_vars () { ...@@ -1029,15 +1029,28 @@ init_facets_vars () {
done done
} }
check_config () {
local mntpt=$1
echo Checking config lustre mounted on $mntpt
local mgshost=$(mount | grep " $mntpt " | awk -F@ '{print $1}')
if [ "$mgshost" != "$mgs_HOST" ]; then
FAIL_ON_ERROR=true \
error "Bad config file: lustre is mounted with mgs $mgshost, but mgs_HOST=$mgs_HOST
Please use correct config or set mds_HOST correctly!"
fi
}
check_and_setup_lustre() { check_and_setup_lustre() {
MOUNTED="`mounted_lustre_filesystems`" local MOUNTED=$(mounted_lustre_filesystems)
if [ -z "$MOUNTED" ]; then if [ -z "$MOUNTED" ] || ! $(echo $MOUNTED | grep -w -q $MOUNT); then
[ "$REFORMAT" ] && formatall [ "$REFORMAT" ] && formatall
setupall setupall
MOUNTED="`mounted_lustre_filesystems`" MOUNTED=$(mounted_lustre_filesystems | head -1)
[ -z "$MOUNTED" ] && error "NAME=$NAME not mounted" [ -z "$MOUNTED" ] && error "NAME=$NAME not mounted"
export I_MOUNTED=yes export I_MOUNTED=yes
else else
check_config $MOUNT
init_facets_vars init_facets_vars
fi fi
if [ "$ONLY" == "setup" ]; then if [ "$ONLY" == "setup" ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment