From: Gaurang Tapase Date: Tue, 10 Aug 2021 13:02:02 +0000 (+0530) Subject: EX-3430: Improvement in HP config for client mount X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=bc35510a409b8eb784b56893a9c4100e0e091fcb;p=fs%2Flustre-release.git EX-3430: Improvement in HP config for client mount Use custom lustre-client resource agent for client mount/unmount which in turn uses the pumount utility to unmount. This makes sure the client is unmounted gracefully while stopping the resource. Remove stratagem-hp-convert.sh as it is no longer used. Test-Parameters: trivial Change-Id: Idc5fc2a59e4783a4011fc65a0ae3d69281b1a20f Signed-off-by: Gaurang Tapase Reviewed-on: https://review.whamcloud.com/44547 Reviewed-by: Nathaniel Clark Tested-by: jenkins Tested-by: Maloo Reviewed-by: John L. Hammond --- diff --git a/lipe/scripts/stratagem-hp-config.sh b/lipe/scripts/stratagem-hp-config.sh index 7940f73..c34d1a9 100755 --- a/lipe/scripts/stratagem-hp-config.sh +++ b/lipe/scripts/stratagem-hp-config.sh @@ -190,18 +190,9 @@ if ! crm_resource -QW -r cl-$FS-client > /dev/null 2>&1; then echo "Creating config directories" clush -Sa mkdir -p /etc/lpurge/$FS/ /etc/lamigo/ $ROOT/$FS/client - echo "Creating lustre client mounts for $FS" - clush -Sa "grep -q $FS/client /etc/fstab || (echo $MOUNTSPEC $ROOT/$FS/client lustre x-systemd.mount-timeout=20m,noauto,_netdev >> /etc/fstab)" - clush -Sa mkdir -p /etc/systemd/system/lustre-$FS-client.mount.d/ - cat << EOF > /etc/systemd/system/lustre-$FS-client.mount.d/timeout.conf -[Mount] -TimeoutSec=20m -EOF - clush -Sca /etc/systemd/system/lustre-$FS-client.mount.d/timeout.conf - clush -Sa systemctl daemon-reload echo "Creating lustre client resource agent" clush -Sg ha_heads crm configure < /dev/null || true" -} - -if [ -z "$FS" ]; then - # Try automatic detection - FS=$(crm_ticket -l|cut -f 1 -d -|grep -v ^lustre$|uniq) - - if [ $(echo "$FS" |wc -w) -ne 1 ]; then - echo "Error: Unable to determine filesystem automatically, please specify" - usage - exit 1 - fi -fi - -if crm_resource -QW -r $FS-hotpool > /dev/null 2>&1; then - echo "Hotpools for $FS already using ticket" - exit 0 -fi - -MDSHOST=$(locate_resource mdt0000-$FS) -MDTLIST=$(clush -qN -g ha_heads crm_resource --list-raw|sed -ne "s/mdt\(.*\)-$FS$/\1/p") -FAST_POOL=$(awk -F = '/^src=/{ print $2 }' /etc/lamigo/$FS-MDT0000.conf) -FAST_OSTLIST=$(ssh $MDSHOST lctl pool_list $FS.$FAST_POOL|sed -ne 's/.*-OST\(....\)_UUID/\1/p') - -ROLE=Started -if crm_resource -r $FS-client -W |& grep -q NOT; then - ROLE=Stopped -fi - -echo "Creating hotpool ticket for $FS" -clush -qSg ha_heads crm configure </dev/null 2>&1 && crm configure << EOF || true -delete lpurge-$FS-$OST-after-client -rsc_ticket ticket-$FS-hotpool-allocated-lpurge-$FS-OST$OST $FS-hotpool-allocated: lpurge-$FS-OST$OST loss-policy=stop -EOF" -done - -# MDTLIST is derived from resources so it's already in decimal but formatted %04d -for INDEX in $MDTLIST; do - MDT=$(printf "%04x" $((10#$INDEX)) ) - - echo "Updating lamigo HA for $FS-MDT$MDT" - - clush -qS --group=ha_heads "crm_resource -QW -r mdt$INDEX-$FS >/dev/null 2>&1 && crm configure << EOF || true -delete lamigo-$FS-$MDT-after-client -rsc_ticket ticket-$FS-hotpool-allocated-lamigo-$FS-MDT$MDT $FS-hotpool-allocated: lamigo-$FS-MDT$MDT loss-policy=stop -EOF" -done diff --git a/lipe/scripts/stratagem-hp-teardown-client.sh b/lipe/scripts/stratagem-hp-teardown-client.sh index b579878..7c658c9 100755 --- a/lipe/scripts/stratagem-hp-teardown-client.sh +++ b/lipe/scripts/stratagem-hp-teardown-client.sh @@ -85,6 +85,3 @@ clush -qS --group=ha_heads crm res stop cl-$FS-client waitfor cl-$FS-client clush -qS --group=ha_heads crm config del $FS-client - -echo "Removing client mount from fstab" -clush -a "sed -i '/\/$FS\/client.*lustre/d' /etc/fstab"