Coming Soon: GET:IT Endpoint Management 1-Day Conference on September 28th at 9:30 AM ET Coming Soon: GET:IT Endpoint Management 1-Day Conference on September 28th at 9:30 AM ET
Windows Server 2012

Provision a Windows Server Storage Spaces Mirrored Volume with PowerShell

In this easy Ask the Admin, I’ll show you how to quickly set up a Storage Spaces mirrored volume on Windows Server 2012 R2 with the help of PowerShell.

Storage Spaces debuted in Windows Server 2012, and provides storage virtualization capabilities offering flexibility, durability, and scalability once only available in expensive hardware-based storage solutions. While previous versions of Windows Server included software RAID, it was considered inferior to enterprise-grade hardware alternatives.

In contrast, Storage Spaces utilizes advances in Windows Server to provide software RAID that can in many configurations match the performance of hardware RAID, assuming the disks and connecting interfaces are up to the job. If performance isn’t a key consideration, Just a Bunch of Disks (JBOD) can be used to provide fault-tolerant storage.

Storage Spaces doesn’t just do resiliency, but also tiered storage and continuous availability among other things. But in this article, we’ll look at how to mirror a pair of locally attached disks, and create a volume accessible to Windows. For more information on Storage Spaces, see Windows Server 2012: Is Storage Spaces the Killer Feature? and New Features in Windows Server 2012 R2 Storage Spaces on the Petri IT Knowledgebase.

Sponsored Content

Say Goodbye to Traditional PC Lifecycle Management

Traditional IT tools, including Microsoft SCCM, Ghost Solution Suite, and KACE, often require considerable custom configurations by T3 technicians (an expensive and often elusive IT resource) to enable management of a hybrid onsite + remote workforce. In many cases, even with the best resources, organizations are finding that these on-premise tools simply cannot support remote endpoints consistently and reliably due to infrastructure limitations.

Prepare the Disks

I’m going to use an Azure virtual machine for this demonstration. You can easily perform the following instructions on a server in your home or office lab. Start by attaching two disks to your server. To attach a disk in Azure:

  • Log in to the Azure management portal and click VIRTUAL MACHINES in the menu on the left.
  • Under virtual machines on the right, click the VM you want to add a disk to.
  • Make sure DASHBOARD is selected at the top of the portal, click ATTACH in the grey bar at the bottom of the window, and then click Attach empty disk in the menu.
  • In the Attach an empty disk dialog box, enter the size for the new disk in GB, select NONE under HOST CACHE PREFERENCE and click OK.
  • Wait for the attach operation to complete and then repeat the process to attach a second disk of the same size.

Configure a Mirrored Volume

Now that we have two disks attached to the server, we can configure a mirrored volume using Storage Spaces. Log on to the server and open a PowerShell console with administrative privileges.

First we’ll scan the system for disks that are available for use in a storage pool, and write the array to the $PhysicalDisks variable. Disks available for use in a storage pool belong to what Windows Server calls the primordial storage pool by default. In principal, we could omit the get-storagesubsystem cmdlet here, as it’s likely that Storage Spaces will be the only storage subsystem present on your server.

Now we’ll create a new storage pool (StoragePool1) and add the available disks ($PhysicalDisks).
Windows Server Storage Spaces Mirrored Volume with PowerShell
Create a new storage pool using the available disks (Image Credit: Russell Smith)
Because everything in Storage Spaces is software defined, we need to create a virtual disk. The disks I attached to the server are 50GB each in size, but thin provisioning allows me to specify a larger capacity, and add extra disk space later as needed.
Create a new virtual disk and volume (Image Credit: Russell Smith)
Create a new virtual disk and volume (Image Credit: Russell Smith)
The new-virtualdisk cmdlet creates a mirrored pair by default. To create a simple volume with no fault tolerance, add –ResiliencySettingName Simple to the above command. Finally, initialize the disk, create a new volume and format it.

Related Topics:


Don't have a login but want to join the conversation? Sign up for a Petri Account

Comments (0)

Leave a Reply

IT consultant, Contributing Editor @PetriFeed, and trainer @Pluralsight. All about Microsoft, Office 365, Azure, and Windows Server.
Live Webinar: Active Directory Security: What Needs Immediate Priority!Live on Tuesday, October 12th at 1 PM ET

Attacks on Active Directory are at an all-time high. Companies that are not taking heed are being punished, both monetarily and with loss of production.

In this webinar, you will learn:

  • How to prioritize vulnerability management
  • What attackers are leveraging to breach organizations
  • Where Active Directory security needs immediate attention
  • Overall strategy to secure your environment and keep it secured

Sponsored by: