Whamcloud - gitweb
EX-3462 hotpools: Use -S for clush more
authorNathaniel Clark <nclark@whamcloud.com>
Thu, 15 Jul 2021 15:38:02 +0000 (11:38 -0400)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 29 Jul 2021 16:41:19 +0000 (16:41 +0000)
Use -S in clush where appropriate.  Some instances are okay to fail.

Signed-off-by: Nathaniel Clark <nclark@whamcloud.com>
Change-Id: I87b37ae8a0bcefce5d724d9fe71f830175dffce5
Reviewed-on: https://review.whamcloud.com/44318
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Gaurang Tapase <gtapase@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lipe/scripts/stratagem-hp-config.sh
lipe/scripts/stratagem-hp-convert.sh

index 67db1d4..7940f73 100755 (executable)
@@ -188,26 +188,26 @@ MOUNTSPEC=$(/opt/ddn/es/tools/mount_lustre_client --dry-run --fs $FS |awk '{ pri
 if ! crm_resource -QW -r cl-$FS-client > /dev/null 2>&1; then
 
     echo "Creating config directories"
-    clush -a mkdir -p /etc/lpurge/$FS/ /etc/lamigo/ $ROOT/$FS/client
+    clush -Sa mkdir -p /etc/lpurge/$FS/ /etc/lamigo/ $ROOT/$FS/client
 
     echo "Creating lustre client mounts for $FS"
-    clush -a "grep -q $FS/client /etc/fstab || (echo $MOUNTSPEC $ROOT/$FS/client lustre x-systemd.mount-timeout=20m,noauto,_netdev >> /etc/fstab)"
-    clush -a mkdir -p /etc/systemd/system/lustre-$FS-client.mount.d/
+    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 -ca /etc/systemd/system/lustre-$FS-client.mount.d/timeout.conf
-    clush -a systemctl daemon-reload
+    clush -Sca /etc/systemd/system/lustre-$FS-client.mount.d/timeout.conf
+    clush -Sa systemctl daemon-reload
     echo "Creating lustre client resource agent"
-    clush -g ha_heads crm configure <<EOF
+    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
 clone cl-$FS-client $FS-client
 rsc_ticket ticket-$FS-allocated-client $FS-allocated: cl-$FS-client loss-policy=stop
 EOF
 
     # create order constraint for client on all lustre-server template types (mdt or ost)
-    clush -g ha_heads "cibadmin -e --query --xpath '//template[@type=\"lustre-server\"]'|awk -F \"'\" '/lustre-$FS-/{ print \$2 }'|awk -F - '{ print \"order $FS-client-after-\"\$3\" 0: lustre-$FS-\"\$3\":start cl-$FS-client:start\" }'|crm configure"
+    clush -Sg ha_heads "cibadmin -e --query --xpath '//template[@type=\"lustre-server\"]'|awk -F \"'\" '/lustre-$FS-/{ print \$2 }'|awk -F - '{ print \"order $FS-client-after-\"\$3\" 0: lustre-$FS-\"\$3\":start cl-$FS-client:start\" }'|crm configure"
 
     ssh $MDSHOST crm configure <<EOF
 order $FS-client-after-mgs 0: mgs:start cl-$FS-client:start
@@ -217,7 +217,7 @@ fi # ! crm_resource client
 
 # ticket
 echo "Creating Hotpool ticket for $FS"
-clush -g ha_heads crm configure <<EOF
+clush -Sg ha_heads crm configure <<EOF
 primitive $FS-hotpool ocf:ddn:Ticketer params name=$FS-hotpool-allocated meta allow-migrate=true priority=199 target-role=Stopped 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
@@ -231,7 +231,7 @@ echo "Setting up lpurge (HI:$LPURGE_FREEHI to LO:$LPURGE_FREELO)"
 # this results in MDTLIST being a list of MDT indexes in format "%04d"
 # This format is problematic for values greater than 0007, since by
 # default bash will interpret it as octal
-MDTLIST=$(clush -qN -g ha_heads crm_resource --list-raw|sed -ne "s/mdt\(.*\)-$FS$/\1/p")
+MDTLIST=$(clush -qSN -g ha_heads crm_resource --list-raw|sed -ne "s/mdt\(.*\)-$FS$/\1/p")
 
 for OST in $FAST_OSTLIST; do
     INDEX=$(printf "%04d" 0x$OST)
@@ -254,7 +254,7 @@ EOF
         MDSHOST=$(locate_resource mdt$MDT-$FS)
         echo "mds=$((10#$MDT)):$MDSHOST:$ROOT/$FS/client" >> /etc/lpurge/$FS/OST$OST.conf
     done
-    clush -ca /etc/lpurge/$FS/OST$OST.conf
+    clush -Sca /etc/lpurge/$FS/OST$OST.conf
 
     echo Creating lpurge resource for $FS-OST$OST
     clush -qS --group=ha_heads "crm_resource -QW -r ost$INDEX-$FS >/dev/null 2>&1 && crm configure << EOF || true
@@ -304,13 +304,13 @@ EOF
         echo agent=$HOST:$ROOT/$FS/client:4 >> /etc/lamigo/$FS-MDT$MDT.conf
     done
 
-    clush -a mkdir -p /etc/systemd/system/lamigo@$FS-MDT$MDT.service.d/
+    clush -Sa mkdir -p /etc/systemd/system/lamigo@$FS-MDT$MDT.service.d/
     cat <<EOF > /etc/systemd/system/lamigo@$FS-MDT$MDT.service.d/override.conf
 [Unit]
 After=lustre-$FS-client.mount
 EOF
 
-    clush -ca /etc/lamigo/$FS-MDT$MDT.conf /etc/systemd/system/lamigo@$FS-MDT$MDT.service.d/override.conf
+    clush -Sca /etc/lamigo/$FS-MDT$MDT.conf /etc/systemd/system/lamigo@$FS-MDT$MDT.service.d/override.conf
 
     echo Creating lamigo resource for $FS-MDT$MDT
     clush -qS --group=ha_heads "crm_resource -QW -r mdt$INDEX-$FS >/dev/null 2>&1 && crm configure << EOF || true
index 2e342a9..a944e27 100755 (executable)
@@ -46,7 +46,7 @@ if crm_resource -r $FS-client -W |& grep -q NOT; then
 fi
 
 echo "Creating hotpool ticket for $FS"
-clush -g ha_heads crm configure <<EOF
+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