Whamcloud - gitweb
EX-3430: Improvement in HP config for client mount
authorGaurang Tapase <gtapase@ddn.com>
Tue, 10 Aug 2021 13:02:02 +0000 (18:32 +0530)
committerJohn L. Hammond <jhammond@whamcloud.com>
Sat, 11 Sep 2021 01:03:03 +0000 (01:03 +0000)
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 <gtapase@ddn.com>
Reviewed-on: https://review.whamcloud.com/44547
Reviewed-by: Nathaniel Clark <nclark@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
lipe/scripts/stratagem-hp-config.sh
lipe/scripts/stratagem-hp-convert.sh [deleted file]
lipe/scripts/stratagem-hp-teardown-client.sh

index 7940f73..c34d1a9 100755 (executable)
@@ -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 <<EOF
-primitive $FS-client systemd:lustre-$FS-client.mount meta target-role=Stopped op start timeout=900s op monitor interval=60s op stop timeout=900s
+primitive $FS-client ocf:ddn:lustre-client meta target-role=Stopped params filesystem=$FS op start timeout=900s op monitor interval=60s op stop timeout=900s
 clone cl-$FS-client $FS-client
 rsc_ticket ticket-$FS-allocated-client $FS-allocated: cl-$FS-client loss-policy=stop
 EOF
diff --git a/lipe/scripts/stratagem-hp-convert.sh b/lipe/scripts/stratagem-hp-convert.sh
deleted file mode 100755 (executable)
index a944e27..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/bin/bash
-# -*- indent-tabs-mode: nil -*-
-# Copyright DDN 2021
-
-FS=$1
-
-function usage() {
-    echo "Usage: $(basename $0) [-h] [FILESYSTEM]"
-    echo "  Convert Stratagem Hotpools HA environment to be ticket based"
-}
-
-if [ "$FS" = "-h" ] || [ "$FS" = "--help" ]; then
-    usage
-    exit 0
-fi
-
-function locate_resource() {
-    local res=$1
-    clush -N --group=ha_heads "crm_resource -QW -r $res 2> /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 <<EOF
-primitive $FS-hotpool ocf:ddn:Ticketer params name=$FS-hotpool-allocated meta allow-migrate=true priority=199 target-role=$ROLE op start interval=0 timeout=30 op monitor interval=30 timeout=30 op stop interval=0 timeout=30
-order $FS-hotpool-after-cl-$FS-client 0: cl-$FS-client $FS-hotpool
-EOF
-
-for OST in $FAST_OSTLIST; do
-    INDEX=$(printf "%04d" 0x$OST)
-    echo Updating lpurge config for $FS-OST$OST
-
-    echo "Updating lpurge HA for $FS-OST$OST"
-
-    clush -qS --group=ha_heads "crm_resource -QW -r ost$INDEX-$FS >/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
index b579878..7c658c9 100755 (executable)
@@ -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"