In one of the previous posts I described the
SMB Multichannel technology, which is part of the SMB 3.0 protocol. Continuing to discuss the possibilities of SMB 3.0, today we will focus on SMB Transparent Failover. The essence of this technology, as the name implies, is to provide transparent switching of SMB applications to another node of the failover cluster in the event of a hardware or software failure of the current node. Since SMB 3.0 is implemented in
Windows Server 2012 and
Windows 8 , all of the following applies only to these operating systems.
Using file storage instead of block
Changes in SMB and file services in Windows Server 2012 have led to the fact that now you can put server application data, such as SQL Server databases or Hyper-V virtual hard drives, in shared folders on the file server (in file balls). Such server applications assume that their data is stored in reliable, highly available storage. Accordingly, by building a failover file cluster, or in other words, by deploying the File Server role on a cluster created using the failover clustering service, we get a kind of universal, highly available resource that we can use for various server applications using file access.
The ability to use file storage instead of block storage provides several advantages:
- More simple management . Instead of creating LUNs and zones, you need to manage the usual shared folders on the file server.
- Flexibility In the application settings for data access, the UNC path is specified. You can dynamically move applications within the data center without changing the configuration of network access and storage.
- Use existing network infrastructure investments . No need to deploy new storage networks, using existing configurations.
- Savings . File access allows the use of cheaper configurations when it is justified in terms of price / performance. For example, using the Storage Spaces technology, you can build cluster storage based on SAS disks.
What does the use of SMB Transparent Failover?
On a Windows Server 2012 file cluster, you can create shared folders with continuous availability. I note that by default balls on a cluster are created just of this type. And when connecting to such balls, SMB Transparent Failover is used, and the technology can be used in two scenarios:
- scheduled switching to another cluster node , for example, to perform any maintenance work on hardware or software;
- practicing unplanned failure in case of node failure.
In both scenarios, switching to another cluster node occurs
without the application losing access to the files stored in the shared folder on the cluster.
Moreover, if another SMB 3.0 technology is used in combination with SMB Transparent Failover, namely SMB Scale-Out (this is possible, but not necessary), the file cluster will work in active / active mode, and in addition to fault tolerance it will provide load balancing between all nodes cluster
')
What are the requirements for SMB Transparent Failover?
To use SMB Transparent Failover, the following requirements must be met:
- Failsafe file cluster running Windows Server 2012 with at least two nodes.
- One or more shared folders created on a cluster with continuous availability.
- Client running Windows Server 2012 or Windows 8.
Next, we look at how transparent failover is technically implemented, and how this technology is configured.
How does SMB Transparent Failover work?
The main problem in failover in a file cluster, say in Windows Server 2008 R2, was that when switching to another node, the application lost access to the files and folders used. If we are talking about a document or presentation opened from a cluster of balls, then the problem was quickly solved by opening the file again. But, obviously, for server applications such as SQL Server, this solution is hardly acceptable. Either the application must provide for handling such situations in its code, or administrator intervention is required to reconnect the application. The fact is that failover did not remain unnoticeable for the application.
In SMB 3.0, new components have appeared in the implementation of the SMB client and the SMB server: Witness Client, Witness Service and Resume Key Filter.

When the SMB client connects to the shared folder, it determines whether the continuous availability attribute is set for this folder. If yes, then the folder is located on a cluster and transparent failover can be applied to it. The SMB client opens the file on behalf of the application, provides a unique key (resume key) and requests information about the file descriptor (persistent file handle) from the SMB server. Using the Resume Key Filter, the SMB server receives and provides the necessary information to the client. From this point on, the resume key actually stores information about the state of the file, and operations to the file are applied in write-through mode to avoid the effect of the cache on changes to the file.
In the case of planned and unplanned switching to another cluster node, the SMB client provides the SMB server with a new node with its resume key. Thanks to the information received, the SMB server through the Resume Key Filter ensures that the file is in a consistent state at the time before the failure. The application on the SMB client does not participate in this process, does not receive any error messages, and experiences only a slight delay in I / O operations. This ensures the transparency of failover.
The Witness client and the Witness service help speed up switching to another cluster node in case of an unplanned failure. When initially connecting to a cluster node, the Witness client running on the same computer as the SMB client retrieves the list of cluster nodes from the Witness service running on the host to which the connection was made. The Witness client then selects another alternative cluster node and sends the request to the Witness service on that node. As soon as a failure occurs, the failover clustering service notifies the Witness service of the alternate node, which in turn sends the message to the Witness client, and that SMB client. Immediately after receiving the alert, the SMB client starts reconnecting to the alternate cluster node. This approach eliminates the need to wait for TCP timeout and significantly speeds up the restoration of file connections after a crash.
SMB Transparent Failover Setup
First of all, you need to create a Failover Cluster and deploy the File Server role on each of its nodes. I will not dwell on these steps in detail; they have not undergone any fundamental changes in Windows Server 2012.
Assuming that the cluster has been created, it is necessary now to raise the role of the fault-tolerant file server on it. We start the master ...

and choose the appropriate role.

This is where the changes from previous versions of Windows Server begin. As you can see, in addition to, say, the standard file server, an opportunity has appeared to deploy the Scale-Out File Server. In the latter case, we will get the file cluster mentioned by me in Active / Active mode. We will talk about it in more detail in one of the future posts. In this variant, we leave the default option - File Server for general use.

Set the name of the access point for subsequent access to the file server and specify the IP address.

We select a disk for our server,

check the settings again,

and make sure that the role of the file cluster is successfully created.

The next step is to create one or more shared folders on the cluster with the sign of continuous availability. For this we need the item Add File Share.

And here in this window is the middle point of SMB Share - Applications.

Verify that the correct server and volume are selected

set the name of the balls and the path to it (local or network),

and at the next step we make sure once again that the necessary sign of continuous availability for the balls is installed.

If necessary, set permissions.

If everything suits us, feel free to click the Create button.

In terms of settings, that's all. If you connect to the newly created VMs shared folder and run the command:
Get-SmbOpenFile | Select *
then on the cluster node that handles this connection, as a response, you will see something like

Note that the parameter ContinuouslyAvailable is True.
In order to perform a scheduled switch to another cluster node, you must use the following command:
Move-ClusterGroup –Name ft-fs-01 –Node ws2012-srv04
where the
Name parameter indicates the name of the cluster resource (that is, the cluster file server),
Node is the name of the cluster node to which the cluster resource is being switched.
What is the best way to check the performance of an unplanned failure - you decide. :)
So, the SMB Transparent Failover technology provides application-transparent switching to another node of the failover cluster in the event of planned work or an unplanned failure. In combination with SMB Multichannel, we obtain fault tolerance at the storage level, communication channel, network adapter. The use of SMB Scale-Out will allow to balance the load between the cluster nodes and more efficiently use the capacity of the servers included in the cluster. By correctly combining the capabilities of SMB 3.0, you can thus achieve the required level of reliability and performance of the server infrastructure.