VMware Cloud Community
dynobot
Contributor
Contributor
Jump to solution

performance report

I'm a newbie with powercli and my boss is asking me to generate an hourly report on cpu average, memory average, disk i/o, and network i/o.  Just picked up a book VMWare vSphere PowerCLI Reference but I'm overwhelmed with all the information.  Wondering if there is a similar script from anyone out there that I can use or tailor according to my need.

Thanks

Steve

26 Replies
ctu86
Contributor
Contributor
Jump to solution

Actually  we need a report for capacity planning like what is the current capacity and how is the CPU and memory utilization  for the past one month? Memory here is consumed memory and also CPU its better if we can calculate vcpus remaining  rather than ghz.

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

mhervhin15
Contributor
Contributor
Jump to solution

Can this be done on specific list of VMs? Also, will this be straight thru PowerCLI? How can I make it to run automatically every 2-hours? Can this be run thru Windows scheduler?

Thank you in advance.

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Yes, you can do this in many ways.

Through a mask in the Name field.

$vms = Get-VM -Name vm*

From a file

$vms = Get-VM -Name (Import-Csv -Path .\vmnames.csv -UseCulture).vmnames


For your other questions, I suggest to do a search in this community or create a new thread.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
vmk2014
Expert
Expert
Jump to solution

LucD,

Can we get the report for a specific set of VM's or list of VM's ? E.g. C:\temp\servers.txt

Thanks

V

Reply
0 Kudos
vmk2014
Expert
Expert
Jump to solution

LucD,

When i try with specific vm's name it throws an error.

Get-VM : Cannot validate argument on parameter 'Name'. The argument is null or empty. Provide an argument that is not null o

At D:\nilay\VM_Perform_report.ps1:1 char:20

+ ... Get-VM -Name(Import-Csv -Path C:\temp\vmnames.csv -UseCulture).vmname ...

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

    + CategoryInfo          : InvalidData: (:) [Get-VM], ParameterBindingValidationException

    + FullyQualifiedErrorId : ParameterArgumentValidationError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetVM

Get-Stat : 5/31/2020 8:11:22 AM Get-Stat                Value cannot be found for the mandatory parameter Entity

At D:\nilay\VM_Perform_report.ps1:6 char:1

+ Get-Stat -Entity $vms -Start $start -ErrorAction SilentlyContinue |

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

    + CategoryInfo          : NotSpecified: (:) [Get-Stat], VimException

    + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetViStats

Any help is appreciated.

Thanks

V

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Do you actually have a column VMName in that CSV?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos