Add GPFS5 bind mounts to NHC configuration
We are bind mounting several GPFS5 directories for backward compatibility (see /usr/local/bin/mount-gpfs-bind-mounts.sh
script below, which is called by /etc/systemd/system/rc-gpfs-bind-mnt-dirs.service
)
- /home -> /gpfs/user/home
- /data/user -> /gpfs/user
- /data/project -> /gpfs/project
- /scratch -> /gpfs/scratch
- /share/apps -> /gpfs/project/clusterops/rc-apps/intel-el7
We discovered several nodes that had just recently been added to the GPFS5 pool that had booted without the bind mounts. SSH'ing to the nodes and running systemctl restart rc-gpfs-bind-mnt-dirs.service
successfully created the bind mounts.
As such, we need for NHC to monitor for these mounts. Proposal is to add the following checks:
# GPFS5 clients - GPFS5 and bind mounts
## /gpfs
{c0[194-223],c0[252-253],c0255} || check_fs_mount_rw -t gpfs -f /gpfs
{c0[194-223],c0[252-253],c0255} || check_file_test -r -e -f /gpfs/.nhc-test
## /scratch
{c0[194-223],c0[252-253],c0255} || check_fs_mount_rw -t gpfs -f /scratch
{c0[194-223],c0[252-253],c0255} || check_file_test -r -e -f /scratch/.nhc-test
## /home
{c0[194-223],c0[252-253],c0255} || check_fs_mount_rw -t gpfs -f /home
## /data/user
{c0[194-223],c0[252-253],c0255} || check_fs_mount_rw -t gpfs -f /data/user
## /data/project
{c0[194-223],c0[252-253],c0255} || check_fs_mount_rw -t gpfs -f /data/project
## /share/apps
{c0[194-223],c0[252-253],c0255} || check_fs_mount_rw -t gpfs -f /share/apps
#!/bin/bash
# Mount the bind mounts for GPFS targets after boot.
while [ ! -e /gpfs/.is-mounted ]; do
sleep 5
done
declare -A mount_points
mount_points=(
["/home"]="/gpfs/user/home"
["/data/user"]="/gpfs/user"
["/data/project"]="/gpfs/project"
["/scratch"]="/gpfs/scratch"
["/share/apps"]="/gpfs/project/clusterops/rc-apps/intel-el7"
)
# Example of accessing the array
for mnt in "${!mount_points[@]}"; do
logger -t $0 "Bind mounting $mnt -> ${mount_points[$mnt]}"
mount --bind ${mount_points[$mnt]} $mnt
done