info@techdevops.com | 437-991-3573 | Data Engineering Services
TechDevOps.com
Resources Tools
Experts in Microsoft SQL Server on Windows, Linux, Containers | Clusters, Always On, FCI | Migrations, Cloud, Performance



Disk Performance on Azure Virtual Machine - storflt driver
by BF (Principal Consultant; Architecture; Engineering)
2018-04-17








After provisioning a new Windows Server 2012 Virtual Machine in Azure Cloud, during our machine prep stage, we executed Disk IO test and the result was the C drive showing lower than expected IOPS. This occurred on a single VM and the rest of our VM's were not experiencing this same issue.

The issue is explained in this article. Link

The solution for us was to execute the below Powershell - in elevated mode. The VM must be restarted once the Powershell has completed. Once we completed these steps, the IOPS jumped to over 500 MB/Sec for both Read and Write. Disk IO Testing tool used was CrystalDiskMark5_5_0.


PLEASE PERFORM YOUR OWN RESEARCH AND WHETHER THIS IS APPLICABLE TO YOUR ENVIRONMENT / SERVERS


#(1) Check for Windows Version

# ***** NOTE: We skipped this check as the storflt driver was missing for us *****

$windowsVersion = [System.Environment]::OSVersion.Version
if(-not ($windowsVersion.Major -eq 6 -and $windowsVersion.Minor -eq 3))
{
Write-Host "Problem not applicable to the running version of Windows. Exiting."
Exit
}
else
{
Write-Host "Windows Server 2012 R2 Detected."
}

#(2) If the .INF is already present, exit
if(Test-Path "$env:SystemDrive\Windows\INF\wstoracl.inf")
{
Write-Host "wstoracl.inf present. No known issues detected. Exiting."
Exit
}

#(3) PnP Clean
Write-Host "Running: PnP Clean."
RUNDLL32.exe pnpclean.dll,RunDLL_PnpClean /devices /maxclean

#(4) Configure the startup type of the storflt service
Write-Host "Running: Setting boot type of storflt service."
$output = sc.exe config storflt start=boot
if($output.Contains("SUCCESS") -eq $false)
{
Write-Host "Error while setting the boot type of the service. [$output]"
Exit
}

#(5) Read the registry key for LowerFilters
Write-Host "Running: Reading registry value."
$regValue = Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e967-e325-11ce-bfc1-08002be10318}\" -Name "LowerFilters"
if($regValue.LowerFilters.Contains("storflt") -eq $false)
{
Write-Host "Running: storflt not present. Setting registry value."
$regValue.LowerFilters += "storflt"
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4d36e967-e325-11ce-bfc1-08002be10318}\" -Name "LowerFilters" -Value $regValue.LowerFilters
Write-Host "Required values set. Please reboot the VM for the settings to take effect. "
}
else
{
Write-Host "storflt already present. Exiting."
}