When 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 withStorage 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
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:
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:
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:
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:
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:
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