PowerCLI

 View Only
  • 1.  Using PowerCLI to change performance metrics

    Posted Aug 17, 2020 04:27 PM

    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:\Users\Brian.Barbee\Documents\Dell\Powershell\Untitled5.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



  • 2.  RE: Using PowerCLI to change performance metrics

    Posted Aug 17, 2020 07:32 PM

    Moderator: Thread moved to the PowerCLI area.



  • 3.  RE: Using PowerCLI to change performance metrics
    Best Answer

    Posted Aug 17, 2020 07:39 PM

    You are passing the Configuration value over the pipeline, so no need to explicitly specify it.

    Get-VM 'vm_name' |

    Get-VMResourceConfiguration |

    Set-VMResourceconfiguration -DiskLimitIOPerSecond <Value>

    The 2nd snippet uses Set-VMNetworkAdapater, which is not a PowerCLI cmdlet but a cmdlet from the Hyper-V module.

    I suggest you check the VxRail docs to find how this should be done with PowerCLI



  • 4.  RE: Using PowerCLI to change performance metrics

    Posted Aug 18, 2020 05:26 PM

    Thank you for the clarification.