Rebalance hard drives in a Storage Space Pool?

13

7

I have 2x 1.5TB drives in a (two-way mirror storage pool). That pool recently hit 100% capacity meaning both drives had 0% space left.

I added 2x 4TB drives to the storage pool but Storage space doesn't attempt to rebalance the disk utilization. After I added I now see:

My storage space pool : Physical drives
1.5 TB HDD-1 : 100% used
1.5 TB HDD-2 : 100% used
4.0 TB HDD-3 : 0% used
4.0 TB HDD-4 : 0% used

Seems that all future writes would now be concentrated on the newer drives. I was expecting Storage Space to get busy once it saw the new drives and begin rebalancing - but no such luck.

How can I rebalance the usage so that my read/writes are distributed roughly proportionately/equally across all drives in my storage pool?

FYI, this is on Windows Server 2012 R2 but it's the same storage space as Windows 8.1

DeepSpace101

Posted 2014-08-28T23:56:08.337

Reputation: 7 579

Answers

10

Resurrecting this old question with something that finally works in the upcoming Windows 10 and Windows Server 2016 OSes.

Microsoft have added a Optimize-StoragePool PowerShell command in Windows 10 and Windows Server 2016 that rebalances storage spaces for an entire pool.

It's as easy as opening an Administrative PowerShell console and running Optimize-StoragePool -FriendlyName "TheNameOfYourStoragePool"

I blogged about it here.

Microsoft announced the feature just a few days ago as part of the new Storage Spaces Direct but it works just fine with normal Storage Spaces as well.

Stefán Jökull Sigurðarson

Posted 2014-08-28T23:56:08.337

Reputation: 241

Thank you VERY VERY much for that, have spent ages searching for how this will work in Windows 10, and I am glad to see that it has been upgraded! – topherg – 2015-07-08T16:26:30.690

1It seemed to work fine for the tests that I did. I did see some weird behavior with parity pools, but I wouldn't rule out that I was simply doing something wrong.

I'll be setting it up on my "NAS" (repurposed old HP MediaSmart Server machine) soon, and I'll update the blog with more information then. – Stefán Jökull Sigurðarson – 2015-07-09T09:32:04.757

@StefánJökullSigurðarson: Can you put a sentence or two about the weird behavior till your blog post goes online? – DeepSpace101 – 2015-07-17T14:58:09.357

1I guess its doubtful Microsoft would ever backport or provide similar functionality to Windows 8/8.1/2012/2012 R2? It would be nice to be able to do this in 2012 R2, as I have a similar issue. – James White – 2015-08-03T15:14:50.317

3*"Optimize pool is supported only with Simple or Mirror Spaces; Parity Spaces are not supported"* – Ian Boyd – 2015-11-12T13:11:23.187

7

I had a similar issue when I discovered Storage Spaces (in Windows 8.1) and I was migrating my existing files. I started off with the drives:

  • Aaron: 500GB, 95% used
  • Bruce: 1TB, 70% used
  • Craig: 1TB, 55% used
  • Devin: 1TB, 30% used
  • Ethan: 3TB, 50% used
  • Felix: 3TB, 0% used

So, I after shifting everything on to the 2 3TB drives, I connected the remaining 4 drives to Storage Spaces, created a space, then copied the files from the 2 populated drives into the space (parity resilience). After adding the two drives back to the space (sequentially), all the drives were at around 50% usage, but the 3TB drives where at 20% and 0% respective to when they had been cleared and added to the pool.

I tried waiting a few days to see if the system would rebalance itself, but nothing happened.

Eventually, what I discovered was I had two options:

  1. Create a second space, and sequentially copy and delete the files from one to the other (not sure if cutting does the same, but I was operating with the understanding that if a cut was performed, the system would detect that and simply re-label the slabs rather than move them, but I cannot vouch for the validity of this statement)
  2. Take a disk offline and re-introduce it (REQUIRES SOME RESILIENCE)

I went with the second option, but in earlier tests, the first option seemed to work, but very slowly.

So, once all my files and disks where in the pool, I physically disconnected (USB in my case, in your case you could probably just disable the device) one of the fuller disks. Storage Spaces then started showing an error about "Reduced Resiliency", and gave me the option to remove the disk from the pool, which I did.

I then waited several hours (started it in the morning, went to work, came back to a finished screen) while Storage Spaces then repaired the spaces. Once the space had been repaired, I reconnected the disk, formatted it, and reintroduced it to the pool.

I repeated this step for all the drives I wanted to rebalance, working in an order from largest to smallest in capacity, so that my small 500GB drive was the last to be re-added.

Yes, this means that ultimately there is one drive left over that is at 0% usage, but in time, it was quickly filled back up to the average % usage of the entire pool

topherg

Posted 2014-08-28T23:56:08.337

Reputation: 1 004

Assuming you only have one virtual hard disk, option one would require you to have free diskspace that is matching 2x your volume, cause even if you are using thin provisioning, The "old" vhdd will not free any diskspace untild deleted. So in various scenarios, this is not possible. Option 2 does not really provie a real rebalancing, because the disk you re-introduce last will always be emptier than the other disks. – dognose – 2015-01-18T13:04:32.560

@dognose, while both those points have merit, until Microsoft introduce a more native way of slab rebalancing, that is the closest that we will be able to get, sadly.

With regard to Option 2, I ended up discarding Aaron (due to disk failure), and the final repair got the slabs nicely rebalanced, but yes, far from ideal... – topherg – 2015-01-20T15:50:24.647

1

Windows 10 has the Optimize Pool command available right in the GUI:

enter image description here

enter image description here

Windows Server

The ability to optimize a pool was added with Windows Server 2016. But unlike it's GUI-based workstation OS counterpart, Windows Server has no GUI to manage storage space optimization. Instead you must use powershell:

> Get-StoragePool

FriendlyName              OperationalStatus HealthStatus IsPrimordial IsReadOnly     Size AllocatedSize
------------              ----------------- ------------ ------------ ----------     ---- -------------
Primordial                OK                Healthy      True         False      10.23 TB       5.46 TB
Silk Road Pool            OK                Healthy      False        False       5.45 TB       4.11 TB

> Optimize-StoragePool -FriendlyName "Silk Road Pool"

But also note that on Windows Server, the data will be automatically rebalanced 30 minutes after a drive is added.

image

You can get the status of the optimization through powershell (Again, Microsoft hates graphical user interfaces):

> Get-StorageJob

Name      IsBackgroundTask ElapsedTime JobState PercentComplete BytesProcessed BytesTotal
----      ---------------- ----------- -------- --------------- -------------- ----------
Optimize  False            00:12:21    Running  11
Rebalance True             00:00:00    Running  11              114085068800   1020323168256

Note: The ability to reblance/optimize only works for Windows Server 2016/Windows 10 spaces. If you are using a space created in Windows Server 2012/Windows 8: you'll have to "Upgrade" the space.

Ian Boyd

Posted 2014-08-28T23:56:08.337

Reputation: 18 244