Infrastructure
- Storage Spaces Direct
- Windows Volume Mgmt.
- Windows File Systems
- Deduplication
- Volume Shadowcopy Services
- Storage Replica
Windows Hyper-V Server allows you to run lots of virtual Windows machines (VMs)on a single physical server. Scale-Out File Server lets you store server application data, such as Hyper-V virtual machine files, on file shares. While this is a great way to optimise the use of hardware, all these virtual machines need to be managed, to ensure that they get a fair share of the storage and server resources. Storage Quality of Service (QoS) is designed to manage storage performance for VMs, by setting policies for individual VMs to ensure that a given VM gets enough resources, without hogging them at the expense of others. Don't confuse this with Windows QoS, which is for controlling Network resources.
If you have configured a new Failover Cluster and configured a Cluster Shared Volume(CSV) on Windows Server 2016, then the Storage QoS feature will be set up automatically and then the Storage QoS Resource is displayed as a Cluster Core Resource and visible in both Failover Cluster Manager and Windows PowerShell. The failover cluster system will manage this resource.
Here is some defintions for Storage QoS terms
You can use Storage QoS on Hyper-V, either using a Scale-Out File Server or using Cluster Shared Volumes. The clustering requirements are slightly different:
The Scale-Out File Server scenario requires that the storage cluster is a Scale-Out File Server cluster and the Compute cluster has least one Hyper-V role enabled server. The Storage servers need to be in a Failover Cluster, but the compute servers do not. All the servers must be running Windows Server 2016.
The Cluster Shared Volumes scenario requires both a Compute cluster with the Hyper-V role enabled and a Hyper-V using Cluster Shared Volumes for storage. A Failover Cluster is required and all servers must be running the same version of Windows Server 2016.
The policy manager monitors the virtual machines as they are launched by the Hyper-V servers and communicates the Storage QoS policy for each machine back to the Hyper-V server. The Hyper-V server then controls the performance of the virtual machine as appropriate. If the storage QoS policies are changed, the Policy Manager passes the changed QoS requirement to the Hyper-V servers, so they can ensure each VM is getting the correct performance requirements.
You need to install Remote Administration Tools to manage Storage QoS policies from remote computers, or you can manage Storage QoS policies and monitor flows from compute hosts using the Remote Server Administration Tools. These are available as optional features on all Windows Server 2016 installations, and can be downloaded separately for Windows 10 at the Microsoft Download Center website.
To use PowerShell to manage Storage QoS, you need the RSAT-Clustering feature and SAT-Hyper-V-Tools for remote management of Hyper-V. Start up an elevated Windows PowerShell command line, then enter
Add-WindowsFeature RSAT-Clustering
Add-WindowsFeature RSAT-Hyper-V-Tools
To see the status of the Storage QoS Resource run the following PowerShell cmdlet.
Get-ClusterResource -Name "Storage Qos Resource"
To see the status of all current flows initiated by Hyper-V servers, use the Get-StorageQosFlow cmdlet.
The second command shows how to limit the output to flows from a single VM. The 'Format-List' pipe shows data at a per-storage volume level as well as per-flow and shows stuff like the average total utilisation in normalized IOPs, latency, and aggregate limits and reservations applied to a volume.
Get-StorageQosFlow
Get-StorageQosFlow -InitiatorName SQLPWD0032 | Format-List
You can also pipe the command output into a sort, The following command will pick out the VMs that are getting a lot of I/O service.
Get-StorageQosFlow | Sort-Object StorageNodeIOPs -Descending
A Hard disk drive will have a maximum I/O load and this is shared among the virtual drives that are hosted on it. Every virtual hard disk has a set of performance values, MinimumIOPs and MaximumIOPs and MaximumIobandwidth, which will be adjusted based on its load. The values at any time will depend on the overall load on all the virtual disks and will be shared out according to the policy. If only one virtual disk is active, it could take all of the available bandwidth.
Get-VM -Name SQLPWD0032 | Get-VMHardDiskDrive | Format-List
To list out all configured policies and their status on a Scale-Out Fileserver, use the ServerGet-StorageQosPolicy cmdlet.
You can also pipe the policy command with Get-StorageQosPolicy to get the status of all flows configured to use each policy. The second command will display the flows for the 'SQLserver' policy
Get-StorageQosPolicy
Get-StorageQosPolicy -Name SQLserver | Get-StorageQosFlow | ft InitiatorName, *IOPS, Status, FilePath -AutoSize