Pin a File or VHD to a Storage Space Tier

In Windows Server 2012 R2, Microsoft added the ability to tier Storage Spaces such that hard disks and solid state drives where in separate tiers allowing the Storage Pool and the Storage Spaces in the pool to operate like a SAN that offers up hot block technology, automatically moving frequently accessed data up to the faster disks and less frequently accessed data down to the slower tiers.

In some circumstances, you may find that you want to pin a particular file or in the case of Hyper-V a VHD file accessed over an SMB file share to a particular tier. For example, you may want to pin the VHD file that hosts your virtual SQL Server TempDB files onto the SSD tier of your Storage Pool so that they are nice and fast. Inversely, you may want to pin data to the slow tier so that even if the Storage Pool detects the data as frequently accessed, it will never take up valuable space in your SSD tier.

In my lab, I am using Data Protection Manager (DPM) to backup my SQL databases among other things. The DPM server is a Hyper-V VM with the VHDs for the DPM server stored on a Windows Server 2012 R2 Storage Space which is accessed over SMB 3.0. As my Storage Pool consists of two tiers using SSD and spinning HDD disk, I don’t want the backup volumes to be able to ever exist on the SSD tier and storing backup data on fast disk is a waste of time (there is one caveat and that is that you may want to force the backup data onto the SSD tier in the event of a major failure in the datacentre and you are going to be doing a lot of restores over a short period of time).

To achieve pinning of files to a particular tier in the Storage Pool, we need to use the PowerShell Cmdlets for managing Storage Spaces either via PowerShell Remoting or directly on the SMB File Server hosting the files.

Setting the Desired Storage Tier

First, we need to get the name of the Storage Space, otherwise referred to as the Virtual Disk.

Get-VirtualDisk

Once we execute the Get-VirtualDisk Cmdlet, we will see a list of all of the Storage Spaces. You may have multiple in which case you need to determine which you are interested in however in my lab, there is only one. Next, we need to declare the name of our Virtual Disk in a variable.

$VD = Get-VirtualDisk -FriendlyName "VMs"

Using the Cmdlet above, we repeat Get-VirtualDisk however this time, we are setting the output for a specific Virtual Disk named VMs to the $VD variable so that we can re-use it later on.

Set-FileStorageTier -FilePath "V:\VMs\RJGDPM1\RJGDPM1 DPM Pool 1.vhdx" -DesiredStorageTier ($VD | Get-StorageTier -MediaType HDD)

With our Virtual Disk in a variable, we can now set the desired storage tier for a file. Use the Set-FileStorageTier Cmdlet above to achieve this. In my example, I am setting the DPM Pool disk VHDX file such that it will exist only on the hard disk slow disk tier. If you wanted to achieve the opposite and bind a file to the SSD tier then you would simply change the HDD value of the -MediaType parameter to SSD.

Optimize Files to the Desired Tier

Once you have run the Cmdlets above, your Storage Space is now ready and set to pin the file to the tier that you specified however this does not automatically move the files. The files are not moved until the next time a Tier Optimize job runs however we can force this if you want to move the file in a hurry or if you want to move the file to the appropriate tier before you start loading it with data (such as a new blank VHD file).

Optimize-Volume -DriveLetter V -TierOptimize

With the above, we use the Optimize-Volume Cmdlet against the drive letter on which the Storage Space and the files exist. This will start the process of evaluating file tier placement against the heat of a file and move files up and down through the tiers as required. This will also execute any placement rules which have been hard set as we did above. If you happened to be physically looking at your server at this point, you would likely see a flurry of disk activity as files get moved up and down through the drive tiers.

Once the optimization has finished, we can verify that the files are in the appropriate places using the following Cmdlet.

Get-FileStorageTier -VolumeDriveLetter V | FL

This Cmdlet will report any files which have been manually pinned to a particular Storage Space disk tier and will report their placement status. In my example, I have only the one DPM Storage Pool disk pinned to the HDD tier and this file is reporting as “Completely on tier” after the successful completion of the Tier Optimize job.

Moving Drives on an LSI MegaRAID Controller

As part of my home lab project which is still on-going (yes, I have been very quiet on this one of late), my plan has been to move my home server into a new chassis to match the other chassis I am using for the home lab. I use Storage Spaces on my home server but as I use an LSI MegaRAID card, I have all of my drives setup as individual RAID0 sets because the MegaRAID family of cards do not support JBOD.

My biggest worry with moving to the new chassis has been the storage and whether or not my RAID0 sets will come across and manage to keep all of my Storage Space data in tact as I have a lot of it and I’d obviously not like to lose it all. This worry is because of the changes in design. My current chassis uses a Reverse Breakout SATA cable to connect the drives, with an SFF-8087 SAS Multilane connection at the controller end and four conventional SATA connections at the drive enclosure end times four for the quad SAS channels on the controller card. The new chassis uses SFF-8087 to SFF-8087 SAS Multilane cables end-to-end and the backplane of the chassis handles the breakout to the individual drives. As a result, I can’t guarantee that all of the drives will be reconnected to the same channel and port on the controller during the move.

I got the chance this week to test this out as I had to add a new 3TB drive to the pool to add capacity. I added the drive to the server, configured a RAID0 for it but I set it up as a Simple NTFS partition disk and not a member of the Storage Space. I put some files on the disk and played around with different options moving the drive around. I pulled the new drive and re-inserted it in a different slot, now connected to a different channel and port but it came up with a foreign configuration on the drive, not exactly what I wanted.

I cleared the foreign configuration on the drive as importing these foreign configurations scares the hell out of me in the event that it overwrites the local configuration and blows away all of the drives including my RAID1 SSD pair for the operating system installation. After clearing the configuration, I created a new RAID0 set and added the drive to it however this time, I did not initialize the drive. After the virtual disk came online, instead of being uninitialized, it came up with the existing formatted partition and my existing test data, good but not perfect as I had to recreate the RAID0 set.

I was looking online for answers and nobody online seems to clearly answer the question how best to move disks around with an LSI MegaRAID controller, strange with these being some of the most dependable and popular cards on the market but I found my answer in the LSI documentation and a little under referenced feature called Drive Roaming.

Drive Roaming occurs when a disk is moved from one port or channel on the controller to another such as my case where I want to move to a new chassis and I am unsure whether all the drives will come back on the same ports and channels. Drive Roaming occurs at start-up when the controller starts up and reads the configuration in NVRAM on the controller and compares it to the configuration stored on each of the drives. This reading of the configuration allows a drive to be moved within the controller to another port or channel and remain configured as before but the emphasis here is on the at start-up.

When I first tested this, I moved the drive online so the drive did not roam, it was pulled and re-inserted. When I did a second test after reading the documentation, I moved the drive with the server shut down and indeed, the drive came back online with the same RAID0 set as configured before and all was working nicely. This is perfect because when I move between the chassis, I will be doing it with the server offline, shutdown and inert so I can now move all of my drives, safe in the knowledge that everything will be retained as was.

Because I know that nothing in IT goes as smoothly as planned however, my fallback option is to re-configure the RAID sets but select the No Initialization option for the drives. To this end, I have recorded the exact configuration of all of my RAID sets. I have recorded the RAID levels, Stripe Sizes, IO and Read Through settings. I have also recorded the current Port and Channel for each drive and the Model and Serial Number for each drive so that I can match the configuration back exactly as it is now. Consistency makes my life easier here. All my drives are 3TB, all Western Digital Caviar Red drives and all are in their own unique RAID0 set and all RAID0 sets are using the same Direct IO and Read Through setting so re-creating the sets is actually a cinch. The only exception is my operating system set which is configured as a RAID1 with two Intel 520 Series SSD drives and I’ve got the settings recorded for them too.

Last but not least, I’ve got my backups. My personal and important data is backed up to Microsoft Azure Backup using the integration with Windows Server 2012 R2 Essentials. To protect the operating system, I’ve got a Windows Backup created locally to a USB hard drive of the operating system partitions so that I can perform a bare metal recovery of the operating system if needed to the RAID1 SSD drives.

This post has been a bit of a waffle and a ramble but I hope that my learning of the LSI MegaRAID Drive Roaming feature helps somebody out there trying to investigate the same thing as me.

Storage Spaces Inaccessible After Windows Server 2012 R2 Upgrade

Windows Server 2012 R2 has some nice new features and improvements on existing features for users of Storage Spaces so there is a definite appeal for users of Windows Server 2012 to want to upgrade to Windows Server 2012 R2.  If you opt to do an in-place upgrade to preserve your existing Storage Spaces so that you can get your service up and running with the hope of being able to use them straight off the bat in Windows Server 2012 R2, you may encounter an error Read-only by user action and you need to perform some corrective steps to use them again.

Storage Space Read-Only User Action

This is what your Storage Spaces may look like if you open the Storage Spaces control panel item after the upgrade. As you can see, the spaces are in-tact and will report all of the space names and capacity from prior to the upgrade but instead of being online as you are used to seeing, you instead have this information icon and a message alongside the pool capacity indicator Read-only by user action. This is a built in protection feature of Windows Server 2012 R2 which takes your Storage Spaces offline by default after an upgrade. We just simply need to bring them online to use them. This is very similar to how in Windows Server 2003, a disk connected from an external system from a software RAID set could be marked as Foreign and the configuration of the disk needs to be imported first.

Changing the Storage Pool Status to Read/Write

To do this, open an administrative PowerShell prompt. At PowerShell, enter the two Cmdlets as follows:

Get-StoragePool | Where-Object {$_.IsReadOnly -eq $True} | Set-StoragePool -IsReadOnly $False
Get-VirtualDisk | Where-Object {$_.IsManualAttach -eq $True} | Set-VirtualDisk -IsManualAttach $False

If you forget to elevate the PowerShell prompt by running it as an administrator you will get access denied responses to the two Cmdlets as you aren’t running the Cmdlets with your administrative rights. Simply close PowerShell and re-open it by right-clicking and using the Run as Administrator option.

Bring the Storage Spaces Online

Once you’ve entered the Cmdlets above, returning to the Storage Spaces control panel applet now, you will see the information shown has updated.

Storage Space Offline by Policy

As you can see, the Storage Spaces are now reporting their status as OK but they are marked as Offline by Policy. To change this and to bring the Storage Spaces online, simply click the Bring Online option next to each Storage Space and it will be brought online and granted a drive letter.

Check, Verify and Reminder

It’s important to note here that the drive letter assigned will be the next free letter and not perhaps, the drive letter that you used on the previous installation of Windows Server 2012. If you have a requirement for the Storage Space to be on a particular letter then you will need to go into the Properties of the individual spaces after it has been brought online and change the letter.

It’s also good to remember that any file shares you had on these Storage Spaces may be un-shared through the upgrade process so you should check the existence of your shares either by using the Properties on the drive or folder which you needed to be shared or by using the Share and Storage Management administrative console.

Once you’ve got your Storage Spaces all brought online after the actions above, you should be looking like normality again as shown below.

Storage Space Online Normal

Hopefully someone out there finds this useful and it saves at least a few hair extractions from taking place after a Windows Server 2012 to Windows Server 2012 R2 in-place upgrade. Now it’s time to go and enjoy those new features.

Windows Server 2012 Essentials Storage Spaces Vs. RAID

In Windows Server 2012 Essentials as with the whole Windows 6.2 kernel family, Storage Spaces and Storage Pools re-invent the concept of Drive Extender from Windows Home Server v1. With several options for resiliency in Storage Pools, I thought I would touch on what bang you will get for your buck with each protection level and compare it to physical RAID levels.

For all the examples, I will be using 2 500GB disks unless the example requires more such as RAID 5 or 10 where I will use the minimum number required to achieve the set. If you are using 1TB, 2TB or greater sized disks, then simply multiply the figures here to work out your gains.

RAID 0 (Stripe – No Resiliency in Disks, Two Disks Required)
1TB Raw / 1TB Usable

RAID 1 (Mirror – Single Disk Resiliency, Two Disks Required)
1TB Raw / 500GB Usable

RAID 5 (Stripe with Parity – Single Disk Resiliency, Three Disks Required)
1.5TB Raw / 1TB Usable

RAID 10 (Mirror of Stripes – One Disk in Either Stripe or Both Disks in One Strip May Fail, Four Disks Required)
2TB Raw / 1TB Usable

Storage Space Simple (Equivalent to RAID 0 – No Resiliency in Disks, One Disk Required)
500GB Raw / 500GB Usable

Storage Space Two Way Mirror (Equivalent to RAID 1 – Single Disk Resiliency, Two Disks Required)
1TB Raw / 500GB Usable

Storage Space Three Way Mirror (Equivalent to RAID 1 with a 2nd Mirror – Two Disk Resiliency, Three Disks Required)
1.5TB Raw / 500GB Usable

Storage Space Parity (Equivalent to RAID 5 – One Disk Resiliency, Three Disks Required)
1.5TB Raw / 1TB Usable

The thing to be clear on Storage Pools and Storage Spaces over traditional RAID is that RAID consumes the entire disk, obscuring it to the physical operating system and limits you to the capacity of the underlying disk subsystem. This makes adding new disk to an existing RAID set and extending it’s capacity challenging unless you are using RAID 5 whereby you can simply add disk and extend capacity. Storage Pools and Storage Spaces are different in that the Pool amalgamates the capacity of the underlying disks together, then pools overlay the disks to provide the availability. This allows you to do clever things like use three disks in a single Pool to provide both a Two Way Mirror to provide protection to read/write files such as documents and a Parity to provide protection to read only workloads such as video or music files, maximising the yield from your disk investment. With RAID, so achieve these separate protection levels, you would need five disk instead of three.

I think the only challenge with Storage Pools and Storage Spaces is going to be to calculate the capacity requirements and optimising the use of the disks: In my scenario I have 6 2TB disks and trying to decide what levels to protect the different content types at and whether to split each workload type into a dedicated Storage Space or whether to Pool Spaces between workloads is interesting as I want to make sure that my content is protected as effectively as I need it, but at the same time, as a consumer, I can’t afford to blow £150-£200 on new disks all the time so I need to maximise my investments.

The core advantage of Storage Pools and Storage Spaces for me over RAID is that it does allow you to fine-grain control your disks making the most out of them, thin-provisioning (over provisioning as it actually should be called) allows me to design the disks for future expansion ahead of time and it allows me to add disks and expand pools (online) without complicated RAID array configurations, changes and scary thoughts of migrating RAID levels (if you have a controller which supports such a thing).

I’ll be doing another post in the coming days on my options for Storage Pools and Storage Spaces, and where I am leaning and why.