To manage the storage performance priority of virtual machines, Microsoft has introduced in Windows Server 2012 R2 the Storage Quality of Service (Storage QoS). This feature enables to set a maximum input/output per second (IOPS) to a virtual hard disk. In a multi-tenant environment you can set the maximum IOPS according to a service level or to avoid that a tenant VM impact storage performance of others tenant VMs. This feature enables also to notify an administrator if the minimum IOPS on a virtual hard disk is reached.
The Storage QoS in Windows Server 2012 R2 is great when you have a standalone Hyper-V. In cluster case, it is another story. In a cluster configuration, usually nodes share a storage solution. So several nodes can store virtual hard disk on a single storage solution. Thanks to Storage QoS you can set the Maximum IOPS (or the Minimum IOPS) on virtual hard disks (VHD) on each node. Because the Storage QoS is not centralized, you can set a total Maximum IOPS of all VHD hosted on a single storage solution that reach and exceed the maximum storage performance.
So with Windows Server 2016, Microsoft has enhanced the Storage QoS. In Windows Server 2016, we are able to centrally manage the Storage QoS policies for a group of virtual machines. And these policies are applied at the cluster level since policies are stored in the cluster database. Because a policy can be applied to a group of VMs you can easily create service level at the cluster level. Moreover, Microsoft has added PowerShell cmdlet to configure and monitor performance related to Storage QoS.
Currently, Storage QoS supports two scenarios :
- Hyper-V using Scale-Out File Server
- Hyper-V using Cluster Shared Volume
So Storage QoS can be applied to both Software-Defined Storage scenario provided in Windows Server 2016 : disaggregated deployment and Hyper-Convergence.
Manage Storage Quality of Service
In the below example, I have implemented a Hyper-Converged cluster consisting of four Nano Server Nodes. So I will manage the Storage QoS remotely by using CIM Session. On the cluster, there is a VM deployed where IOMeter is running.
First of all, it is necessary to open a CIM session to a cluster node because we are managing the cluster from a management machine using RSAT Tools :
$CimSession = New-CimSession -Credential inthomecloud\rserre -ComputerName HC-Nano01
Then I use the below command to show the IOPS for each flow.
Get-StorageQosFlow -CimSession $CimSession | Sort-Object StorageNodeIOPs -Descending | ft InitiatorName, @{Expression={$_.InitiatorNodeName.Substring(0,$_.InitiatorNodeName.IndexOf('.'))};Label="InitiatorNodeName"}, StorageNodeIOPs, Status, @{Expression={$_.FilePath.Substring($_.FilePath.LastIndexOf('\')+1)};Label="File"} -AutoSize
You can find the result of this command in the below screenshot. I have the VM name, the Hyper-V which hosts the VM, the IOPS and the name of the file.
To get more information as the PolicyID, the minimum and the maximum IOPS, you can run the below command. In the below example, no Storage QoS policy is applied to the flow.
Get-StorageQoSFlow -InitiatorName VM01 -CimSession $CimSession | Format-List
You can have also a summary about the storage QoS applied to a volume :
Get-StorageQoSVolume -CimSession $CimSession | fl *
You can see in the above screenshot that no reservation is applied on this volume.
To make the test, I have run an IOMeter in the VM01. You can find the result without policy applied.
Then I create a new policy called bronze with a minimum IOPS of 50 and a maximum IOPS of 150.
New-StorageQosPolicy -Name bronze -MinimumIops 50 -MaximumIops 150 -CimSession $CimSession
Next I apply the Storage QoS policy to the VM01 disks.
Get-VM -Name VM01 -ComputerName HC-Nano02| Get-VMHardDiskDrive | Set-VMHardDiskDrive -QoSPolicyID (Get-StorageQosPolicy -Name Bronze -CimSession $CimSession).PolicyId
If I run again the Get-StorageQoSVolume, you can see that a reservation is applied to the volume (50 as the policy).
Then I run again the Get-StorageQoSFlow. You can see that the StorageNodeIOPS is reduced to 169 (instead of 435).
Then, if you show all details, you can see that a policy is applied on the flow and there are a minimum and a maximum IOPS.
To finish, you can see in the below screenshot that the IOPS inside the VM is also reduced compared to before Storage QoS application.