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: