To add optional support for mounting \beegfs{} file systems, an
additional external \pkgmgr{} repository provided by the \beegfs{} project must be
configured.  In this recipe, it is
assumed that the file system is hosted by servers that are pre-existing
and are not part of the install process. The \texttt{\$\{sysmgmtd\_host\}} should
point the server running the \beegfs{} Management Service. Starting the client service triggers
a build of a kernel module, hence the kernel module development packages must be
installed first. As with \Lustre{}, a default \baseOS{} environment may not allow
loading of the necessary \beegfs{} kernel modules. Consequently, the example below
includes steps which update the /etc/modprobe.d/10-unsupported-modules.conf file
to allow loading of the necessary modules.

% begin_ohpc_run
% ohpc_validation_newline
% ohpc_command if [[ ${enable_beegfs_client} -eq 1 ]];then
% ohpc_indent 5
\begin{lstlisting}[language=bash,literate={-}{-}1,keywords={},upquote=true]
# Add BeeGFS client software to master host
[sms](*\#*) (*\addrepo*) (*\beegfsrepo*)
# install matching kernel-default-devel and beegfs packages
[sms](*\#*) version=`rpm -q --qf "%{VERSION}-%{RELEASE}\n" kernel-default`
[sms](*\#*) (*\install*) kernel-default-devel-${version}
[sms](*\#*) (*\install*) gcc beegfs-client beegfs-helperd beegfs-utils

# Enable OFED support in client
[sms](*\#*) perl -pi -e "s/^buildArgs=-j8/buildArgs=-j8 BEEGFS_OPENTK_IBVERBS=1/"  \
        /etc/beegfs/beegfs-client-autobuild.conf

# Define client's management host
[sms](*\#*) /opt/beegfs/sbin/beegfs-setup-client -m ${sysmgmtd_host}

# Update configuration to allow BeeGFS modules to be loaded on master host
[sms](*\#*) perl -pi -e "s/^allow_unsupported_modules 0/allow_unsupported_modules 1/" \
/etc/modprobe.d/10-unsupported-modules.conf
[sms](*\#*) systemctl start beegfs-helperd
# Build kernel and mount file system
[sms](*\#*) systemctl start beegfs-client
\end{lstlisting}

\begin{lstlisting}[language=bash,literate={-}{-}1,keywords={},upquote=true]
# Add BeeGFS client software to compute node image
[sms](*\#*) (*\chrootaddrepo*) (*\beegfsrepo*)
[sms](*\#*) (*\chrootinstall*) beegfs-client beegfs-helperd beegfs-utils

# Disable auto-build of kernel module in compute node image
[sms](*\#*) perl -pi -e "s/^buildEnabled=true/buildEnabled=false/" $CHROOT/etc/beegfs/beegfs-client-autobuild.conf
[sms](*\#*) rm -f $CHROOT/var/lib/beegfs/client/force-auto-build

# Enable client daemons on compute nodes
[sms](*\#*) perl -pi -e "s/^allow_unsupported_modules 0/allow_unsupported_modules 1/" \
$CHROOT/etc/modprobe.d/10-unsupported-modules.conf
[sms](*\#*) chroot $CHROOT systemctl enable beegfs-helperd beegfs-client

# Copy client config to compute nodes
[sms](*\#*) cp /etc/beegfs/beegfs-client.conf $CHROOT/etc/beegfs/beegfs-client.conf

# Include kernel module in warewulf bootstrap
[sms](*\#*) echo "drivers += beegfs" >> /etc/warewulf/bootstrap.conf
\end{lstlisting}
% ohpc_indent 0
% ohpc_command fi
% \end_ohpc_run
