imageI know what you’re thinking, a post on Server Message Block (SMB), really?  Yes really, SMB and storage services in Windows Server 2012 has become a first class citizen.  More importantly it is the glue a lot of the roles and features rely on to bring new functionality to Windows Server 2012.  If you’re not familiar with SMB, the SMB protocol is a network file sharing protocol that allows applications on a computer to read and write to files and to request services from server programs in a computer network. Really the SMB protocol allows applications or the user of an applications to access files and other remote server side resources.   This allows the basic operations like working with files, reading, writing, accessing…etc.   It can also communicate with any server program that is set up to receive an SMB client request.  Windows Server 2012 introduces the next version of the SMB protocol, SMB 3.0.  There is a great KB article that covers even more about SMB 3.0 as well located here:

KB 2709568 New SMB 3.0 features in the Windows Server 2012 file server

SMB 3.0 Workloads

You may be thinking, so what SMB got improved no big deal.  In reality this is a huge deal for Windows Server 2012 and opens many new scenarios for the Windows Server 2012 files services.  All of the new services in Windows Server 2012 can take advantage of the SMB 3.0 protocol.  There are also a ton of great storage enhancements like Storage Spaces, that SMB 3.0 can leverage that allow you to utilize your commodity hardware for file based storage.  There are quite a few new workloads that are improved in Windows Server 2012.   Aside from traditional storage for end user data which can be configured with a cluster service to provide continuous availability  Additionally the file storage enhancements include reducing the application latencies experienced by branch office users when accessing data over wide area networks (WAN) and protecting data from eavesdropping attacks with support for built-in encryption.  SMB provides the ability for these two workloads:

  • Microsoft SQL Server over SMB
  • Hyper-V over SMB

Imagine the ability to leverage SMB file shares so your SQL Server can store user database files.  This is possible and since an SMB share can reside on a Cluster Shared Volume (CSV), you can even gain high/continuous availability for your SQL environment with SMB file shares. Currently, this is supported with SQL Server 2008 R2 for stand-alone SQL servers. Upcoming versions of SQL Server will add support for clustered SQL servers and system databases.   Now imagine combining this with Storage Spaces, now you can get a highly available environment at the fraction of the cost and maintenance of previous Windows Server environments.  

Hyper-V over SMB

Now let’s take this to next level with Hyper-V.  In Windows Server 2012 you can now store virtual machine files, such as configuration, Virtual hard disk (VHD) files, and snapshots, in file shares over the SMB 3.0 protocol. This can be used for both stand-alone file servers and clustered file servers that use Hyper-V together with shared file storage for the cluster.  By leveraging two new features of SMB 3.0 (SMB Direct and SMB Multichannel) on a file server hosting the VHDX drives for your Hyper-V cluster, you can see storage performance on your Hyper-V guests that approaches that of a built-in server storage.  Not only that, but those Hyper-V guests enjoy the resiliency of a failover network to help avoid any outages.    Taking this even a step further with your virtual machine stored on an SMB file share. You can then perform a live migration on this virtual machine, running between non-clustered Hyper‑V hosts while the virtual machine’s storage remains on the central SMB share. This lets you use the benefits of virtual machine mobility without investing in clustering infrastructure. Hosting providers and similar environments frequently need this capability.   All provided courtesy of this wonderful protocol and take a look at the graphic for some examples:

 image

Configuring Hyper-V over SMB

Overall the process of creating a virtual machine on an SMB is very straight forward:

  1. Install the Hyper-V role on a Windows Server 2012 machine
  2. Install the File Services role on a Windows Server 2012 machine
  3. Create an SMB file share and set permissions.
  4. Create a virtual machine and virtual machine hard disk on the file share, use a UNC path for the location i.e. \\servername\sharename

Then viola you’re done!  The only tricky part and really it is not that tricky is to set permissions on the share and the NTFS folder.   For this to work properly, you will need to set full permissions on the NTFS folder for the following accounts:

  • Hyper-V Administrator
  • Computer Account(s) of the Hyper-V hosts
  • If Hyper-V is clustered you will also need the Hyper-V Cluster Account (CNO)

You can do this easily enough in PowerShell.  The following sequence will create a folder on the F: drive called VMS.  In step 2 you will create a share and set full access permissions for the administrator account HAdmin in the Dom domain, two Hyper-V hosts (HV1, HV2 and since this is on a cluster, HVC for the cluster host:

  1. Create Folder 
    • MD F:\VMS
  2. Create Share
    •  New-SmbShare -Name VMS -Path F:\VMS -FullAccess Dom\HAdmin, Dom\HV1$, Dom\HV2$, Dom\HVC$

      -Note: the $ after the names designates those as computer names so we can use them in this command.
  3. Apply Share permissions to NTFS Folder permissions: 
    • (Get-SmbShare –Name VMS).PresetPathAcl | Set-Acl

 

SMB 3.0 Features

As you can see SMB provides a variety of performance enhancements and availability improvements come together to make file share storage a great low-cost choice for critical workloads such as Hyper-V and SQL Server.   There are several new enhancements and improvements listed in the table below:

Feature

Overview

SMB Transparent Failover

Enables administrators to perform hardware or software maintenance of nodes in a clustered file server without interrupting server applications storing data on these file shares. Also, if a hardware or software failure occurs on a cluster node, SMB clients transparently reconnect to another cluster node without interrupting server applications that are storing data on these file shares.

SMB Scale Out

Using Cluster Shared Volumes (CSV) version 2, administrators can create file shares that provide simultaneous access to data files, with direct I/O, through all nodes in a file server cluster. This provides better utilization of network bandwidth and load balancing of the file server clients, and optimizes performance for server applications.

SMB Multichannel

Enables aggregation of network bandwidth and network fault tolerance if multiple paths are available between the SMB 3.0 client and the SMB 3.0 server. This enables server applications to take full advantage of all available network bandwidth and be resilient to a network failure.

SMB Direct

Supports the use of network adapters that have RDMA capability and can function at full speed with very low latency, while using very little CPU. For workloads such as Hyper-V or Microsoft SQL Server, this enables a remote file server to resemble local storage.

Performance Counters for server applications

The new SMB performance counters provide detailed, per-share information about throughput, latency, and I/O per second (IOPS), allowing administrators to analyze the performance of SMB 3.0 file shares where their data is stored. These counters are specifically designed for server applications, such as Hyper-V and SQL Server, which store files on remote file shares.

Performance optimizations (Improved)

Both the SMB 3.0 client and SMB 3.0 server have been optimized for small random read/write I/O, which is common in server applications such as SQL Server OLTP. In addition, large Maximum Transmission Unit (MTU) is turned on by default, which significantly enhances performance in large sequential transfers, such as SQL Server data warehouse, database backup or restore, deploying or copying virtual hard disks.

SMB-specific Windows PowerShell cmdlets

With Windows PowerShell cmdlets for SMB, an administrator can manage file shares on the file server, end to end, from the command line.

SMB Encryption

Provides end-to-end encryption of SMB data and protects data from eavesdropping occurrences on untrusted networks. Requires no new deployment costs, and no need for Internet Protocol security (IPsec), specialized hardware, or WAN accelerators. It may be configured on a per share basis, or for the entire file server, and may be enabled for a variety of scenarios where data traverses untrusted networks.

SMB Directory Leasing

Improves application response times in branch offices. With the use of directory leases, roundtrips from client to server are reduced since metadata is retrieved from a longer living directory cache. Cache coherency is maintained because clients are notified when directory information on the server changes. Works with scenarios for HomeFolder (read/write with no sharing) and Publication (read-only with sharing).

 

To Learn more about SMB and see Hyper-V over SMB in action check out this great session from TechEd:

 

We hope you are enjoying the series and check out Windows Server 2012 by taking a look at these downloads:

If you missed any of the parts you can find the rest of the series here: 31 Days of Our Favorite Things in Windows Server 2012.