VMware Cloud Community
AshuC
Contributor
Contributor
Jump to solution

using powercli to control limit disk iops

Hey there, I need to limit the iops of the disks connected to my virtual machines via powercli.

I am  using the following command :

Get-VM 'vm_name' | Get-VMResourceConfiguration | Set-VMResourceconfiguration -configuration DiskResourceConfiguration -DiskLimitIOPerSecond 100

But this gives an error:

Set-VMResourceConfiguration : Cannot bind parameter 'Configuration'. Cannot convert the "DiskResourceConfiguration" value of type "System.String
" to type "VMware.VimAutomation.ViCore.Types.V1.VM.VMResourceConfiguration".
At line:1 char:86
+ Get-VM $vm | Get-VMResourceConfiguration | Set-VMResourceconfiguration -configuration <<<<  DiskResourceConfiguration -DiskLimitIOPerSecond 10
0
    + CategoryInfo          : InvalidArgument: (:) [Set-VMResourceConfiguration], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,VMware.VimAutomation.ViCore.Cmdlets.Commands.SetVMResourceConfiguration

Can someone please suggest me, where am I going wrong ?

0 Kudos
21 Replies
artsiom0
Contributor
Contributor
Jump to solution

if someone is interested, there is another way using Set-VMResourceconfiguration with the -DiskLimitIOPerSecond option:

$vm_config = Get-VMResourceConfiguration -VM $vm

$disks = Get-HardDisk -VM $vm

Set-VMResourceConfiguration -Configuration $vm_config -Disk $disks -DiskLimitIOPerSecond 300

So you need to pass the Disk option to change the limit IOPs value. If you don't pass, you get no errors and no change,

0 Kudos
vMarkusK1985
Expert
Expert
Jump to solution

Hi,

I also limited a lot of VMs from Disk IO perspective (Script - vSphere VM Disk IO Report und IO Limit - my cloud-(r)evolution).

Do you mention any unwanted performance Issues after limiting the VMs?

I had very high latency’s on all VMs in Kernel and Que... And hat to switch back to the old disk I/O scheduler.

Some Additional Information’s:

New mclock I/O Scheduler in vSphere 5.5 - Some details - CormacHogan.com

http://www.yellow-bricks.com/2014/07/15/vsphere-5-5-disk-limits-mclock-scheduler-caveat/

http://www.yellow-bricks.com/2014/07/14/new-disk-io-scheduler-used-vsphere-5-5/

http://anthonyspiteri.net/esxi-5-5-iops-limit-mclock-scheduler/

https://mycloudrevolution.com | https://twitter.com/vMarkus_K | https://github.com/vMarkusK
0 Kudos