Skip to main content
Pure Technical Services

Validate Windows Server with Test-WindowsBestPractices Cmdlet

Currently viewing public documentation. Please login to access the full scope of documentation.

Overview

When deploying a new Pure Storage FlashArray it is important to make sure that Microsoft Windows Server is configured properly and set to the recommended best practice settings for Multipath-IO, TRIM/UNMAP support, and checking that Offloaded Data Transfer (ODX) is enabled. In order to make this easy a Windows PowerShell cmdlet, Test-WindowsBestPractices, was introduced in the Pure Storage PowerShell Toolkit

The PowerShell Toolkit is open source and can be pulled or forked on GitHub

Windows Server Version Support

The Test-WindowsBestPractices PowerShell cmdlet only works with Microsoft Windows Server 2012, 2012 R2, 2016, 2019, and 2022. It can also be used on Windows Server Core. The reason that the cmdlet is only supported under the latest versions of Windows Server is because of the various core PowerShell cmdlets that are used and only supported on the aforementioned versions of Windows Server. 

How to Install to Toolkit

Open up an elevated Windows PowerShell session and enter the below commands.

An Untrusted Repository warning will display if the PowerShell Gallery (PSGallery) has not been added as a trusted repository. To check this information use the below cmdlets.

PS C:\> Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
PS C:\> Get-PSRepository

Name                      InstallationPolicy   SourceLocation
----                      ------------------   --------------
PSGallery                 Trusted              https://www.powershellgallery.com/api/v2/

PS C:\> Install-Module -Name PureStoragePowerShellToolkit

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its
InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from
'PSGallery'?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): Y
PS C:\> Get-Module -ListAvailable *Toolkit*

    Directory: C:\Program Files\WindowsPowerShell\Modules
    
ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     3.0.1      PureStoragePowerShellToolkit        {New-FlashArrayCapacityReport, Test-WindowsBestPractices, ...

PS C:\> Get-Command Test-WindowsBestPractices

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Function        Test-WindowsBestPractices                          3.0.1      PureStoragePowerShellToolkit

How to Use Test-WindowsBestPractices

Using the Test-WindowsBestPractices cmdlet is very easy. Open a Windows PowerShell session and type the name of the cmdlet and hit enter. This is an example of the output (it may not reflect updated output after a toolkit revision).

============================================================
Pure Storage Windows Server Best Practice Analyzer
============================================================
==============================
Host Information
==============================
ChassisSerialNumber       : FCH1834J5CP
CollectedDateTime         : 10/26/2017 8:14:14 AM
Model                     : UCSB-B200-M3
Name                      : SERVER01
NumberOfCores             : 20
NumberOfLogicalProcessors : 40
NumberOfProcessors        : 2
OSName                    : Microsoft Windows Server 2016 Datacenter
OSSku                     : 8
OSSuite                   : 400
OSSuiteMask               : 400
OSVersion                 : 10.0.14393
ProcessorFamily           : 179
ProcessorManufacturer     : GenuineIntel
ProcessorName             : Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz
SystemManufacturer        : Cisco Systems Inc

==============================
Multipath-IO Verification
==============================
PASS: Multipath-IO is installed.

==============================
MPIO Setting Verification
==============================
Current MPIO Configuration

PathVerificationState     : Disabled
PathVerificationPeriod    : 30
PDORemovePeriod           : 30
RetryCount                : 3
RetryInterval             : 1
UseCustomPathRecoveryTime : Enabled
CustomPathRecoveryTime    : 20
DiskTimeoutValue          : 60

PASS: Microsoft Device Specific Module (MSDSM) is configured for Pure Storage FlashArray.
PASS: MPIO PDORemovePeriod passes Windows Server Best Practice check.
PASS: MPIO UseCustomPathRecoveryTime passes Windows Server Best Practice check.
PASS: MPIO CustomPathRecoveryTime passes Windows Server Best Practice check.
PASS: MPIO DiskTimeoutValue passes Windows Server Best Practice check.

==============================
TRIM/UNMAP Verification
==============================
PASS: Delete Notification Enabled
PS C:\>

How to Read the Output

There are several sections of output that the cmdlet generates. 

  • Host Information -- Provides details on the current host being verified for best practices.
  • Multipath-IO Verification -- Checks that Multipath-IO has been installed on the host.
  • MPIO Setting Verification -- Checks and displays the current settings on the host for MPIO and then verifies those settings meet Pure Storage best practices.
  • TRIM/UNMAP Verification -- Checks that Delete Notification is enabled. 

Using the -Repair parameter

When running the cmdlet without the -Repair parameter, the cmdlet will act in read-only mode and not make any alterations to the settings provided. You must use the cmdlet as follows to have it automatically adjust any settings that are presented with an alternate setting:

Test-WindowsBestPractices -Repair

Feedback

If you have feedback on the Test-WindowsBestPractices cmdlet please visit the Toolkit GitHub repository and create a new Issue. The issues are reviewed and will be considered for future releases of the cmdlet and toolkit.