Compare Windows 2008 R2 to Windows 2012 Storage Cmdlets

Windows Server 2012 and 2012 R2 introduced a new set of storage cmdlets that provided  specific support for disk management, multipath I/O configuration, MSDSM settings and more. These new cmdlets allowed for much simpler scripting which was a great advantage, but at the same time caused some headaches with customers that were running older versions of Windows Server such as 2008 or 2008 R2. The issue was that these new cmdlets were not available in the older versions of Windows Server which meant this took writing script that used Get-WmiObject (aka gwmi) with specific classes such as Win32_LogicalDisk, Win32_DiskDrive or Win32_DiskPartition.

Most (if not all) customers running Microsoft Windows Server run multiple versions which means everyone faces this problem of supporting either one common approach using Get-WmiObject or two sets of scripts using the old and new cmdlets. Some times supporting the two different approaches can be a daunting task so I wanted to put together the command specifics that supports Windows Server 2008 R2 and Windows Server 2012/2012 R2.

The following sections describe the settings that we recommend to our customers when configuring Windows Server. This includes configuring MPIO HW values, formatting volumes, initializing volumes (aka disks) and other tasks. I have mapped out the differences in cmdlets and command line tools between Windows Server 2008 R2 and Windows Server 2012/2012 R2 so that everyone can benefit from understanding the specific commands.

Get Logical Disk & Partition Information

Windows Server 2008 R2 SP1

Windows Server 2012 or 2012 R2

Get Installed Windows Hotfixes

Windows Server 2008 R2 SP1

Windows Server 2012 or 2012 R2

Install MultiPath I/O (MPIO)

Windows Server 2008 R2 SP1

Windows Server 2012 or 2012 R2

Configure New MPIO Device

Windows Server 2008 R2 SP1

Note: Format is important including spaces, Vendor=PURE + 4 spaces, ProductId= FlashArray + 6 spaces

Windows Server 2012 or 2012 R2

Note: No need for the spaces.

Windows Disk Management

View Pure Storage FlashArray Volumes Only

Windows Server 2008 R2 SP1

Windows Server 2012 or 2012 R2

Rescan for new volumes

Windows Server 2008 R2 SP1 & Windows Server 2012/2012 R2

Initialize Newly Added Pure Storage Volumes

Windows Server 2008 R2 SP1

Windows Server 2012 or 2012 R2

Create New Partition, Set Mount Point and Format Volume

Windows Server 2008 R2 SP1

Windows Server 2012 or 2012 R2

 Set SAN Policy

Windows Server 2008 R2 SP1

Windows Server 2012 or 2012 R2

Note: When using Windows Server Failover Clustering be sure to keep the default setting of OfflineShared.

Configure MPIO Policies

Display Current MPIO Policies

Windows Server 2008 R2 SP1

Windows Server 2012 or 2012 R2

Get & Set Recommended MPIO Policy Settings

Windows Server 2008 R2 SP1

Windows Server 2012 or 2012 R2

 

References

 

It is easy to see that the Windows Server 2012/2012 R2 approach is much simpler and less prone to scripting snafus.

Thanks,
barkz