Build Your Private Cloud in a Month: Foundation Windows Server 2012 Storage

imageWhen you start to think of building a private cloud into your datacenters, you might naturally think you need run out and buy a SAN.  While you still may want to go buy a SAN, with Windows Server 2012 you do not necessarily need to.  In Windows Server 2012 there has been a tremendous amount of improvement done to the storage capabilities.  Specifically you now can have continuously available file shares on your cluster servers.  This is mainly due to the new SMB 3.0 protocol built-in to the server, it really has made storage a first class citizen in Windows Server 2012.  So for todays post I am going to take a look at how to build a Windows Server 2012 storage environment using Storage Pools and inexpensive Serial-Attached SCSI (SAS) disks to provide the necessary storage backend for your private cloud infrastructure.  The best part is if you assigned the storage pool to your cluster you know have a continuous available share all built on fairly inexpensive disks.  Even better than that is that Windows Server 2012 Hyper-V can leverage the clustered share now you have a virtualized environment that is always at your fingertips.

Create a storage pool is actually fairly straight forward, after you have the drives connected to the system.  However, if you are going to build the storage out on a cluster there are some things you need to do that are unique to working with a clustered environment.  Before you begin the process you will want to review the list of prerequisites located here: Deploy Clustered Storage Spaces Prerequisites

The first thing you will need to install the multipath I/O software (MPIO).  This feature allows for multiple physical paths to physical path as a single logical path for data access.  In other words if you have a lot of drives configured in a JBOD enclosure with multiple SAS connections to each host, MPIO allows the hosts to see each physical drive path via a single redundant path.  In a cluster, MPIO can be combined with
Storage Spaces and Cluster Shared Volumes ( CSV ) to treat these physical drives as a single highly-available shared volume.

To install MPIO via the Add Roles and Features wizard in Server Manager or you can run the following PowerShell script:

Install-WindowsFeature –ComputerName servername –Name Multipath-IO

You will also want to make sure sharing is working on your servers but a bulk of your work will come from making the storage spaces for your cluster to use.  Storage Spaces offers an easy way to combine your drives into one logical volume.  You can either create the storage spaces before you create the cluster or after creating the clustering.  Either way is effective, I am going to take you through a quick look at creating the storage spaces, you can find some really detailed steps here: Deploy Storage Spaces on a Stand-Alone Server.  Overall the procedure looks like this:

  1. Create your Storage Pool
  2. Create your Virtual Disk
  3. Create your Volume

To create your storage pool go into server manager and select File and Storage Services, then select storage pools:


Right click in the Primordial Pool and select New Storage Pool. You will run the wizard where you can name the pool and specify which physical disks are to be used. 


After your pool is in place then you need to create the virtual disk.  To create the virtual disk, right click on your storage pool and select new virtual disk.  The virtual disks you create provide the ability to create a simple, mirror or paritied layout for the drives:


You then also have the ability to determine the provision for the server Thin or Fixed.  Thin provisioning, space is allocated on an as-needed basis. This optimizes the usage of available storage. However, because this enables you to over-allocate storage, you must carefully monitor how much disk space is available.  With fixed provisioning, the storage capacity is allocated immediately, at the time a virtual disk is created. Therefore, fixed provisioning uses space from the storage pool that is equal to the virtual disk size.


Based on your provision type you will then be able to create your virtual disk.  Then you can carve up your virtual disk like any other drive by creating volumes.  Right click on the virtual disk and select new volume, and this is just like creating any other volume.  Now when you create storage pools I am sure you might have some additional questions.  There is an excellent FAQ located here: Storage Spaces Frequently Asked Questions (FAQ), that helps answers some of these questions:

  • How can I manage Storage Spaces?
  • What are the recommended configuration limits?
  • What are the best uses of simple, mirror, and parity spaces?
  • What types of storage spaces can I use with a failover cluster?
  • What properties can I change after creating a storage space?
  • How does Windows let me know of a disk failure?
  • How do I replace a physical disk?
  • How do I increase pool capacity?
  • How do I check Storage Spaces resiliency health in a failover cluster?
  • How do I know repairing a storage space starts and successfully completes?
  • What happens if I run out of physical capacity on a thinly provisioned storage space?

After you have created your storage spaces you will then need to create your cluster, a couple of weeks ago I wrote a post that showed how to create a cluster for your Hyper-V hosts that outlines the process: 20 Days of Server Virtualization- Your Hyper-V Hosts and Clustering an Availability Story.  There is also another good article here: Deploy Clustered Storage Spaces During the creation the cluster, you will simply need to add the storage spaces as storage for your cluster.    Once the cluster is created then you need to create the continuously available file share, there is an excellent article showing this process (SMB Transparent Failover – making file shares continuously available), and to create a file share do the following:

  1. Start Server Manager
  2. Click Tools and select Failover Cluster Manager
  3. In the console tree, do the following
    1. Select and expand the cluster you are managing
    2. Select Roles
    3. In the Results pane, select the file server where you want to create the file share and in the Actions pane click Add File Share. This will start the New Share Wizard
  4. In the New Share Wizard, do the following
    1. In Select Profile, select the appropriate profile SMB Share – Applications (is what you will need for Hyper-V) and click Next
    2. In Share Location, select the volume where you want to create the share and click Next
    3. In Share Name, enter the share name and click Next
    4. In Configure Share Setting, verify Enable continuous availability is set and click Next
    5. In Specify permissions and control access, modify the permissions as needed to enable access and click Next
    6. In Confirmation, review your selections and when ready click Create
    7. Click Close

Now this is where some magic happens, and magic is SMB 3.0.   I wrote about all the improvements to SMB 3.0 here: 31 Days of Our Favorite Things: SMB 3.0 the Glue in Windows Server 2012.  Once you have verified the share has been created in you cluster than it is a matter of leveraging that share for hyper-V.  Overall this process straight forward, you will simply need to need to create your virtual machine and virtual machine hard disk on the file share, use a UNC path for the location i.e. \\clusterame\sharename.   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


When you think about the storage foundation for your private cloud.  You do not have to go through all the costs of a SAN to create a continuously available environment.  Using the built-in tools in Windows Server 2012, and leveraging your physical disks you can create a fantastic storage environment easily and inexpensively.

To learn more about the series and other parts please go here: Build Your Private Cloud in a Month - New Article Series