GEM Automation Feature – Run-DiskSpd

With the recent release of GEM Automation, I thought I would go through some of the latest additions. The first one is the inclusion of Run-DiskSpd in InfrastructureTesting\libStorageTesting.psm1.

Run-DiskSpd aims to make it easier to go through various IO tests using Microsoft’s favorite and latest IO generating tool, Diskspd.

Let’s go first through some of the Run-DiskSpd function features:

  • Pre-configured test suites
    • Stored in an XML config file called DiskSpd_TestCases.config
    • Provides pre-built test suites for various workloads. Currently the following are included:
      • SQL Server
        • Generic SQL Server workload
        • Resource Governor IOPS sizing
      • Exchange
      • General Purpose File Server
      • Quick
        • Small number of IO tests pattern
      • Exhaustive
        • Wide range of tests performed, this takes a long time to run due to the large number of tests
    • The goal is to add test cases for other workloads based on community feedback
    • The test case configuration includes other settings but they are used by Test-VirtualDiskPerformance in libStorageSpacesTesting.psm1
  • Dynamic IO warmup before tests (Run-DiskSpdVolumeWarmup)
    • As suggested by Dan Lovinger, the test data file needs to be warmed up before running IO tests to ensure media stability. This is done as follow:
      • A first run is done to estimate the volume sequential throughput rate
      • Once the rate has been determined, the function calculates how long diskspd needs to run to perform a pass of large sequential IO on the test file based on its size.
      • Two passes are used to warm up the test data file
  • The function will then generate and run the following diskspd tests based on the test case configuration
    • Variations in IO block size
    • Variations in outstanding IO counts
    • Variations in threads per file counts
    • Random/Sequential
    • Read/Write
  • Once the tests have been run, Parse-DiskSpdXmlOut is run to extract the info from the XML report output of diskspd to convert it to a PSObject
  • Additional information can be persisted along test results
    • For Storage Spaces
      • Disk resiliency type
      • Interleave size
      • Number of columns
      • Number of physical disks
      • Physical disk type
    • For file systems
      • File system name (i.e. NTFS or ReFS)
      • File system allocation unit size
  • The results of the test case are then written to the standard output which you can then pipe to a csv file

Here’s an example of how you would use Run-DiskSpd to perform test cases pertinent to SQL Server (I used ridiculously small values for this particular test on purpose):

Run-DiskSpd -testFileSizeInMB 100 -testDirectoryPath c:\temp -testDurationInSeconds 5 -testDescription "SQL Server test on local SSD" -testCaseName "SQLServerVM" | Export-Csv -NoTypeInformation .\diskspd_output.csv -Force

While the tests are executed, you can easily see the overall progress and the actual test being performed:


Once the tests have run and the results are saved in the CSV file, you can then use Storage Testing Analysis.xlsx to analyze the results of the tests. Here’s what it looks like at this point in time:


As you can see in the above screenshots, you can use the Excel slicers to filter out which test case you are after when you are reviewing the results.

While Run-DiskSpd is very much a work in progress, I hope it can already be useful to the community! I use this function to qualify new storage and baseline IO throughput. I also wrote a couple of additional function that leverages this (Test-VirtualDiskPerformance and Set-SQLResourcePoolIOPS) which will be topics of future posts.

If you have feedback on how it can be improved, I invite you to comment this post or submit items directly here in Codeplex. For those who are more inclined to use GUIs (that’s quite alright if you do), I invite you to check out DiskSpeed from my MVP peer Darryl van der Peijl that also helps running diskspd.

One thought on “GEM Automation Feature – Run-DiskSpd

  1. Pingback: GEM Automation Feature – Test-VirtualDiskPerformance | Mathieu Isabel's Weblog

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s