SMB Transparent Failover on Windows Server 2012

Published on October 29, 2012

SMB Transparent Failover on Windows Server 2012

    In a previous post, I described SMB Multichannel technology , which is part of the SMB 3.0 protocol. Continuing our discussion of the capabilities of SMB 3.0, today we will focus on SMB Transparent Failover. The essence of this technology, as the name implies, is to transparently switch 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 OSs.

    Using file storage instead of block storage


    Changes in the SMB and file services of Windows Server 2012 have led to the fact that you can now place server applications data, for example, SQL Server databases or Hyper-V virtual hard disks in shared folders on the file server (in file balls). Such server applications assume that their data is stored in reliable, highly accessible storage. Accordingly, by building a fault-tolerant file cluster, or in other words, deploying the File Server role on a cluster created using failover clustering, we get a kind of universal high-availability resource that we can use for various server applications that use file access.

    The ability to use file storage instead of block storage offers several advantages:
    • Simpler controls . Instead of creating LUNs and zones, you need to manage ordinary shared folders on the file server.
    • Flexibility . In the application settings for accessing data, a UNC path is specified. You can dynamically move applications within the data center without changing the configuration of network access and storage.
    • Use of existing investments in network infrastructure . Deployment of new storage networks is not required; existing configurations are used.
    • Saving . File access allows you to use cheaper configurations when it is justified in terms of price / performance ratio. For example, using Storage Spaces technology, you can build cluster storage based on SAS disks.

    What is the use of SMB Transparent Failover?


    On a Windows Server 2012 file cluster, you can create public folders with a sign of continuous availability. I note that by default the balls on the cluster are created of this type. And when connecting to just such balls, SMB Transparent Failover is applied, and the technology can be applied in two scenarios:
    • planned switching to another cluster node , for example, to perform any maintenance work on hardware or software;
    • Fulfillment of unplanned failure in case of node failure.

    In both scenarios, switching to another cluster node occurs without losing the application access to the files stored in the shared folder on the cluster.
    Moreover, if in combination with SMB Transparent Failover you use another SMB 3.0 technology, 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, will provide load balancing between all nodes a cluster.

    What are the requirements for SMB Transparent Failover to work?


    To use SMB Transparent Failover, the following requirements must be met:
    • A failover file cluster running Windows Server 2012 with at least two nodes.
    • One or more shared folders created on the cluster with continuous availability.
    • Client running Windows Server 2012 or Windows 8.

    Next, we will 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 with cluster balls, then the problem was quickly solved by opening the file again. But, obviously, for server applications such as SQL Server, this solution to the problem 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 invisible to the application.

    In SMB 3.0, new components have appeared in the implementation of the SMB client and SMB server: Witness Client, Witness Service and Resume Key Filter.

    image

    When the SMB client connects to the shared folder, it determines whether the continuous availability flag is set for this folder. If so, the folder is located on the cluster and you can use transparent failover for 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 client with the necessary information. From this point on, the resume key actually stores information about the state of the file, and operations on the file are applied in write-through mode to avoid the cache affecting changes to the file.

    In the case of planned and unplanned switching to another node in the cluster, the SMB client provides its resume key to the SMB server of the new node. Thanks to the information received, the SMB server through the Resume Key Filter provides a consistent state of the file at the time before the failure. The application on the SMB client does not participate in this process in any way, does not receive any error messages and experiences only a slight delay in the input-output operations. This ensures the transparency of failover.

    The Witness client and Witness service help accelerate the switch to another cluster node in the event of an unplanned failure. Upon initial connection to the cluster node, the Witness client running on the same computer as the SMB client receives a list of cluster nodes from the Witness service running on the node to which it was connected. The Witness client then selects another alternative cluster node and sends a 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 a message to the Witness client, and that message to the SMB client. Immediately after receiving the notification, the SMB client starts reconnecting to the alternative cluster node.

    Configure SMB Transparent Failover


    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 now necessary to raise the role of a fault-tolerant file server on it. Launch the wizard ...

    image

    and select the appropriate role.

    image

    This is where changes begin from previous versions of Windows Server. As you can see, in addition to, let's say, a standard file server, it became possible to deploy Scale-Out File Server. In the latter case, we will get the file cluster I mentioned in Active / Active mode. A more detailed discussion of him will be in one of the future posts. In this version, we will leave the default option - File Server for general use.

    image

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

    image

    We select the drive for our server,

    image

    check the settings again,

    image

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

    image

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

    image

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

    image

    We check that the correct server and volume are selected,

    image

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

    image

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

    image

    If necessary, configure permissions.

    image

    If everything suits us, then boldly click the Create button.

    image

    From the point of view of settings, that's all. If you connect to the created VMs shared folder and run the command:

    Get-SmbOpenFile | Select *

    then on the cluster node that processes this connection, you will see something like a response.

    image

    Note that the ContinuouslyAvailable parameter is set to True.

    In order to make 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 switched.
    Which way is better to check the development of an unplanned failure - you decide. :)

    So, the SMB Transparent Failover technology provides transparent for the application switching to another node of the failover cluster in case of planned operations or unplanned failure. In combination with SMB Multichannel we get fault tolerance at the level of storage, communication channel, network adapter. The use of SMB Scale-Out will allow balancing the load between the cluster nodes and more efficiently use the power 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.