Modify Storage Tiers Optimization With PowerShell #PowerShell #StorageSpaces #WS2012R2

| , ,

Published on | Updated on February 28, 2021

2 Min. Read

Hello Folks,

The killer feature in Windows Server 2012 R2 is Storage Tiered Spaces.

What is Storage Tiered Spaces?

Storage Tiers automatically moves frequently accessed data to faster (solid-state drive) storage and infrequently accessed data to slower (hard disk) storage, by having the file system actively measure the activity of the workload in the background and then automatically and transparently move data to the appropriate tier (SSD or HDD) depending on how hot or cold the data is determined to be.

Storage Spaces in Windows Server 2012 R2 can thus ensure that the workload’s hot data is always stored on the SSD tier to take advantage of the high performance of this tier, and its cold data on the HDD tier to make use of the high capacity of this tier. If a portion of the data for a particular file becomes hotter (is accessed more frequently), then it gets moved from the HDD tier to the SSD tier. And if the portion of data becomes cooler (is accessed less frequently), then it gets moved from the SSD tier to the HDD tier as shown in figure 1.


Figure 1

For more information on What’s New in Storage Spaces in Windows Server 2012 R2, click here.

Ok, so having this explained, the placement of data in storage tiers on all tiered storage spaces in the system is a daily task that runs every day at 1.00 AM.



Sure enough the trigger can be customized to run more than once per day.

As I am running heavy SQL Virtual Machines workloads on my storage spaces, I need the system to determine more frequently the cold and hot data chunks and move them accordingly between the two tiers.

How can we accomplish this? Easy enough by creating new Trigger in Task Scheduler UI.

How about if you want to add 4 or 5 Triggers, how many clicks you want to click? Winking smile

The cutting edge time is PowerShell Smile

Here is an easy way to do it:

PS C:\>$Time1 = New-ScheduledTaskTrigger -Daily -At 7am

PS C:\>$Time2 = New-ScheduledTaskTrigger -Daily -At 12pm

PS C:\>$Time3 = New-ScheduledTaskTrigger -Daily -At 7pm

PS C:\>$Time4 = New-ScheduledTaskTrigger -Daily -At 1am

PS C:\>Set-ScheduledTask -TaskPath “\Microsoft\Windows\Storage Tiers Management” -TaskName “Storage Tiers Optimization” -Trigger $Time1, $Time2, $Time3, $Time4

PS C:\> Get-ScheduledTask -TaskName “Storage Tiers Optimization” | fl Triggers

Triggers : {MSFT_TaskDailyTrigger, MSFT_TaskDailyTrigger, MSFT_TaskDailyTrigger, MSFT_TaskDailyTrigger}




Demo: Hyper-V Virtual Switch Extended Port ACL’s

Migrate VMware VMs to Hyper-V using MVMC 2.0


Leave a comment below...

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe to Charbel Nemnom’s Blog

Get the latest posts delivered right to your inbox

The content of this website is copyrighted from being plagiarized! You can copy from the 'Code Blocks' in Black.

Please send your feedback to the author using this form for any 'Code' you like.

Thank you for visiting!