DiskSpd Storage Performance Tool

repository·master·Indexed 23 days ago

https://github.com/microsoft/diskspd

A storage performance tool developed by Microsoft for Windows, Windows Server, and Cloud Server Infrastructure. It measures storage performance through various IO patterns and includes the VM Fleet framework, a PowerShell module designed for exploring storage capabilities in Windows Server Hyper-Converged environments with Storage Spaces Direct.

Tokens
3.3K
Snippets
7
Records
17
Agent score
30%

What's inside DiskSpd

  1. Verify VMFleet module installation

    master

    Before proceeding with deployment, verify that the VMFleet module is correctly installed and identify its available commands using PowerShell:

    1. Confirm the module exists: Get-Module VMFleet
    2. List all commands included in the module: Get-Command -Module VMFleet
    3. Set up the directory structure for the collection CSV: Install-Fleet
  2. Prepare HCI Cluster for VMFleet

    master

    Before deploying VMFleet, ensure your HCI cluster is configured with one Cluster Shared Volume (CSV) per node to balance storage load. You must also create a dedicated 'collect' volume for VMFleet directories and tools.

    Steps:

    1. Create a CSV per node using Get-ClusterNode.
    2. Create a 'collect' volume (e.g., 200GB) using New-Volume.
    3. Ensure any previous VMFleet directories are completely removed from existing volumes to avoid conflicts.
    # Create a CSV per node
    Get-ClusterNode |% {
        New-Volume -StoragePoolFriendlyName SU1_Pool* -FriendlyName $_ -FileSystem CSVFS_ReFS -Size <DESIRED SIZE>
    }
    
    # Create the 'collect' volume
    New-Volume -StoragePoolFriendlyName SU1_Pool* -FriendlyName collect -FileSystem CSVFS_ReFS -Size 200GB
  3. Run and Manage VMFleet Sweeps

    master

    Once the fleet is deployed, follow these steps to execute a test sweep:

    1. Monitor and Start: Open two PowerShell terminals. In the first, run Watch-Cluster. In the second, run Start-Fleet (this puts all VMs in a 'paused' state).
    2. Execute Sweep: Run Start-FleetSweep with your desired DiskSpd parameters.
      • Example: Start-FleetSweep -b 4 -t 8 -o 8 -w 0 -d 300 -p r
    3. Cleanup:
      • Use Stop-Fleet to shut down all virtual machines.
      • Use Remove-Fleet to completely delete all virtual machines from the environment.
  4. Use VM Fleet for Storage Performance Characterization

    master

    VM Fleet is a performance characterization and analyst framework designed for exploring the storage capabilities of Windows Server Hyper-Converged environments with Storage Spaces Direct. It is available as a PowerShell module.

    Key VM Fleet Commands/Functions:

    • Set-FleetRunProfileScript: Produces a free-run script based on one of the defined workload profiles.
    • Watch-FleetCPU: Monitors guest VCPU utilization (use the -Guest parameter; handles data outages).
    • Set-FleetPause: Pauses the fleet (waits for VM responses before completion by default; use -Timeout to configure).
  5. Prepare the Server Core VHDX Base Image

    master

    VMFleet requires a Windows Server Core VHDX file to create the fleet of VMs.

    Workflow:

    1. Download a Windows Server Core ISO.
    2. Create a new Virtual Machine in Hyper-V Manager using the ISO.
    3. During setup, define an administrator password (adminpass); you will need this for the New-Fleet command.
    4. Locate the resulting VHDX file in the 'Virtual Hard Disks' folder.
    5. Rename the file to Base1.vhdx.
    6. Move Base1.vhdx to the cluster environment, specifically into the collect folder created during cluster preparation.
  6. Download and Install DiskSpd

    master

    DiskSpd is a storage performance tool for Windows. You can download pre-compiled binaries (ZIP) and source code from the official GitHub releases page.

    To quickly download the latest version of DiskSpd, use the following URL: https://github.com/Microsoft/diskspd/releases/latest/download/DiskSpd.zip (or the alias https://aka.ms/getdiskspd).

    https://aka.ms/getdiskspd
  7. Install and Initialize the VMFleet PowerShell Module

    master

    To use VMFleet, install the module from the PowerShell Gallery, import it, and disable the Storage Spaces Direct cache, as it is not currently supported for Arc-enabled VMs.

    Commands:

    Install-Module -Name "VMFleet"
    Import-Module VMFleet
    Set-ClusterStorageSpacesDirect -CacheState Disabled;

    Sanity Checks:

    • Use Get-Module VMFleet to verify installation.
    • Use Get-Command -Module VMFleet to list available functions.
    • Run Install-Fleet to set up the directory structure within your 'collect' CSV. This creates:
      • Collect/control: Contains arc.json (Arc config) and monitoring scripts.
      • Control.ps1: The control loop script used by VMs.
      • Run.ps1: The script VMs execute for parameter updates.
      • Collect/flag: Directory for 'go', 'pause', and 'done' flag files.
      • Collect/result: Directory for VMFleet test run output files.
      • Collect/tools: Contains preinstalled DiskSpd.
    Install-Module -Name "VMFleet"
    Import-Module VMFleet
    Set-ClusterStorageSpacesDirect -CacheState Disabled;
    
    # Initialize directory structure
    Install-Fleet
  8. Install prerequisite modules for FleetCoreWorkload

    master

    The Measure-FleetCoreWorkload command requires specific NuGet packages and modules for diagnostic data collection (Get-SDDCDiagnosticInfo).

    Warning: The following script temporarily sets the PSGallery repository to Trusted to allow installation, which relaxes the security boundary. It attempts to restore the original installation policy after completion.

    $repo = Get-PSRepository -Name PSGallery
    if ($null -eq $repo) { Write-Host "The PSGallery is not configured on this system, please address this before continuing" }
    else {
        if ($repo.InstallationPolicy -ne 'Trusted') {
            Write-Host "Setting the PSGallery repository to Trusted, original InstallationPolicy: $($repo.InstallationPolicy)"
            Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
        } 
    
        ### Installing the pre-requisite modules
    
        Install-PackageProvider NuGet -Force
        Install-Module -Name PrivateCloud.DiagnosticInfo -Force
        Install-Module -Name MSFT.Network.Diag -Force
    
        if ($repo.InstallationPolicy -ne 'Trusted') {
            Write-Host "Resetting the PSGallery repository to $($repo.InstallationPolicy)"
            Set-PSRepository -Name PSGallery -InstallationPolicy $repo.InstallationPolicy
        } 
    }
  9. Run Measure-FleetCoreWorkload

    master

    Execute Measure-FleetCoreWorkload to automatically run four workloads: General, Peak, VDI, and SQL. The individual outputs are placed in the result directory.

    Important Notes:

    • Cleanup: If you plan to run another test, you must clear the result directory first.
    • Resiliency: If an error occurs, you can rerun the command. It is designed to pick up from where it last stopped and continue the test without starting from scratch.
    Measure-FleetCoreWorkload
  10. Configure Arc-enabled VM Settings with Set-ArcConfig

    master

    Use Set-ArcConfig to configure the requirements for creating Arc-enabled Virtual Machines. This command handles resource group creation and stores configuration in arc.json.

    Parameters:

    • -ResourceGroup: The resource group where Arc VMs will be deployed.
    • -AzureRegistrationUser: Azure account credentials.
    • -AzureRegistrationPassword: Azure account credentials.
    • -StoragePathCsv (optional): Path to the CSV where the storage path resource will be created. Defaults to an existing CSV if omitted.
    • -StoragePathName (optional): Name used to create the gallery image. Defaults if omitted.
    • -ImageName (optional): Name of the gallery image (currently only Windows gallery images are supported). Defaults if omitted.
    • -Enabled: Set to $true to enable Arc-enabled VM creation (defaults to $false).
    • -ResetSalt: Resets the 4-character alphanumeric salt used in Arc resource names. Useful for regenerating names if multiple clusters share a subscription/resource group.
  11. Configure Arc-enabled Virtual Machines with Set-ArcConfig

    master

    Use Set-ArcConfig to set up the configuration required for creating Arc-enabled Virtual Machines. This command manages resource groups, Azure credentials, and storage paths.

    Parameters:

    • -ResourceGroup: The resource group where ARC VMs will be deployed.
    • -AzureRegistrationUser: Azure account credentials (username).
    • -AzureRegistrationPassword: Azure account credentials (password).
    • -StoragePathCsv (optional): Path to the CSV where storage path resources will be created. If omitted, an existing CSV created earlier is used by default.
    • -StoragePathName (optional): Name used to create the gallery image. Defaults to a standard name if omitted.
    • -ImageName (optional): Gallery image name used to create Arc-enabled VMs. Defaults to a standard name if omitted.
    • -Enabled (optional): Set to $true to enable the creation of Arc-enabled virtual machines. Defaults to $false.
    • -ResetSalt (optional): Regenerates the 4-character alphanumeric salt used in Arc resource names (e.g., vm-group-node-salt-001). This is useful for preventing name collisions when running multiple clusters under the same subscription and resource group. Running this overrides the existing salt in arc.json.
  12. Estimate CSV Size with Get-FleetVolumeEstimate

    master

    When setting up the VMFleet workflow for predefined profile workloads (General, Peak, VDI, SQL), use Get-FleetVolumeEstimate to determine the required CSV size based on different resiliency types.

    It is recommended to select a 2-way mirrored or 3-way mirrored value depending on your node count to ensure precision in storage allocation.