Using PowerCLI to change performance metrics

This post was originally published on this site

Hi,

We have recently purchased a VxRail system for testing purposes.

 

I am trying to control IOPS and Network speed VIA PowerCLI.

 

We are on vsphere 6.7 but will be upgrading to 7.0 this week.

 

So far I have found the following commands googling  but I get errors when I try to use them.

 

First is the IOPS control

 

Get-VM ‘vm_name’ | Get-VMResourceConfiguration | Set-VMResourceconfiguration -configuration DiskResourceConfiguration -DiskLimitIOPerSecond <Value>

Set <Value> to what you want the IOPS to be.

when I try this I get the following

 

 

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:94

+ … esourceconfiguration -configuration DiskResourceConfiguration -DiskLi …

+                                         ~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : InvalidArgument: (:) [Set-VMResourceConfiguration], ParameterBindingException

    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,VMware.VimAutomation.ViCore.Cmdlets.Commands.SetVMResourceConfiguration

 

 

 

The second is network speed.  We are trying to control latency in the network without using 3rd party tools.

Here is the command for this.

 

Set-VMNetworkAdapter -VMName IOPSnNic -MaximumBandwidth 5000000

 

and here is the error

 

Set-VMNetworkAdapter : The term ‘Set-VMNetworkAdapter’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check

the spelling of the name, or if a path was included, verify that the path is correct and try again.

At D:UsersBrian.BarbeeDocumentsDellPowershellUntitled5.ps1:1 char:1

+ Set-VMNetworkAdapter -VMName IOPSnNic -MaximumBandwidth 5000000

+ ~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : ObjectNotFound: (Set-VMNetworkAdapter:String) [], CommandNotFoundException

    + FullyQualifiedErrorId : CommandNotFoundException

 

 

If these are not the correct commands can you please send me the proper command and syntax?

 

Thanks in advance

Brian

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.