### Test random 4KiB I/O to a 2GiB range starting at 1GiB offset Source: https://github.com/microsoft/diskspd/wiki/Customizing-tests Tests random I/O operations within a specified range. This example uses a 4KiB block size and targets a 2GiB range starting at a 1GiB offset. ```bash diskspd -b4K -B1G:2G -r #1 ``` -------------------------------- ### Install Diagnostic Modules and Configure PSGallery Source: https://github.com/microsoft/diskspd/blob/master/Frameworks/VMFleet/ArcVM-Setup.md Installs prerequisite diagnostic modules for workload measurement and temporarily sets the PowerShell Gallery repository to 'Trusted'. It checks if the PSGallery is configured and resets the installation policy afterward. ```powershell $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 } } ``` -------------------------------- ### Start DiskSpd Light ETW Trace Source: https://github.com/microsoft/diskspd/wiki/Customizing-tests Use Windows Performance Recorder (WPR) to start capturing light-detail ETW events from DiskSpd. Ensure the diskspd.wprp profile is available. ```bash wpr -start diskspd.wprp!DiskSpd.Light ``` -------------------------------- ### Mix Random and Sequential Workloads Source: https://github.com/microsoft/diskspd/wiki/Sample-command-lines Use this command to mix random and sequential I/O workloads. This example specifies 20% random I/O and 80% sequential I/O. ```bash diskspd -c1G -b4K -o32 -t1 -r8b -w50 -rs20 -d60 -Sh testfile.dat ``` -------------------------------- ### Create Test Files with DiskSpd Source: https://github.com/microsoft/diskspd/wiki/Customizing-tests Use the -c parameter to create test files of a specified size. This example creates two 100 MiB files and runs a 20-second read test. ```bash diskspd -c100M -d20 c:\test1 d:\test2 ``` -------------------------------- ### Install Prerequisite Modules for Measure-FleetCoreWorkload Source: https://github.com/microsoft/diskspd/wiki/VMFleet Installs necessary NuGet packages and PowerShell modules, including PrivateCloud.DiagnosticInfo and MSFT.Network.Diag. This process temporarily sets the PSGallery as a trusted repository. ```powershell $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 -AllowClobber -SkipPublisherCheck 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 } } ``` -------------------------------- ### DiskSpd Synchronization: Signal Start Event Source: https://github.com/microsoft/diskspd/wiki/Customizing-tests Use the '-ye' parameter to signal a named event ('MyStartEvent') that DiskSpd is waiting on, allowing the test to proceed. Multiple '-ye' parameters can be used. ```bash diskspd -c512m -d30 -o8 -w10 -t4 -b4k -D -L -yeMyStartEvent mytest.dat ``` -------------------------------- ### DiskSpd Synchronization: Wait for Start Event Source: https://github.com/microsoft/diskspd/wiki/Customizing-tests Configure DiskSpd to wait for a named event ('MyStartEvent') to be set before initiating the warm-up and test phases. This allows external synchronization. ```bash diskspd -c512m -d30 -o8 -w10 -t4 -b4k -D -L -s -yrMyStartEvent mytest.dat ``` -------------------------------- ### Start Fleet VMs and Sweep Source: https://github.com/microsoft/diskspd/blob/master/Frameworks/VMFleet/ArcVM-Setup.md Initiate all VMs in the fleet to a paused state using Start-Fleet. Subsequently, you can run Start-FleetSweep with specified parameters to perform operations on the running VMs. ```PowerShell Start-Fleet ``` ```PowerShell Start-FleetSweep -b 4 -t 8 -o 8 -w 0 -d 300 -p r ``` -------------------------------- ### Run 10-second test on drive 1 with 8KiB block size, skipping first 10 blocks Source: https://github.com/microsoft/diskspd/wiki/Customizing-tests Specifies a base offset and length for I/O operations. This example tests physical drive 1 with an 8KiB block size, skipping the first 10 blocks (80KiB). ```bash diskspd -b8K -B10b #1 ``` -------------------------------- ### Start Run with Stored XML Profile Source: https://github.com/microsoft/diskspd/wiki/VMFleet-examples Starts a VMFleet run using an XML profile that has been previously created and stored in a variable. ```powershell Start-FleetResultRun -ProfileXml $profile ``` -------------------------------- ### Install VMFleet PowerShell Module Source: https://github.com/microsoft/diskspd/wiki/VMFleet Installs the VMFleet PowerShell module from the PowerShell Gallery. Ensure you have the module available before proceeding. ```powershell Install-Module -Name "VMFleet" Import-Module VMFleet ``` -------------------------------- ### Sequential I/O Offset Calculation (Pseudo-code) Source: https://github.com/microsoft/diskspd/wiki/Threading-and-concurrency Illustrates the default sequential I/O offset calculation where the next operation is based on the last started I/O. Used when -p is not specified. ```pseudo-code UINT64 GetNextOffset() { lastFileOffset += stride; return lastFileOffset; } ``` -------------------------------- ### Install-Fleet Source: https://github.com/microsoft/diskspd/wiki/VMFleet A one-time function to install VMFleet tools and create the control directory structure. ```APIDOC ## Install-Fleet ### Description A one-time function to install the VMFleet tools and create the control directory structure. ### Command Install-Fleet ``` -------------------------------- ### Install and Import VMFleet Module Source: https://github.com/microsoft/diskspd/blob/master/Frameworks/VMFleet/ArcVM-Setup.md Installs the VMFleet PowerShell module from the gallery and loads it into the current terminal session. Also disables the cache state for Cluster Storage Spaces Direct. ```powershell Install-Module -Name "VMFleet" Import-Module VMFleet Set-ClusterStorageSpacesDirect -CacheState Disabled; ``` -------------------------------- ### Start DiskSpd Verbose ETW Trace Source: https://github.com/microsoft/diskspd/wiki/Customizing-tests Use Windows Performance Recorder (WPR) to start capturing verbose ETW events from DiskSpd for more detailed performance analysis. Ensure the diskspd.wprp profile is available. ```bash wpr -start diskspd.wprp!DiskSpd.Verbose ``` -------------------------------- ### Specify I/O Distribution by Percentage of Target (Random) Source: https://github.com/microsoft/diskspd/wiki/Sample-command-lines Use this command with -rdpct to specify the percentage of I/O directed to specific portions of the target file. This example directs 90% of I/O to the first 10% of the target. ```bash diskspd -c1G -b4K -r -o32 -w0 -d60 -Sh -rdpct90/10:0/10:5/20 testfile.dat ``` -------------------------------- ### Install and Load VMFleet Module, Disable Cache Source: https://github.com/microsoft/diskspd/blob/master/Frameworks/VMFleet/ArcVM-Setup.md Installs the VMFleet PowerShell module from the gallery, imports it into the current session, and disables caching for ArcVMs. ```powershell Install-Module -Name "VMFleet" Import-Module VMFleet Set-ClusterStorageSpacesDirect -CacheState Disabled; ``` -------------------------------- ### DiskSpd: Per-Target Threads Example Source: https://github.com/microsoft/diskspd/wiki/Threading-and-concurrency Creates sets of threads, with each set accessing a specific target. This results in a higher total number of threads compared to the fixed threads model for the same number of targets. ```bash diskspd -t2 -o2 file1 file2 file3 file4 file5 ``` -------------------------------- ### Configure VM Hardware Settings Source: https://github.com/microsoft/diskspd/blob/master/Frameworks/VMFleet/ArcVM-Setup.md Modify the hardware configuration for VMs in the fleet using Set-Fleet. This example sets processor count to 1 and static memory settings. Note that specifying MemoryMaximumBytes requires MemoryMinimumBytes, indicating dynamic memory; omitting them implies static memory. ```PowerShell Set-Fleet -ProcessorCount 1 -MemoryStartupBytes 2048mb -MemoryMaximumBytes 2048mb -MemoryMinimumBytes 2048mb ``` -------------------------------- ### DiskSpd Command for ETW Disk I/O and Registry Events Source: https://github.com/microsoft/diskspd/wiki/Customizing-tests An example command to enable DiskSpd to collect trace data for physical disk I/O and registry events using the -e parameter. ```bash diskspd -eDISK_IO -eREGISTRY testfile.dat ``` -------------------------------- ### DiskSpd Synchronization: Signal Test Started Event Source: https://github.com/microsoft/diskspd/wiki/Customizing-tests Configure DiskSpd to signal a named event ('MyTestStartedEvent') immediately before the measurement phase begins. This is useful for coordinating external monitoring. ```bash diskspd -c512m -d30 -o8 -w10 -t4 -b4k -D -L -ysMyTestStartedEvent mytest.dat ``` -------------------------------- ### DiskSpd: Fixed Threads Example Source: https://github.com/microsoft/diskspd/wiki/Threading-and-concurrency Uses a fixed number of threads to access multiple targets. Each thread accesses all targets with a specified number of outstanding operations per target. ```bash diskspd -F2 -o2 file1 file2 file3 file4 file5 ``` -------------------------------- ### Specify I/O Distribution by Absolute Size (Random) Source: https://github.com/microsoft/diskspd/wiki/Sample-command-lines Use this command with -rdabs to specify the absolute size of I/O directed to specific portions of the target file. This example directs 90% of I/O to the first 10GiB of the target. ```bash diskspd -c1G -b4K -r -o32 -t1 -w0 -d60 -Sh -rdabs90/10G:0/10G:5/20G testfile.dat ``` -------------------------------- ### Limit IOPS per Thread Source: https://github.com/microsoft/diskspd/wiki/Sample-command-lines Use this command with the -g option to limit the IOPS (Input/Output Operations Per Second) to a specific value per thread. This example limits IOPS to 1000 per thread. ```bash diskspd -c1G -b4K -o32 -t1 -w50 -g1000i -d60 -Sh testfile.dat ``` -------------------------------- ### Interleaved Access Pattern with Thread Stride Source: https://github.com/microsoft/diskspd/wiki/Threading-and-concurrency Use `-T` to specify the offset between threads for sequential I/O. This example creates an interleaved pattern where threads access blocks sequentially but offset from each other. ```bash diskspd -t3 -T4k -b4k -s12k C:\\testfile ``` ```bash diskspd -t3 -T1b -b4K -s3b c:\\testfile ``` -------------------------------- ### Start-Fleet Source: https://github.com/microsoft/diskspd/wiki/VMFleet Launches all VMs currently on the host nodes that are in an OFF state, shifting their state from offline to online. ```APIDOC ## Start-Fleet ### Description Launch all the VMs currently on the host nodes in OFF state. Specifically, this shifts the VM state from offline to online. ### Command Start-Fleet ``` -------------------------------- ### Create Text Profile Source: https://github.com/microsoft/diskspd/wiki/Sample-command-lines Use this command to create a text-based profile from a set of parameters. The output is redirected to 'profile.txt'. ```bash diskspd -t1 -o4 -b4k -r4k -w0 -Sh -D -d60 -L -c1G -Rptext > profile.txt ``` -------------------------------- ### DiskSpd Command Line with XML Profile Source: https://github.com/microsoft/diskspd/wiki/XML-profiles This command initiates a DiskSpd test using an XML profile named 'prof.xml'. Command-line targets 'first.bin' and 'second.bin' will replace template targets '*1' and '*2' respectively within the profile. All time spans in the profile will be configured for 60 seconds of measurement. ```bash diskspd -d60 -Xprof.xml first.bin second.bin ``` -------------------------------- ### Get Result Log Contents Source: https://github.com/microsoft/diskspd/wiki/VMFleet-examples Retrieves the contents of the result log file, mapping the RunLabel to test run characteristics like workload type. ```powershell Get-FleetResultLog ".\result-log.tsv" -KeyColumn @{ FleetVMPercent = 25 } ``` -------------------------------- ### Create Collect Volume Source: https://github.com/microsoft/diskspd/wiki/VMFleet Creates a 'Collect' volume on Storage Spaces Direct. This volume is used for VMFleet operations. Ensure your Storage Pool name starts with 'S2D*'. ```powershell New-Volume -StoragePoolFriendlyName S2D* -FriendlyName "Collect" -FileSystem CSVFS_ReFS -Size 200GB ``` -------------------------------- ### Start-FleetSweep Source: https://github.com/microsoft/diskspd/wiki/VMFleet Runs a VMFleet Sweep using DiskSpd parameters. Executes all matrix combinations if multiple values are provided for a single flag (comma-separated). ```APIDOC ## Start-FleetSweep ### Description Run VMFleet Sweep that uses DiskSpd parameters. All matrix combinations of parameter values are executed if providing multiple values for a single flag (separated by commas). ### Command Start-FleetSweep ``` -------------------------------- ### Set up VMFleet Directory Structure Source: https://github.com/microsoft/diskspd/wiki/VMFleet Initializes the VMFleet directory structure within the Collect CSV. This includes Control, Flag, Result, and Tools folders. DiskSpd.exe is pre-installed in the Tools folder. ```powershell Install-Fleet ``` -------------------------------- ### Start-FleetReadCacheWarmup Source: https://github.com/microsoft/diskspd/wiki/VMFleet Runs a read cache warmup, intended for HDD capacity devices with read cache enabled. ```APIDOC ## Start-FleetReadCacheWarmup ### Description Run a read cache warmup. This is meant for HDD capacity devices with read cache enabled. ### Command Start-FleetReadCacheWarmup ``` -------------------------------- ### Load and Run XML Profile Source: https://github.com/microsoft/diskspd/wiki/VMFleet-examples Loads and executes a previously created XML profile using VMFleet. ```powershell Start-FleetRun -ProfilePath ".\profile.xml" ``` -------------------------------- ### Create a Fleet of Virtual Machines Source: https://github.com/microsoft/diskspd/blob/master/Frameworks/VMFleet/ArcVM-Setup.md Use New-Fleet to create a specified number of virtual machines. Ensure the base VHDX file is in the collect folder. Parameters include the path to the VHDX, the number of VMs, administrator password, and domain connection credentials. ```PowerShell New-Fleet -basevhd -vms [ENTER_NUM_VMS] -adminpass [ENTER_ADMINPASS] -connectuser [ENTER_NODE_USER] -connectpass [ENTER_NODE_PASS] ``` -------------------------------- ### Create XML Profile with Template Targets using DiskSpd Source: https://github.com/microsoft/diskspd/wiki/XML-profiles This command generates an XML profile file named 'profile.xml' using DiskSpd. It utilizes template targets '*1' and '*2', which can be substituted with actual target paths later. This is useful for creating reusable and portable XML profiles. ```bash diskspd -t1 -o4 -b4k -r4k -w0 -Sh -D -d60 -L -c1G -Rpxml *1 *2 > profile.xml ``` -------------------------------- ### Substitute Target Files from XML Profile Source: https://github.com/microsoft/diskspd/wiki/Sample-command-lines Use this command to substitute target files in a previously created XML profile. This allows running the profile with different data files. ```bash diskspd -Xprofile.xml file1.dat file2.dat ``` -------------------------------- ### Initialize Fleet Deployment Structure Source: https://github.com/microsoft/diskspd/blob/master/Frameworks/VMFleet/ArcVM-Setup.md Initializes the necessary directory structure for VMFleet on the 'Collect' CSV. This includes setting up directories for control files, flags, results, and tools. ```powershell Install-Fleet ``` -------------------------------- ### DiskSpd Asynchronous IO Thread Model with Completion Routines Source: https://github.com/microsoft/diskspd/wiki/Threading-and-concurrency Describes the thread model when using completion routines (-x). IO is reissued from the completion routine, and the thread's main work is issuing initial IO requests. ```pseudocode thread { SetThreadIdealProcessor AffinitizeThread port = CreateIOCompletionPort WaitForStartSignal work = [queue depth] while (work) workitem = dequeue(work) issueIO(workitem, completionRoutine) WaitForEndOfTest } completionRoutine(workitem) { updatestats(workitem) if (not end of test) issueIO(workitem, completionRoutine) } ``` -------------------------------- ### Test random 4KiB I/O using -B and -f parameters for range specification Source: https://github.com/microsoft/diskspd/wiki/Customizing-tests Demonstrates an alternative method to specify the I/O range using both base offset (-B) and maximum target offset (-f). This achieves the same result as specifying base and length. ```bash diskspd -b4k -B1G -f3G -r #1 ``` -------------------------------- ### Configure Arc VM Settings Source: https://github.com/microsoft/diskspd/blob/master/Frameworks/VMFleet/ArcVM-Setup.md Sets up the necessary configuration for creating Arc-enabled Virtual Machines. This includes specifying the resource group, Azure credentials, storage paths, and image names. The -ResetSalt flag can be used to regenerate the salt used in Arc resource names. ```powershell Set-ArcConfig -ResourceGroup [ENTER_RESOURCE_GROUP] -AzureRegistrationUser [ENTER_AZURE_REGUSER] -AzureRegistrationPassword [ENTER_AZURE_REGPASS]-StoragePathCsv [ENTER_CSV_PATH] -Enabled $true -StoragePathName [ENTER_StoragePath_Name] -ImageName [ENTER_Image_Name] -ResetSalt ``` -------------------------------- ### Start-FleetResultRun Source: https://github.com/microsoft/diskspd/wiki/VMFleet Runs VMFleet using an XML template profile in memory. ```APIDOC ## Start-FleetResultRun ### Description Run VMFleet using an XML template profile in memory. ### Command Start-FleetResultRun ``` -------------------------------- ### New-Fleet Source: https://github.com/microsoft/diskspd/wiki/VMFleet Creates per-node internal VM switches and deploys VMFleet virtual machines from a pre-created VHD master image. ```APIDOC ## New-Fleet ### Description Create the per-node internal VM switches and deploys the VMFleet virtual machines from a pre-created VHD master image. ### Command New-Fleet ``` -------------------------------- ### Start-FleetRun Source: https://github.com/microsoft/diskspd/wiki/VMFleet Runs VMFleet by providing an XML profile, an XML profile string, or the run.ps1 script. ```APIDOC ## Start-FleetRun ### Description Run VMFleet by providing an XML profile, an XML profile string, or the run.ps1 script. ### Command Start-FleetRun ``` -------------------------------- ### Parallel Sequential I/O Offset Calculation (Pseudo-code) Source: https://github.com/microsoft/diskspd/wiki/Threading-and-concurrency Shows the sequential I/O offset calculation when the -p parameter is used. The next operation is based on the most recently completed I/O. ```pseudo-code UINT64 GetNextOffset(struct IO *completedIO) { return completedIO->startOffset + stride; } ``` -------------------------------- ### Sample DiskSpd ETW Statistics Output Source: https://github.com/microsoft/diskspd/wiki/Customizing-tests Illustrates the typical output format for DiskSpd when Event Tracing for Windows (ETW) is enabled, showing Disk I/O and Registry event statistics. ```text ETW: ---- Disk I/O Read: 128 Write: 28 Registry NtCreateKey: 1 NtDeleteKey: 0 NtDeleteValueKey: 0 NtEnumerateKey: 0 NtEnumerateValueKey: 0 NtFlushKey: 0 NtOpenKey: 222 NtQueryKey: 118 NtQueryMultipleValueKey: 0 NtQueryValueKey: 229 NtSetInformationKey: 0 NtSetValueKey: 0 ETW Buffer Settings & Statistics -------------------------------------------------------- (KB) Buffers (Secs) (Mins) Size | Min | Max | Free | Written | Flush Age 138 4 26 7 225 0 15 Allocated Buffers: 7 Lost Events: 0 Lost Log Buffers: 0 Lost Real Time Buffers: 203 ``` -------------------------------- ### Configure Arc Settings for VM Deployment Source: https://github.com/microsoft/diskspd/blob/master/Frameworks/VMFleet/ArcVM-Setup.md Sets up the configuration for creating Arc-enabled virtual machines. This includes specifying the resource group, Azure credentials, storage paths, and image name. The '-ResetSalt' flag is used to reset the salt for the configuration. ```powershell Set-ArcConfig -ResourceGroup [ENTER_RESOURCE_GROUP] -AzureRegistrationUser [ENTER_AZURE_REGUSER] -AzureRegistrationPassword [ENTER_AZURE_REGPASS]-StoragePathCsv [ENTER_CSV_PATH] -Enabled $true -StoragePathName [ENTER_StoragePath_Name] -ImageName [ENTER_Image_Name] -ResetSalt ``` -------------------------------- ### Target Throughput with Multiple Targets Source: https://github.com/microsoft/diskspd/wiki/Threading-and-concurrency By adding a second file, this command doubles the total I/O target to 160,000 bytes/second. Consider adding threads or targets if rate limits aren't reached. ```bash diskspd -t1 -o1 -s8k -b8k -Sh -w100 -g80 c:\\test1 c:\\test2 ``` -------------------------------- ### Target Throughput with Multiple Threads and Targets Source: https://github.com/microsoft/diskspd/wiki/Threading-and-concurrency Adding a second thread doubles the total I/O target again. Effective use of rate limits may require experimentation with parameters like `-o` and `-t`. ```bash diskspd -t2 -o1 -s8k -b8k -Sh -w100 -g80 c:\\test1 c:\\test2 ``` -------------------------------- ### DiskSpd Buffer Allocation with Large Pages Source: https://github.com/microsoft/diskspd/wiki/Customizing-tests Demonstrates how DiskSpd allocates buffers when the -l parameter is used for large page support. This requires the SeLockMemoryPrivilege. ```csharp VirtualAlloc(…, MEM_COMMIT | MEM_RESERVE | MEM_LARGE_PAGES, PAGE_EXECUTE_READWRITE) ``` -------------------------------- ### Target Throughput with Single Target Source: https://github.com/microsoft/diskspd/wiki/Threading-and-concurrency This command targets 80 bytes per millisecond using 8KiB blocks on a single target file. Longer test times help converge on requested rate limits. ```bash diskspd -t1 -o1 -s8k -b8k -Sh -w100 -g80 c:\\test1 ``` -------------------------------- ### Run Core Workloads Source: https://github.com/microsoft/diskspd/wiki/VMFleet-examples Executes four pre-defined VMFleet workloads: General, Peak, VDI, and SQL. ```powershell Measure-FleetCoreWorkload ``` -------------------------------- ### Small Area Concurrent Writes Source: https://github.com/microsoft/diskspd/wiki/Sample-command-lines Use this command for small area concurrent writes of 4KB blocks. It configures a 100MB test file with 8 threads, 32 outstanding I/Os, 8 block sequential stride, and 100% write percentage. ```bash diskspd -c100b -w100 -b4K -o32 -F8 -T1b -s8b -W60 -d60 -Sh testfile.dat ``` -------------------------------- ### DiskSpd Default Asynchronous IO Thread Model Source: https://github.com/microsoft/diskspd/wiki/Threading-and-concurrency Illustrates the default thread behavior for asynchronous IO using completion ports. Threads issue IO requests and wait for completions via GetQueuedCompletionStatusEx. ```pseudocode thread { SetThreadIdealProcessor AffinitizeThread port = CreateIOCompletionPort WaitForStartSignal work = [queue depth] while (not end of test) { if (work not empty) workitem = dequeue(work) issueIO(workitem, port) if (not measuring latency and work not empty) loop if (measuring latency and work not empty) completions = waitN(port, 0ms) else completions = waitN(port, INFINITE) if (completions) updatestats(completions) insert(completions, work) } } ``` -------------------------------- ### Set-FleetQoS Source: https://github.com/microsoft/diskspd/wiki/VMFleet A wrapper for Set-VMHardDiskDrive that applies a predefined Storage QoS Policy to all VMs in the hyperconverged cluster. ```APIDOC ## Set-FleetQoS ### Description A wrapper for Set-VMHardDiskDrive, which takes a predefined Storage QoS Policy and applies it to all VMs within the hyperconverged cluster. ### Command Set-FleetQoS ``` -------------------------------- ### Get-FleetPath Source: https://github.com/microsoft/diskspd/wiki/VMFleet Outputs the path to the specified file. ```APIDOC ## Get-FleetPath ### Description Output the path to the indicated file. ### Command Get-FleetPath ``` -------------------------------- ### Generate Text Profile Description with DiskSpd Source: https://github.com/microsoft/diskspd/wiki/XML-profiles This command uses DiskSpd to generate a text-based description of a profile without executing a load test. It's useful for reviewing complex profile configurations before running them. ```bash diskspd -t1 -o4 -b4k -r4k -w0 -Sh -D -d60 -L -c1G -Rp ``` -------------------------------- ### Move-Fleet: Rotate VM, Realign CSV Source: https://github.com/microsoft/diskspd/wiki/VMFleet-examples Rotates virtual machines by a specified percentage while realigning cluster shared volumes. ```powershell Move-Fleet –DistributeVMPercent ``` -------------------------------- ### Display Disk I/O and Memory Statistics Source: https://github.com/microsoft/diskspd/wiki/Sample-command-lines Use this command to display statistics about physical disk I/O and memory events from the NT Kernel Logger. This command enables specific event tracing for disk I/O and page faults. ```bash diskspd -eDISK_IO -eMEMORY_PAGE_FAULTS testfile.dat ``` -------------------------------- ### DiskSpd Synchronous IO Thread Model Source: https://github.com/microsoft/diskspd/wiki/Threading-and-concurrency Shows the pseudo-code for single IO requests (-o1), where operations are executed synchronously in a loop without using asynchronous IO. ```pseudocode SetThreadIdealProcessor AffinitizeThread WaitForStartSignal while (not end of test) { status = issueIO(workitem) updatestats(workitem) } ``` -------------------------------- ### Move-Fleet: Rotate VM, Keep CSV Constant Source: https://github.com/microsoft/diskspd/wiki/VMFleet-examples Rotates virtual machines by a specified percentage and keeps cluster shared volumes in their current state. ```powershell Move-Fleet –DistributeVMPercent -KeepCSV ``` -------------------------------- ### Spatially Separated Sequential Streams Source: https://github.com/microsoft/diskspd/wiki/Threading-and-concurrency Configure multiple threads to access distinct, large intervals of a target file. Each thread initiates I/O at succeeding intervals, creating separate sequential streams. ```bash diskspd -c3G -t3 -T1G -b4K -s c:\\testfile ``` -------------------------------- ### Get-FleetDataDiskEstimate Source: https://github.com/microsoft/diskspd/wiki/VMFleet Calculates the data disk size per VM in bytes based on cache capacity and a provided percentage. Uses drive size if cache capacity is absent. Supports -CachePercent and -CapacityPercent. ```APIDOC ## Get-FleetDataDiskEstimate ### Description Calculate the size for a data disk per VM in bytes, based on your cache capacity and the provided integer percentage. If cache capacity does not exist, it uses the capacity drive size. The two types of possible percentages are -CachePercent and -CapacityPercent. ### Command Get-FleetDataDiskEstimate ``` -------------------------------- ### Estimate Data Disk Size Source: https://github.com/microsoft/diskspd/wiki/VMFleet-examples Calculates the required size for a virtual machine's data disk in bytes, based on cache and/or capacity size percentages. If both are used, the smaller value is output. ```powershell Get-FleetDataDiskEstimate -CachePercent 200 -CapacityPercent 30 -Verbose -VMs 40 ``` -------------------------------- ### Show-FleetVersion Source: https://github.com/microsoft/diskspd/wiki/VMFleet Checks the current DiskSpd and VMFleet version numbers. ```APIDOC ## Show-FleetVersion ### Description Check the current DiskSpd and VMFleet version number. ### Command Show-FleetVersion ``` -------------------------------- ### Show-Fleet Source: https://github.com/microsoft/diskspd/wiki/VMFleet Checks the operational state of VMs hosted throughout the cluster. ```APIDOC ## Show-Fleet ### Description Check the operational state of VMs hosted throughout the cluster. ### Command Show-Fleet ``` -------------------------------- ### Default DiskSpd Buffer Allocation Source: https://github.com/microsoft/diskspd/wiki/Customizing-tests Shows the default method DiskSpd uses for allocating buffers. This is the standard memory allocation without special flags. ```csharp VirtualAlloc(…, MEM_COMMIT, PAGE_READWRITE) ``` -------------------------------- ### Create CSV Volumes per Node Source: https://github.com/microsoft/diskspd/blob/master/Frameworks/VMFleet/ArcVM-Setup.md Creates a new volume for each cluster node, formatted as CSVFS_ReFS. Replace with the appropriate volume size. ```powershell Get-ClusterNode |% { New-Volume -StoragePoolFriendlyName SU1_Pool* -FriendlyName $_ -FileSystem CSVFS_ReFS -Size } ``` -------------------------------- ### Convert-FleetXmlToString Source: https://github.com/microsoft/diskspd/wiki/VMFleet Converts an XML profile created via "Get-FleetProfileXml" into a string displayed on the command line. Pipe the profile into this command. ```APIDOC ## Convert-FleetXmlToString ### Description Convert the XML profile you created via "Get-FleetProfileXml" into a string that is displayed on the command line. Simply pipe the profile into Convert-FleetXmlToString. ### Command Convert-FleetXmlToString ``` -------------------------------- ### Convert XML Profile to String Source: https://github.com/microsoft/diskspd/wiki/VMFleet-examples Converts an XML profile, created via 'Get-FleetProfileXml', into a string output. ```powershell Get-FleetProfileXml -Name "General" -WriteRatio 0 -BlockSize 8KB | Convert-FleetXmlToString ``` -------------------------------- ### Move VMs with Percentage Distribution Source: https://github.com/microsoft/diskspd/wiki/VMFleet-examples Distributes a specified percentage of VMs from a cluster, rotating a subset of them to be misaligned from their owner node. ```powershell Move-Fleet -Cluster "Cluster01" -DistributeVMPercent 30 -VMPercent 25 ``` -------------------------------- ### Create 'collect' Volume Source: https://github.com/microsoft/diskspd/blob/master/Frameworks/VMFleet/ArcVM-Setup.md Creates a dedicated 'collect' volume with a size of 200GB, formatted with CSVFS_ReFS. ```powershell New-Volume -StoragePoolFriendlyName SU1_Pool* -FriendlyName collect -FileSystem CSVFS_ReFS -Size 200GB ``` -------------------------------- ### Large Area Sequential Concurrent Writes Source: https://github.com/microsoft/diskspd/wiki/Sample-command-lines Use this command for large area sequential concurrent writes of 4KB blocks. It configures a 2GB test file with 8 threads, 32 outstanding I/Os, 8 block sequential stride, and 100% write percentage. ```bash diskspd -c2G -w100 -b4K -F8 -T1b -s8b -o32 -W60 -d60 -Sh testfile.dat ``` -------------------------------- ### Small Area Concurrent Reads Source: https://github.com/microsoft/diskspd/wiki/Sample-command-lines Use this command for small area concurrent reads of 4KB blocks. It configures a 100MB test file with 8 threads, 32 outstanding I/Os, and 8 block sequential stride. ```bash diskspd -c100b -b4K -o32 -F8 -T1b -s8b -W60 -d60 -Sh testfile.dat ``` -------------------------------- ### Large Area Sequential Serial Writes Source: https://github.com/microsoft/diskspd/wiki/Sample-command-lines Use this command for large area sequential serial writes of 4KB blocks. It configures a 2GB test file with a single outstanding I/O and 100% write percentage. ```bash diskspd -c2G -w100 -b4K -o1 -W60 -d60 -Sh testfile.dat ``` -------------------------------- ### Create CSV Volumes per Node Source: https://github.com/microsoft/diskspd/blob/master/Frameworks/VMFleet/ArcVM-Setup.md Creates CSV volumes on each cluster node using a specified size. Ensure the is replaced with the value obtained from Get-FleetVolumeEstimate. ```powershell Get-ClusterNode |% { New-Volume -StoragePoolFriendlyName SU1_Pool* -FriendlyName $_ -FileSystem CSVFS_ReFS -Size } ``` -------------------------------- ### Get-FleetDisk Source: https://github.com/microsoft/diskspd/wiki/VMFleet Inspects and validates the presence and characteristics (e.g., size) of data disks on virtual machines. ```APIDOC ## Get-FleetDisk ### Description Inspect and validate the presence of data disks on the virtual machines and their characteristics such as their size. ### Command Get-FleetDisk ``` -------------------------------- ### Create VMFleet Virtual Machine Fleet Source: https://github.com/microsoft/diskspd/wiki/VMFleet Creates the 'fleet' of virtual machines for VMFleet. Requires the path to the base VHD, administrator password, and domain credentials for cluster access. ```powershell New-Fleet -BaseVhd $VhdPath -AdminPass $AdminPass -ConnectUser $NodeUser -ConnectPass $NodePassword ``` -------------------------------- ### DiskSpd Warning for Slow File Preparation Source: https://github.com/microsoft/diskspd/wiki/Customizing-tests This warning is displayed if DiskSpd cannot use the optimized SetFileValidData function for file preparation and must use a slower method. ```text WARNING: Could not set privileges for setting valid file size; will use a slower method of preparing the file ``` -------------------------------- ### DiskSpd Main Thread Test Sequencing Source: https://github.com/microsoft/diskspd/wiki/Threading-and-concurrency Outlines the control flow of the main thread responsible for sequencing test phases and signaling worker threads. ```pseudocode OpenFiles CreateThreads phase = Warmup SendStartSignal Sleep(warmup) phase = Measurement Sleep(duration) phase = Cooldown Sleep(cooldown) phase = End WaitForThreadsToCleanUp SendResultsToResultParser ``` -------------------------------- ### Thread Stride Not a Multiple of Sequential Strides Source: https://github.com/microsoft/diskspd/wiki/Threading-and-concurrency Demonstrates a scenario where the thread stride is not a multiple of the sequential stride. Access wraps around the file, and subsequent I/O offsets for each thread depend on the relationship between `-T`, `-b`, and `-s`. ```bash diskspd -c3G -t3 -T13k -b4K -s c:\\testfile ``` -------------------------------- ### Get-FleetComputeTemplate Source: https://github.com/microsoft/diskspd/wiki/VMFleet Returns the processor count and memory size of an Azure VM template. Supports templates like A1v2, A2mv2, A2v2, A4mv2, A4v2, A8mv2, A8v2. ```APIDOC ## Get-FleetComputeTemplate ### Description Return the processor count and memory size of an Azure VM template. Supported VM templates include: A1v2, A2mv2, A2v2, A4mv2, A4v2, A8mv2, A8v2 ### Command Get-FleetComputeTemplate ``` -------------------------------- ### Show-FleetCPUSweep Source: https://github.com/microsoft/diskspd/wiki/VMFleet Produces a report containing a polynomial fit based on the output file of the sweep. ```APIDOC ## Show-FleetCPUSweep ### Description Produce report containing polynomial fit based on the output file of the sweep. ### Command Show-FleetCPUSweep ``` -------------------------------- ### Get-FleetPowerScheme Source: https://github.com/microsoft/diskspd/wiki/VMFleet Queries and retrieves the current power scheme setting of the host. ```APIDOC ## Get-FleetPowerScheme ### Description Query and get the current power scheme setting of host. ### Command Get-FleetPowerScheme ``` -------------------------------- ### DiskSpd Synchronization: Wait for Stop Event Source: https://github.com/microsoft/diskspd/wiki/Customizing-tests Configure DiskSpd to end the test run and display results only after a specified named event ('MyStopEvent') is signaled. This also associates Ctrl+C with the stop event. ```bash diskspd -c512m -d30 -o8 -w10 -t4 -b4k -D -L -p -ypMyStopEvent mytest.dat ``` -------------------------------- ### Get-FleetVersion Source: https://github.com/microsoft/diskspd/wiki/VMFleet Checks the current DiskSpd and VMFleet version numbers. ```APIDOC ## Get-FleetVersion ### Description Check the current DiskSpd and VMFleet version number. ### Command Get-FleetVersion ``` -------------------------------- ### Move-Fleet: Rotate CSV, Realign VMs Source: https://github.com/microsoft/diskspd/wiki/VMFleet-examples Rotates cluster shared volumes while realigning virtual machines. ```powershell Move-Fleet -ShiftCSV ``` -------------------------------- ### Move-Fleet: Rotate CSV, Keep VMs Constant Source: https://github.com/microsoft/diskspd/wiki/VMFleet-examples Rotates cluster shared volumes and keeps virtual machines in their current state. ```powershell Move-Fleet –ShiftCSV –KeepVM ```