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
# 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
# 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)
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
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