Figure 2-64:
Storage QoS policies and their application to different VM tiers
Storage QoS in Windows Server 2016 is turned on by default. This means that you don’t need to
install an additional role or feature to get going.
For example, Figure 2-65 illustrates that if you have a Hyper-V failover cluster, you can see that a new
cluster resource is listed.
Figure 2-65:
Storage QoS Cluster Core Resource
You also can use the Windows PowerShell cmdlet Get-ClusterResource to display the same result:
Get-ClusterResource -Name "Storage Qos Resource"
Storage QoS will work effectively only if you decide to configure appropriate policies. You can use
policies to control the traffic flow as necessary based on your requirements. You can configure
Storage QoS policies on the SOFS. You essentially have a choice of two policy types:
Single-instance
Using single-instance policies, you can create a minimum and maximum
amount of IOPS per policy. This is aggregated against a VM. For example, if a VM has a single
VHD/VHDX, it will have full use of all the IOPS in the assigned policy. However, if the VM has three
VHD/VHDX and they are all assigned the same single-instance policy, that VM will share the
maximum number of IOPS across all drives, degrading the overall performance. You have the
option to have multiple single-instance policies and configure each drive to use a different single-
instance policy to ensure that they get access to all the IOPS. If you have two VMs with a single
VHD each and all assigned to the same single-instance policy, they will also share the minimum
and maximum IOPS.
63
CHAPTER 2 | Software-defined datacenter
Multi-instance
With multi-instance policies, again you have options to create a minimum and
maximum number of IOPS. However, in this scenario, if you had two VMs with a single VHD/VHDX
each, they will get their own allocation of IOPS, both minimum and maximum. However, the same
rules apply that if the VM had multiple disks: unless assigned individual policies, they will share
the total amount of assigned minimum and maximum IOPS.
To create a policy, use the following Windows PowerShell cmdlet:
$GoldVmPolicy = New-StorageQosPolicy -Name Gold -PolicyType MultiInstance -MinimumIops 100 -MaximumIops 500
This sample will store information about the policy in the variable. There is one property called the
PolicyId
, which you will require. To access the
PolicyId
use the following syntax:
$GoldVmPolicy.PolicyId
Guid
----
Cd5f6b87-fa15-402b-3545-32c2f456f6e1
The
Guid
is what you will require to apply this policy to a VHD by using the following Windows
PowerShell command:
Get-VM -Name GoldSrv* | Get-VMHardDiskDrive | Set-VMHardDiskDrive -QoSPolicyID Cd5f6b87-fa15-402b-3545-
32c2f456f6e1
After the policy is applied, you will, of course, want to verify that the policy is indeed active, but also
you will want to monitor if it is having the appropriate effect. You can do this by using the Get-
StorageQoSFlow cmdlet.
The following output shows what is applied and the amount of storage the IOPS the VM is actually
using:
Get-StorageQosFlow -InitiatorName GoldVm1 | Format-List
FilePath:c:\ClusterStorage\Volume1\VMS\Gold\GoldVM1.VHDX
FlowId: ebfecb54-e47a-5a2d-8ec0-0940994ff21c
InitiatorId : ae4e3dd0-3bde-42ef-b035-9064309e6fec
InitiatorIOPS : 464
InitiatorLatency : 26.2684
InitiatorName : GoldVM1
InitiatorNodeName : node1.contoso.com
Interval : 300000
Limit : 500
PolicyId : cd5f6b87-fa15-402b-3545-32c2f456f6e1
Reservation : 500
Status : Ok
StorageNodeIOPS : 475
StorageNodeLatency : 6.5625
StorageNodeName : node1.contoso.com
TimeStamp : 2/12/2016 3:28:49 AM
VolumeId : 2d34fc5a-2b3f-9922-23f4-43563b2a6787
PSComputerName :
MaximumIops : 100
MinimumIops : 500
You can use the Get-StorageQoSFlow cmdlet to validate before you create policies what the VMs are
actually using in relation to Storage IOPS.
Get-StorageQosFlow | 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
InitiatorName InitiatorNodeName StorageNodeIOPs Status File
------------- ----------------- --------------- ------ ----
GoldVM5
node1 2482 Ok IOMETER.VHDX
GoldVM2
node2 344 Ok BUILDVM2.VHDX
GoldVM1
node2 597 Ok BUILDVM1.VHDX
GoldVM4
node1 116 Ok BUILDVM4.VHDX
GoldVM3
node2 526 Ok BUILDVM3.VHDX
GoldVM4
node1 102 Ok
64
CHAPTER 2 | Software-defined datacenter
Do'stlaringiz bilan baham: |