18c2ecf20Sopenharmony_ci===================================
28c2ecf20Sopenharmony_cipNFS block layout server user guide
38c2ecf20Sopenharmony_ci===================================
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ciThe Linux NFS server now supports the pNFS block layout extension.  In this
68c2ecf20Sopenharmony_cicase the NFS server acts as Metadata Server (MDS) for pNFS, which in addition
78c2ecf20Sopenharmony_cito handling all the metadata access to the NFS export also hands out layouts
88c2ecf20Sopenharmony_cito the clients to directly access the underlying block devices that are
98c2ecf20Sopenharmony_cishared with the client.
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ciTo use pNFS block layouts with the Linux NFS server the exported file
128c2ecf20Sopenharmony_cisystem needs to support the pNFS block layouts (currently just XFS), and the
138c2ecf20Sopenharmony_cifile system must sit on shared storage (typically iSCSI) that is accessible
148c2ecf20Sopenharmony_cito the clients in addition to the MDS.  As of now the file system needs to
158c2ecf20Sopenharmony_cisit directly on the exported volume, striping or concatenation of
168c2ecf20Sopenharmony_civolumes on the MDS and clients is not supported yet.
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ciOn the server, pNFS block volume support is automatically if the file system
198c2ecf20Sopenharmony_cisupport it.  On the client make sure the kernel has the CONFIG_PNFS_BLOCK
208c2ecf20Sopenharmony_cioption enabled, the blkmapd daemon from nfs-utils is running, and the
218c2ecf20Sopenharmony_cifile system is mounted using the NFSv4.1 protocol version (mount -o vers=4.1).
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ciIf the nfsd server needs to fence a non-responding client it calls
248c2ecf20Sopenharmony_ci/sbin/nfsd-recall-failed with the first argument set to the IP address of
258c2ecf20Sopenharmony_cithe client, and the second argument set to the device node without the /dev
268c2ecf20Sopenharmony_ciprefix for the file system to be fenced. Below is an example file that shows
278c2ecf20Sopenharmony_cihow to translate the device into a serial number from SCSI EVPD 0x80::
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci	cat > /sbin/nfsd-recall-failed << EOF
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci.. code-block:: sh
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci	#!/bin/sh
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci	CLIENT="$1"
368c2ecf20Sopenharmony_ci	DEV="/dev/$2"
378c2ecf20Sopenharmony_ci	EVPD=`sg_inq --page=0x80 ${DEV} | \
388c2ecf20Sopenharmony_ci		grep "Unit serial number:" | \
398c2ecf20Sopenharmony_ci		awk -F ': ' '{print $2}'`
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci	echo "fencing client ${CLIENT} serial ${EVPD}" >> /var/log/pnfsd-fence.log
428c2ecf20Sopenharmony_ci	EOF
43