Manage Learn to apply best practices and optimize your operations.

Understand how to allocate storage IOPS with QoS Management

By tracking VM metrics and displaying the current storage IOPS data, you will be better equipped to use QoS Management to limit consumption or reserve storage as needed.

Although any hardware resource could potentially act as a bottleneck to VM performance, storage IOPS is often the...

limiting factor. Because storage IOPS are often in short supply, virtualization vendors provide features that allow an administrator to limit a VM's storage I/O consumption. The key to using such features effectively, however, is to understand how storage IOPS are currently being distributed across the VMs.

Quite naturally, each hypervisor vendor has its own approach to measuring and allocating storage IOPS. In the case of Microsoft Hyper-V, the primary mechanism for regulating storage IOPS consumption is a feature called Quality of Service (QoS) Management. This feature is often referred to as Storage QoS.

Using QoS Management

QoS Management is set on a per virtual hard disk basis. As you can see in Figure A, this feature can be used to throttle a VM so it consumes fewer storage IOPS. As an alternative, QoS Management can be used to reserve storage IOPS for a VM so it always receives a guaranteed minimum number of IOPS -- and more if they are available.

QoS Management settings.
Figure A. Specifying QoS Management on a virtual hard disk.

The QoS Management feature allows administrators to reserve or limit storage IOPS on a per virtual hard disk basis.

As handy as the QoS Management feature is, it can only be used effectively by an administrator who knows how many storage IOPS are available, and how those IOPS are currently being used. Unfortunately, the Hyper-V Manager does not provide this information, but it is possible to retrieve Hyper-V related storage performance information by using PowerShell.

Tracking VM metrics

PowerShell provides a cmdlet called Measure-VM that enables you to track various VM metrics. Before you will be able to use this cmdlet, you will need to enable resource metering for your VMs. To enable resource metering for all of the VMs on the current Hyper-V server, enter the following command:

Get-VM | Enable-VMResourceMetering

You can then confirm resource metering has been enabled by entering the following command:

Get-VM | Select-Object Name, ResourceMeteringEnabled

Once resource metering has been enabled and has had time to compile some metering data, you can use the Measure-VM cmdlet to display the resource usage data for your VMs. If, for instance, you wanted to see the default resource metering data for all of the VMs on the current server, then you could type the following command:

Get-VM | Measure-VM

Figure B shows the process of enabling VMs for metering, verifying that metering is enabled and displaying the default metering data.

VM metering data.
Figure B. You can use the Measure-VM cmdlet to display the VM metering data.

As you can see in the figure above, resource metering works pretty well -- the VMs that are displaying zero values are not currently powered on. The problem, however, is that no information related to storage IOPS is displayed.

Displaying IOPS data

Even though the Measure-VM cmdlet does not display storage IOPS data by default, it is capable of displaying such data. In fact, the cmdlet can display the aggregated average normalized IOPS, the aggregated average latency, the aggregated disk data written and the aggregated disk data read for each VM.

Displaying this data is as simple as appending the Select-Object cmdlet to the Measure-VM cmdlet, and then specifying the metrics you want to view. It is important to keep in mind, however, that in production environments VMs often reside within failover clusters that make use of shared storage. As such, the only way to get comprehensive IOPS data is to look at all of the VMs on all of your servers. Fortunately, I have created a simple script that does just that:

$Servers = "Hyper-V-4", "Prod1"

ForEach ($Server in $Servers){

     $VMs = Get-VM

           ForEach ($VM in $VMs){

           $VM | Measure-VM | Select-Object VMName, ComputerName, AggregatedAverageNormalizedIOPS, AggregatedAverageLatency, AggregatedDiskDataRead, AggregatedDiskDataWritten | Format-List

           }

     }

The first line of the script lists the names of each Hyper-V server that is to be examined. In the interest of keeping things simple, only two servers are listed here, but you would normally enter all of your Hyper-V server names. The script then uses a loop to examine each of the servers, one at a time. A nested loop then retrieves and displays the performance data for each VM on the current server. You can see the script's partial output in Figure C. The script lists the performance data for each VM, along with the VM name and the VM's current host server.

VM storage performance data.
Figure C.This script displays storage performance data for VMs.

Hypervisor features, such as QoS Management, can be helpful for allocating storage IOPS. In order to use such a feature effectively, however, you need to know how the IOPS are currently being consumed.

Next Steps

Top 10 ways to improve storage I/O

The nitty gritty of Windows Server Storage QoS

Top data storage startups to watch in 2016

Get to know the Get-VM cmdlet

This was last published in July 2016

Dig Deeper on Virtual machine performance management

PRO+

Content

Find more PRO+ content and other member only offers, here.

Join the conversation

2 comments

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

What are your best practices for using Quality of Service Management?
Cancel
Jeez, that's convoluted. Is that really the best way to do this?
Cancel

-ADS BY GOOGLE

SearchVMware

SearchWindowsServer

SearchCloudComputing

SearchVirtualDesktop

SearchDataCenter

Close