Welcome!

Search Authors: Elizabeth White, Liz McMillan, Shelly Palmer, Lacey Thoms, Jayaram Krishnaswamy

Related Topics: .NET, Virtualization, Search, Silverlight, Web 2.0, Cloud Expo

.NET: Blog Post

Right-Size IT Budgets with Windows Server 2012 "Storage Spaces"

SAN-like Storage Capabilities with Commodity Hardware in Windows Server 2012

Very Cool! How can I build my own "Storage Spaces"?
"Storage Spaces" can be easily configured locally or remotely on servers running Windows Server 2012 or Hyper-V Server 2012.  Pick your tools - Use the new Server Manager GUI management tool, or a new set of 74 PowerShell Storage Cmdlets if you're more inclined towards the command-line.  In my case, I find myself constantly provisioning and re-provisioning storage for my lab environment, so I prefer PowerShell 3.0 as my tool of choice.

Setting up a new Storage Space involves three components: A storage pool that serves as a container, or resource pool, of your physical disks; A virtual disk, or LUN as we call it in the SAN world, that carves out a portion of your raw capacity in the storage pool to present as a disk to the operating system; and a volume, which becomes the formatted space that we can mount as a filesystem and, ultimately, store our files within.

Let's step through the basics of configuring each of these items one-by-one using the new PowerShell 3.0 Cmdlets:

  1. Grab a "bunch of disks" into a new PowerShell object variable, such as $PhysicalDisks:

    $PhysicalDisks = Get-StorageSubSystem -FriendlyName "Storage Spaces*" | Get-PhysicalDisk -CanPool $True

    This command identifies all physical disks that are not currently part of an existing Storage Pool on the server and stores them in the $PhysicalDisks object array. If we look at the contents of the $PhysicalDisks variable now, we'll see an enumeration of each physical disk as follows:


  2. Using our new $PhysicalDisks object array, now we'll create a new storage pool named "MyStoragePool01" and then pass this newly created storage pool down the PowerShell object pipeline to the command line in Step 3.

    New-StoragePool -FriendlyName MyStoragePool01 -StorageSubsystemFriendlyName "Storage Spaces*" -PhysicalDisks $PhysicalDisks |
  3. Using the newly created storage pool that we passed from Step 2 into the PowerShell object pipeline ... create a new 100GB virtual disk named "MyVirtualDisk01" that is thin provisioned.  Pass this newly created virtual disk down the PowerShell object pipeline to Step 4. 

    New-VirtualDisk -FriendlyName MyVirtualDisk01 -Size 100GB -ProvisioningType Thin

    Note that, by default, a "Simple" virtual disk will be created with no disk fault tolerance.  You can also use the -ResiliencySettingName parameter with the New-VirtualDisk Cmdlet to choose either "Mirrored" or "Parity" virtual disk configurations for fault tolerant scenarios.  Of course, choosing a fault tolerant scenario will cause a higher volume of disk writes to occur, which can impact overall performance - so you'll want to do some testing with your hardware and applications.  In my testing, Mirrored provides the best balance of performance and fault tolerance for me and also works nicely with the file system resiliency features in the new ReFS filesystem for large data volumes.
  4. Using the newly created virtual disk that we passed from Step 3 into the PowerShell object pipeline ... initialize the new disk, create a new partition mounted with the next available drive letter and format a volume within the new partition.

    Initialize-Disk -PassThru | New-Partition -AssignDriveLetter -UseMaximumSize | Format-Volume

Done! If you didn't quite catch it as we were going through steps 2, 3 and 4 above ... those commands are all part of one continuous command line! That's right ... in one line of code, we created a new storage pool, virtual disk and formatted volume!  PowerShell 3.0 ROCKS! :-)

Your Turn ... Build Your Own "Storage Spaces"!
As part of our FREE Windows Server 2012 "Early Experts" study program, we have a structured set of step-by-step study materials and lab exercises for watching, learning and implementing Storage Spaces in Windows Server 2012.  Join us and become our next "Early Expert" at http://EarlyExperts.net!  When you're ready to try the Storage Spaces lab, you'll find it here.

What's Next?
In this article, we walked through usage scenarios and step-by-step examples of configuring SAN-like storage solutions on commodity hardware using Windows Server 2012 Storage Spaces.  To continue your learning on Windows Server 2012, check out these resources next ...

How Are You Planning to Use "Storage Spaces"?

Have you found an interesting use case for Storage Spaces and/or PowerShell 3.0 in your shop?  Be sure to share your story in the comments below!

HTH,

Keith

Build Your Lab! Build Your Lab! Download Windows Server 2012
Build Your Lab in the Cloud! Don’t Have a Lab? Build Your Lab in the Cloud with Windows Azure Virtual Machines
Join our "Early Experts" study group! Want to Get Certified? Join our Windows Server 2012 "Early Experts" Study Group

More Stories By Keith Mayer

Keith Mayer is a Technical Evangelist at Microsoft focused on Windows Infrastructure, Data Center Virtualization, Systems Management and Private Cloud. Keith has over 17 years of experience as a technical leader of complex IT projects, in diverse roles, such as Network Engineer, IT Manager, Technical Instructor and Consultant. He has consulted and trained thousands of IT professionals worldwide on the design and implementation of enterprise technology solutions.

Keith is currently certified on several Microsoft technologies, including System Center, Hyper-V, Windows, Windows Server, SharePoint and Exchange. He also holds other industry certifications from IBM, Cisco, Citrix, HP, CheckPoint, CompTIA and Interwoven.

Keith is the author of the IT Pros ROCK! Blog on Microsoft TechNet, voted as one of the Top 50 "Must Read" IT Blogs.

Keith also manages the Windows Server 2012 "Early Experts" Challenge - a FREE online study group for IT Pros interested in studying and preparing for certification on Windows Server 2012. Join us and become the next "Early Expert"!

Comments (1)

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.