Sunday, April 23, 2017

Enabling and Setting up SSD/HDD Storage Tiers in Hyper-V on Server 2012R2

In this post I am going to cover how to create a storage spaces tiered storage array, format it to use ReFS and have Server 2012R2 Mount the drive after/when the system is restarted.  You will have to have the Server 2012R2 installed with the Hyper-V role added before we begin.

When installed you can see from the GUI 4 disks that you have available in my case I have 4 but only three can be pooled because in this list my OS disk is being shown in here.


















This powershell command shows what disks can be pooled.
#List all disks that can be pooled and output in table format (format-table)           

Get-PhysicalDisk -CanPool $True | ftFriendlyName,OperationalStatus,Size,MediaType       

The results of the powershell commands are shown below.









To make our lives easier we create a variable with unspecified disks.
           
#Store all physical disks that can be pooled into a variable, $pd           
$pd = (Get-PhysicalDisk -CanPool $True | Where MediaType -NE UnSpecified)           

#Create a new Storage Pool using the disks in variable $pd with a name of My Storage Pool      

---For 2012R2 and earlier---     
New-StoragePool -PhysicalDisks $pd –StorageSubSystemFriendlyName “Storage Spaces*” -FriendlyName “DATA”         

---For Server 2016 and newer---
New-StoragePool -PhysicalDisks $pd –StorageSubSystemFriendlyName “Windows Storage*” -FriendlyName “DATA”   


#View the disks in the Storage Pool just created           
Get-StoragePool -FriendlyName "DATA" | Get-PhysicalDisk | SelectFriendlyName, MediaType
           







So we have 2 types of disks shown in our storage pool.  SSD and HDD

We run the following commands to create a tiered storage pool.  This will create a ssd pool and hdd pool

#Create two tiers in the Storage Pool created. One for SSD disks and one for HDD disks           
$ssd_Tier = New-StorageTier -StoragePoolFriendlyName "DATA" -FriendlyName SSD_Tier -MediaType SSD           
$hdd_Tier = New-StorageTier -StoragePoolFriendlyName "DATA" -FriendlyName HDD_Tier -MediaType HDD

Now we can switch to the gui and create our VHD which will mount to the HOST OS.  We will also be able to create a writeback cache.  From here we can start the Wizard in the GUI.






Now here is where we can select the option to create tiered storage spaces and name your virtual disk.


Here is where you can specify what kind of setup you want in my case simple or mirrored. However I could not do mirrored as I did not have enough physical disks available so for the purposes of this post I went with simple.  Though for performance and redundancy I would select mirrored.  StorageSpaces allows for 3 types of resilient storage.


Resilient storage. Storage Spaces provides three storage layouts (also known as resiliency types):
  • Mirror. Writes data in a stripe across multiple disks while also writing one or two extra copies of the data. Use the mirror layout for most workloads – it helps protect your data from disk failures and provides great performance, especially when you add some SSDs to your storage pool and use storage tiers.
  • Parity. Writes data in a stripe across physical disks while also writing one or two copies of parity information. Use the parity layout for archival and streaming media workloads, or other workloads where you want to maximize capacity and you’re OK with lower write performance.
  • Simple (no resiliency). Writes data in a stripe across physical disks without any extra copies or parity information. Because the simple layout doesn’t provide any protection from disk failures, use it only when you require the highest performance and capacity and you’re OK with losing or recreating the data if a disk fails. You can also use the simple layout when your application provides its own data protection.
Once you go forward you will see something like this for the following screen.




You will see an alert about the write-back cache, and I will end up with a 700GB drive 1 x 120 GB SSD and 2 x 320 GB HDD.  Now because this lab is a simple setup (3 drives) and if I wanted any kind of redundancy (which I would want for a production environment) I would want to use a mirror setup for the storage spaces instead of simple for the storage layout.

Update - April 24, 2017

After that you will want to get your storage space volume to auto mount

Open an administrative level PowerShell prompt and type in the following.
Get-VirtualDisk | Where-Object {$_.IsManualAttach –eq $True}
This lists off your virtual disks where the IsManualAttach property is turned on and the disks WILL NOT auto-reattach on restart.
Now run the line again but include the following:
Get-VirtualDisk | Where-Object {$_.IsManualAttach –eq $True} | Set-VirtualDisk –IsManualAttach $False
Now the virtual disk will auto mount after a restart/power cycle.

Update - April 26, 2017

I was unable to use the procedure above to work with NVMe based SAS drives. If you want to know how that was setup see my post How to setup Storage Tiers on Server 2012R2 with Powershell and NVMe Drives I go through step by step on how to setup the storage spaces using powershell.


For more information about storage spaces please refer to the following articles


and for referencing some of the powershell commands I used checkout



Automount Storage Spaces Virtual Disk


You can also view the whole process on my youtube channel. https://www.youtube.com/watch?v=hNhX65DDaT4



How to fix CURL call imporitng an RSS feed on a site blocking CURL calls

There is a 3rd party service provider that my organization uses called bibliocommons.  They have these nice book carousels.  However the car...