162306a36Sopenharmony_ci===================================
262306a36Sopenharmony_cipNFS block layout server user guide
362306a36Sopenharmony_ci===================================
462306a36Sopenharmony_ci
562306a36Sopenharmony_ciThe Linux NFS server now supports the pNFS block layout extension.  In this
662306a36Sopenharmony_cicase the NFS server acts as Metadata Server (MDS) for pNFS, which in addition
762306a36Sopenharmony_cito handling all the metadata access to the NFS export also hands out layouts
862306a36Sopenharmony_cito the clients to directly access the underlying block devices that are
962306a36Sopenharmony_cishared with the client.
1062306a36Sopenharmony_ci
1162306a36Sopenharmony_ciTo use pNFS block layouts with the Linux NFS server the exported file
1262306a36Sopenharmony_cisystem needs to support the pNFS block layouts (currently just XFS), and the
1362306a36Sopenharmony_cifile system must sit on shared storage (typically iSCSI) that is accessible
1462306a36Sopenharmony_cito the clients in addition to the MDS.  As of now the file system needs to
1562306a36Sopenharmony_cisit directly on the exported volume, striping or concatenation of
1662306a36Sopenharmony_civolumes on the MDS and clients is not supported yet.
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ciOn the server, pNFS block volume support is automatically if the file system
1962306a36Sopenharmony_cisupport it.  On the client make sure the kernel has the CONFIG_PNFS_BLOCK
2062306a36Sopenharmony_cioption enabled, the blkmapd daemon from nfs-utils is running, and the
2162306a36Sopenharmony_cifile system is mounted using the NFSv4.1 protocol version (mount -o vers=4.1).
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ciIf the nfsd server needs to fence a non-responding client it calls
2462306a36Sopenharmony_ci/sbin/nfsd-recall-failed with the first argument set to the IP address of
2562306a36Sopenharmony_cithe client, and the second argument set to the device node without the /dev
2662306a36Sopenharmony_ciprefix for the file system to be fenced. Below is an example file that shows
2762306a36Sopenharmony_cihow to translate the device into a serial number from SCSI EVPD 0x80::
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ci	cat > /sbin/nfsd-recall-failed << EOF
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci.. code-block:: sh
3262306a36Sopenharmony_ci
3362306a36Sopenharmony_ci	#!/bin/sh
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_ci	CLIENT="$1"
3662306a36Sopenharmony_ci	DEV="/dev/$2"
3762306a36Sopenharmony_ci	EVPD=`sg_inq --page=0x80 ${DEV} | \
3862306a36Sopenharmony_ci		grep "Unit serial number:" | \
3962306a36Sopenharmony_ci		awk -F ': ' '{print $2}'`
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_ci	echo "fencing client ${CLIENT} serial ${EVPD}" >> /var/log/pnfsd-fence.log
4262306a36Sopenharmony_ci	EOF
43