MEM.usage.Average Question

We make sure that our ESX clusters are run under 70% memory usage.  Is it possible to subtract 70 (percent) memory usage in the following script?

foreach ($cluster Get-cluster |) Sort - Object) {$esx = $cluster |} Get-VMHost; $ds = get-Datastore - VMHost $esx | where {$_.} Type - eq "VMFS"}; $cluster | Select @{N = "Cluster name"; E = {$cluster. Name}}, @{N = 'use of memory (%) » ; E = {[Math]: round ((($_ |))} Get-Stat - Stat mem.usage.average - Start (Get-Date). AddHours(-72) - IntervalMins 5 - MaxSamples (12) | Measure - Object - average value). Average), 2)}}}

Easy enough;


foreach($cluster in Get-Cluster | Sort-Object ){
$esx = $cluster | Get-VMHost;
$ds = Get-Datastore -VMHost $esx | where {$_.Type -eq "VMFS"};
$cluster | Select @{N="Cluster Name";E={$cluster.Name}},
  @{N="Memory Usage (%)";E={[Math]::Round((($_ | Get-Stat -Stat mem.usage.average -Start (Get-Date).AddHours(-72) -IntervalMins 5 -MaxSamples (12) | Measure-Object Value -Average).Average),2)}},
  @{N="Amount Under Threshold";E={70 - [Math]::Round((($_ | Get-Stat -Stat mem.usage.average -Start (Get-Date).AddHours(-72) -IntervalMins 5 -MaxSamples (12) | Measure-Object Value -Average).Average),2)}},
  @{N="GB Used";E={144/100 * [Math]::Round((($_ | Get-Stat -Stat mem.usage.average -Start (Get-Date).AddHours(-72) -IntervalMins 5 -MaxSamples (12) | Measure-Object Value -Average).Average),2)}},
  @{N="GB Free";E={144 - (144/100 * [Math]::Round((($_ | Get-Stat -Stat mem.usage.average -Start (Get-Date).AddHours(-72) -IntervalMins 5 -MaxSamples (12) | Measure-Object Value -Average).Average),2))}}  

}

Tags: VMware

Similar Questions

  • "Mem.Usage.Average" against the total aggregate of cluster host memory

    Please see the attachment for the whole story.

    Please give me a sanity check on this. I used the "Mem.Usage.Average" as a % against allocated VM MemoryMB. The sum of these calculations escaped by far the actual calculations of the vCenter % memory-based. So, I changed my calculations that you see in the worksheet to use the 'Mem.Usage.Average' against the total aggregate available on all hosts in the cluster. This amount came to less than 1% of my calculations based on vCenter GUI. Am I right against the total aggregate memory cluster host instead of against VM memory assigned using 'Mem.Usage.Average '? Thxs-

    ExcelOutput.jpg

    SDK is not clear on "total configured memory available or". https://www.VMware.com/support/developer/converter-SDK/conv55_apireference/memory_counters.html Part description of memory used as a percentage of the total configured or available memory.


    $start = (get-Date). AddDays(-5)

    Get-cluster-location ActualClusterName | Get - VM | Where {$_.} PowerState - eq "Receptor"} @{N = "Mem.Usage.Average"; E = {[Math]: round ((($_ |))} Get-Stat - Stat mem.usage.average - start $start - $finish - IntervalMins 1800 - MaxSamples finishing (250) | Measure - Object - average value). Average), 2)}}"


    Cluster is 6 hosts with 128G per host for total of 768G (786432 MB of RAM), there are 118 powered on virtual machines


    vCGUI.jpg

    for me the SDK says that percentage reflects the relationship between the memory 'active' in the virtual machine against the memory configured for the virtual machine.

    A configured with 8 GB of memory virtual computer that has 'use' of 25% is actively using 2 GB of memory.

    I think that your numbers you get for VMS are biased because of the great period of time during which you take the average (see previous answer).

    You can cross-check the mem.usage.average with the mem.active.average.

    In the following code, I calculate the different 2 meters actual memory used by the virtual machine.

    $clusterName = "mycluster.

    $stat = 'mem.usage.average ','mem.active.average '.

    $vm = get - Cluster - name $clusterName | Get - VM | where {$_.} PowerState - eq "Receptor"}

    $stats = get-Stat-entity $vm - Stat $stat - Realtime - MaxSamples 1

    $stats | Group-object - property {$_.} @entity.name} | %{

    [PSCustomObject] @ {}

    VM = $_. Group [0]. @entity.name

    MemoryMB = $_. Group [0]. Entity.MemoryMB

    MemUsagePerc = $_. Group | where {$_.} MetricId - eq "mem.usage.average"} | Select - ExpandProperty value

    MemUsageMB = [int]($_.) Group [0]. Entity.MemoryMB * ($_.) Group | where {$_.} MetricId - eq "mem.usage.average"}). Value) / 100

    MemActiveMB = ($_.) Group | where {$_.} MetricId - eq "mem.active.average"} | Select - ExpandProperty Value) / 1 KB

    }

    }

    The result shows a specific virtual machine, these two numbers are close enough to be considered the same imho.

    That they should be in fact, the mem.usage.average is derived from the mem.active.average.

  • (Mem.usage.Average & Mem.Active.Average meter with get-stats

    I try to put together a weekly statistics using get-Stats... his works all well but if I use Mem.usage.Average, I have the memory percentage. using mem.active.average would give me the use of memory in KB, I understand.

    However, I get an entry using mem.active.average null.

    On the study, I noticed through the chart options to real a meter (attached document) only the section of memory in time performance?

    The mem.active counter can be added to the other section? or y at - it a config I need to do?

    See you soon

    The metrics are collected for different intervals depend on what you are configuring in

    .

    In this form, you will see the 4 historical intervals and for each, there is a "level of statistics" (being the metric 4, 1 being the least metric).

    You can check what you have there?

    If the level is 1 for all the intervals that could be the reason why you can not get the mem.active meter.

    Note the data in real time, see you in the VI Client comes from the real time hard coded interval (20 seconds) which is collected on the ESX servers themselves and is kept only for a limited period of time.

  • CPU.ready.summation of measurement when cpu.usage.average max

    Hi, I'm new in powercli,

    I use the following script to get cpu.usage.average mem.usage.average min, average, max, and the maximum of cpu.ready.summation

    I would like to correct also the cpu.ready.summation when the cpu.usage.average is max, and I can't!

    Here is my script:

    $allvms = @)
    $vms = get - Vm
    {foreach ($vm to $vms)
    $vmstat = "" | Select VmName, MemMax, MemAvg, MemMin, CPUMax, CPUAvg, CPUMin, CPURDYMax
    $vmstat. VmName = $vm.name
    $statcpu = get-Stat-entity ($vm) - start (get-date). AddDays(-1)-Finish (Get-Date) - MaxSamples 10000 - Intervalmins 30 - stat cpu.usage.average
    $statmem = get-Stat-entity ($vm) - start (get-date). AddDays(-1)-Finish (Get-Date) - MaxSamples 10000 - Intervalmins 30 - stat mem.usage.average
    $statcpurdy = get-Stat-entity ($vm) - start (get-date). AddDays(-1)-Finish (Get-Date) - MaxSamples 10000 - Intervalmins 30 - stat cpu.ready.summation
    $cpu = $statcpu | Measure-object-property value - average - Maximum - Minimum
    $mem = $statmem | Measure-object-property value - average - Maximum - Minimum
    $cpurdy = $statcpurdy | Measure-object-property value - average - Maximum - Minimum
    $vmstat. CPUMax = $cpu. Maximum
    $vmstat. CPUAvg = $cpu. Average
    $vmstat. CPUMin = $cpu. Minimum
    $vmstat. MemMax = $mem. Maximum
    $vmstat. MemAvg = $mem. Average
    $vmstat. MemMin = $mem. Minimum
    $vmstat. CPURDYMax = $cpurdy. Maximum
    $allvms += $vmstat
    }
    $allvms | Select VmName, MemMax, MemAvg, MemMin, CPUMax, CPUAvg, CPUMin, CPURDYMax | Export-Csv "c:\extract.csv" - noTypeInformation

    Best regards.

    OK, I hope that I finally got.

    Try this version. It indicates the maximum percentage of loan for the day.

    $allvms = @()
    $vms = Get-Vm  $start = (Get-Date).AddDays(-1)
    $metrics = "cpu.usage.average","mem.usage.average","cpu.ready.summation"
    Get-Stat -Entity $vms -Start $start -Stat $metrics |
    Group-Object -Property {$_.Entity.Name} | %{
      $cpu = $_.Group | where {$_.MetricId -eq "cpu.usage.average" -and $_.Instance -eq ""} | Measure-Object -Property value -Average -Maximum -Minimum  $mem = $_.Group | where {$_.MetricId -eq "mem.usage.average"} | Measure-Object -Property value -Average -Maximum -Minimum  $vmstat = "" | Select Time,VmName, MemMax, MemAvg, MemMin, CPUMax, CPUAvg, CPUMin, CPURDYMaxPercent  $vmstat.VmName = $_.Group[0].Entity.Name  $vmstat.Time = $_.Group | Sort-Object -Property Timestamp | Select -First 1 | Select -ExpandProperty Timestamp  $vmstat.CPUMax = $cpu.Maximum  $vmstat.CPUAvg = $cpu.Average  $vmstat.CPUMin = $cpu.Minimum  $vmstat.MemMax = $mem.Maximum  $vmstat.MemAvg = $mem.Average  $vmstat.MemMin = $mem.Minimum  $vmstat.CPURDYMaxPercent = &{
        ($_.Group | where {$_.MetricId -eq "cpu.ready.summation" -and $_.Instance -eq ""} |
        Sort-Object -Property Value -Descending |    Select -First 1 |
        Select -ExpandProperty Value)/$interval  }
      $allvms += $vmstat}
    $allvms | Select Time,VmName, MemMax, MemAvg, MemMin, CPUMax, CPUAvg, CPUMin, CPURDYMaxPercent |
    Export-Csv "c:\extract.csv" -noTypeInformation -UseCulture
    
  • NET. Throughput.usage.Average

    Get - VM * db * |

    Select Name, @{N = ' Mbit/s Avg network flow'; E = {}

    [math]: Round ((Get-Stat-entité $_-Start (Get-Date).)) AddDays(-1)-Stat "net.throughput.usage.average" |

    where {$_.} {Instance - eq ""} |

    Measure-object-property - average value. Select average - ExpandProperty) / 1 k, 2)

    }}

    I got the result as below

    NameMbps throughput of the network of AVG
    x0
    There2.16
    z0.11

    now Questions or clarification;

    1.

    NET. Throughput.usage.AverageUse of net debitKbps

    The use of band current network bandwidth for the host

    Why then the o/p shows MBPs & not Kbps

    2. If a second on the last day 1 as the VM did network traffic means 2.16 for vm y?  Does include entering & leaving them both?

    Thank you

    To get the unit use the property Unit of or the returned samples.

    The net.throughput.usage.average metric is the sum of the net.received.average and net.transmitted.average parameters.

    See also network script get-stat

  • MEM.swapused.Average find virtual vm use the pagefile and decrease the perf of storage

    Hi all

    Search I want to find vm machine overtemperature perf with file exchange memory storage.

    I find this mem.swapused.average of meter, but my results are weird.

    only i wan't exactly:

    I want to see all the vm to use a swap file, and when I have them I can upgrade memory reserved.

    TKS in advance

    The mem.swapused.average counter is reserved for the hostsystems as far as I know.

    You can use the mem.swapped.average, something like this:

    $start = (Get-Date).AddDays(-1)
    $metric = "mem.swapped.average"
    $entities = Get-VM
    Get-Stat -Entity $entities -Stat $metric -Start $start | Group-Object -Property {$_.Entity.Name} | %{
      New-Object PSObject -Property @{
        Name = $_.Name    AvgSwappedKB = $_.Group | Measure-Object -Property Value -Average | Select -ExpandProperty Average
      }
    }
    
  • creating a table/average question

    I'm new to labview and I have problems to understand how to create a table.

    I use an Arduino Uno as my DAQ and when I take an anolog measure I've seen a lot of fuctuation to my measure. I know with arduino, you can perform with an average simple by using the function "Get a finished sample of Analog", but I know that I not be using an Arduino in the long term and trying to figure out the right way to do it.

    When I have on average with the Arduino IDE I usually code that looks like this:

    float analogsum = 0;

    for (int i = 0; i)< 10;="">

    analogSum += analogRead (analogPin); where analogRead converts the analog value to a value\ digital 10-bit

    }

    average = analogSum/10;

    I am trying to create this same feature in LabView. The only way I can imagine the analog value of each iteration, in summary would be to store each value in a table, then add them together and divide by the number of iterations in my loop for.

    How would I do this in Labview?

    Hi awwende,

    show all 3 suggestions above:

    You really should go LabVIEW101 the ni.com site to learn the fundamentals of LabVIEW!

  • There are a lot of Add-ons for firefox. Could you add the use of memory and the size of the code snippet. To download a &amp; search for mem usage... bad.

    Looking through the massive amounts of Add-ons is a bit annoying. I always want to know how big the app is and how a memory trail I will get. I now have to download the application for size and then the search engine application to see if it is a heavy memory drag. Today, I tried a screenshot of Firefox Add-on. The first was 2.4 mb the second was 414 KB, it's a big difference. Then after searching memory, I found problems.

    This info can be added to code snippets.

    Thank you

    https://addons.Mozilla.org/en-us/Firefox/addon/about-addons-memory/
    Subject: addons-memory 10 by Nils Maier
    Adds a comments: page of memory addons that details the use of the memory module

  • Cross the average question - Muse to the printed book

    I just bought Adobe Muse and I was wondering if there is a way to take a model and translate the design into a book for printing once I have fill the pages with images and text.

    I wish to have a presence similar to the search in print and online. It is a presentation of image photography (with a descriptive picture story) that I really don't want to do the double job on. I think it may be more appropriate to approach it in the layout of the book in the direction of Muse, but it is easier to build the work in a more visual environment as Muse waay.

    Printing requires a higher res photo - about 330 dpi. Muse is at 72 dpi.

    Just build in Muse but work on design issues on your book page size too you design in Muse. So when you prepare the document to print all your design problems are solved and you just drag in photos of high quality.

  • Question about results Powercli vs what I see in Vcenter

    Hi all

    I use the following script below and have a question.  When you look at the output say server has 7 days to CPU MAX it shows 30, 29, 27, 30, 31, 26, 30.  When I look at
    to Vcenter Server A for the last 7 days, I see spikes in CPU up to 70% almost everyday, why this would result in the results of the script for max CPU?  I am
    using level 1 in all areas save.

    Script is below.

    Thank you

    Greg

    Server Connect-VIServer-name username-password password

    $allvms = @)

    $vms = get - Vm

    $start = (get-Date). AddDays(-7)

    $metrics = "cpu.usage.average", "mem.usage.average".

    $stats = get-Stat-entity $vms - start $start - Stat $metrics

    $stats | Group-object - property {$_.} Timestamp.Day}, {$_.} @entity.name} | %{

    $vmstat = "" | Select VmName, day, MemMax, MemAvg, MemMin, CPUMax, CPUAvg, CPUMin

    $vmstat. VmName = $_. Values [1]

    $vmstat. Day = $_. Group [0]. Timestamp.Date

    $cpu = $_. Group | where {$_.} MetricId - eq "cpu.usage.average"} | Measure-object-property value - average - Maximum - Minimum

    $mem = $_. Group | where {$_.} MetricId - eq "mem.usage.average"} | Measure-object-property value - average - Maximum - Minimum

    $vmstat. CPUMax = [int] $cpu. Maximum

    $vmstat. CPUAvg = [int] $cpu. Average

    $vmstat. CPUMin = [int] $cpu. Minimum

    $vmstat. MemMax = [int] $mem. Maximum

    $vmstat. MemAvg = [int] $mem. Average

    $vmstat. MemMin = [int] $mem. Minimum

    $allvms += $vmstat

    }

    $allvms |

    Export-Csv "c:\scripts\cpuandram\VMs.csv" - noTypeInformation

    It is indeed all the averages, but not the same measures.

    This is where the role of aggregation comes into play.

    A short explanation

    • the ESXi gets all parameters (there are no historic levels to an ESXi host) in every 20 seconds.
    • vpx agent transfers these values to the vCenter, which held the first aggregation.
    • the intervals of 20 seconds (real time) are converted into 1 historical range that has an interval of 5 minutes by default.
    • The aggregation process creates new value from the corresponding values of 15 x 20 seconds. So it's not all come from the average cumulative counter. Maximum values to calculate the new maximum HI1...
    • The value of cpu.usage.average may not correspond with the value cpu.usage.maximum for the values of the historical range.

    The predefined intervals are most likely defined like this, because they serve the major requirements of a planner with admin/capacity of vSphere.

    But there may indeed be other needs you need more granular data further in time.

    This can be done by changing the levels of statistics (but which cost storage vCenter DB), discharging to an external DB values, or by using a more specialized tool (for example VCOPS) to the performance monitoring/capacity planning.

  • Script Get-stat for VM Perfomance - Questions

    I am writing a script to get data on our virtual machine performance of the measures of depth for CPU and memory.  Its a great project task I have to do for our mgt and so I am writing a script extremely important and vital for our company.  I use the command get-stats and feedback from the messages I posted about get-stat in particular lucd and lebouf who have been very helpful.  But I have collected their answers and writes the script below.  Currently, it must be used with an argument, but I can change it later.  It also uses many counters of cpu and memory that is why it is a long script.  But I have a lot of questions on the script before I run it, I need to be clear with the data I receive in return.  The script is below:

    $vm = $args

    $vmguest = @{N = 'operating System'; {E = {.osfullname (get-vmguest - VM $_)}}

    Get - VM $args | where {$_.} PowerState - eq "Receptor"} | `

    Select name, NumCpu MemoryMB,

    @{N = "Mem.Usage.Average"; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat mem.usage.average | Measure-object-propriete value - average). Average}},

    @{N = "Percentage of use memory Maxiumn"; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat mem.usage.maximum | Measure-object-propriete value - average). Average}},

    @{N = "Memory use Ko"; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat mem.consumed.average | Measure-object-propriete value - average). Average}},

    @{N = "Memory status"; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat mem.state.latest | Measure-object-propriete value - average). Average}},

    @{N = "Memory Swapin average ko"; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat mem.swapin.average | Measure-object-propriete value - average). Average}},

    @{N = "Memory Swapout average ko"; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat mem.swapout.average | Measure-object-propriete value - average). Average}},

    @{N = 'Memory reserved MB capacity'; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat mem.reservedCapacity.average | Measure-object-propriete value - average). Average}},

    @{N = 'Average CPU usage percentage'; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat cpu.usage.average | Measure-object-propriete value - average). Average}},

    @{N = "CPU REady"; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat cpu.ready.summation | Measure-object-propriete value - average). Average}},

    @{N = "Maximum percentage of CPU usage"; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat cpu.usage.maximum | Measure-object-propriete value - average). Average}},

    @{N = "Use CPU MHZ on average"; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat cpu.usagemhz.average | Measure-object-propriete value - average). Average}},

    @{N = "Maximum MHZ CPU utilization"; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat cpu.usagemhz.maximum | Measure-object-propriete value - average). Average}},

    @{N = "MHZ CPU reserved"; E = {(get-stat - entity $_ - Start ((Get-Date).))} AddDays(-7)) - finishing (Get-Date) - stat cpu.reservedCapacity.average | Measure-object-propriete value - average). Average}} | `

    Export-Csv c:\stats5.csv

    The questions I have are:

    The first question is I want the stats to be based on the last 7 days, so I used the .adddays (-7).  It would give me the last 7 days stats?

    In my settings of virtual center statistics, I have all interval times checked.  So if I want last 7 days stats, I would use the samples for the interval of 30 minutes duration.  Also I have not used all interval parameter in the get-stat, so my samples will be based on the interval of 30 minutes.  Is this correct?

    Also, I have not used the maxsample interval, so by default I get to use all the values in the sample, and measures will give me the average of all samples (duration 30 min) values in the last 7 days.  Is that correct. ?

    Another key question is that is it possible to get readings of samples for only Monday to Friday, from 06:00-18:00, as this is when the virtual machine is used.  I don't know how this can be done and how it can be incorporated in the above script.  Is this possible to do?

    Also about the measure-object cmdlet, I used to all counters, as for the average values of use of cpu and memory.  I also use counters for cpu and memory max.  Would I need to use the average value of the object of measures to this end, as this counter will give me the max value for cpu/memory for all 7 days, which will be a single value, because I want to know the max value, it achieved, so I don't know if I have to use measure-object with these counters, do I need to use?

    About the ready CPU meter I use, also gives the value in millseconds.  Is it possible to get loan from cpu percentage value as we see in ESXTop because it is easier to understand for the cpuready.  I don't see any counter loan as a percentage of the CPU.  Is it possible to get a value for it.

    With the - equal Start parameter to specify that you want the values from 1 day back.

    This means that you will get the values historical interval 1 and the period interval 5 minutes ago.

    It is the HI1 interval in the scheme of part 1.

    When you specify not one - Start parameter and - finishing you will in effect of the values of historical interval 4, which has a period of 1-day interval.

    In a next blog post, I will talk about default values in the cmdlet Get-Stat.

  • Average use of memory

    How can I get the use of the average memory of a group of virtual machines?  I have a current report that uses get - vm to create a group of objects of virtual machine.  I would like to integrate a custom property that goes and gets the average memory of this group of VMS usage and adds it as a custom property.  I would like to use Get-stat but I'm at the level of statistics 1 so I can only use what is available there.

    Get-vm-place somecluster1, anothercluster2 | Select name, memorygb, numcpu, aMillionOtherProperties,

    @{N = "AverageRAMUsage"; E = {ABrilliantget-statSnippet}}

    Ideas?

    Thank you!

    When you want to obtain this use?

    In all cases, you could do something like that, don't forget to adapt the content of the variable $start

    $clusterName = "mycluster.

    $start = (get-Date). AddHours(-1)

    $stat = "mem.usage.average".

    $vms = get-VM-location (Get-Cluster-name $clusterName)

    Get-Stat - $vms - Stat $stat entity - start $start - ErrorAction SilentlyContinue |

    Group-object - property {$_.} Enity.Name} |

    Select Name,

    @{N = "MemoryGB"; E={$_. Group [0]. Entity.MemoryGB}},

    @{N = "NumCpu"; E={$_. Group [0]. Entity.NumCpu}},

    @{N = "AverageRAMUsage"; E = {}

    [math]: Round (($_.)) Group [0] | Measure-object-property - average value. Select average - ExpandProperty), 2)

    }}

  • Average use of memory in MB? Not %

    I have the following code that uses get-stat to gather cluster statistics and exports the timestamp and the memory usage average percentage in the csv format:

    # In-memory cluster statistics

    foreach ($cluster in $xml. Settings.Setting.Clusters.Cluster)

    {

    $metrics = "mem.usage.average".

    $stats = get-stat-entity (get-cluster $cluster) - Stat $metrics - start $start - finishing $finish - interval 86400

    $groups = $stats | Group-object - property {$_.} TimeStamp, $_. @entity.name} $report = $groups | % {

    New-object PSObject-property @ {}

    'TimeStamp' = $_. Group [0]. TimeStamp

    '%' = $_. Group | where {$_.} MetricId - eq "mem.usage.average"} | Select value - ExpandProperty

    }

    }

    $csv_clustermem = ($ScriptPath + $cluster) + '_mem.csv '.

    $report | Select the TimeStamp, '% '. Export-Csv $csv_clustermem - NoTypeInformation

    Mem_Chart # launch Excel and generate the graph

    I do not know how to retrieve the memory in MB with her average? I tried to simply add Mo as an additional property to retrieve and then expand but I don't think that's true.

    Thanks in advance

    Try something like this

    $finish = Get-Date$start = ($finish).AddDays(-7)$metrics = "mem.usage.average"$cluster = Get-Cluster
    
    $stats = get-stat -Entity $cluster -Stat $metrics -Start $start -Finish $finish -Interval 86400$groups = $stats | Group-Object -Property {$_.TimeStamp, $_.Entity.Name} $report = $groups | % {  $totMem = $_.Group[0].Entity.ExtensionData.Summary.TotalMemory  $memAvgPerc = $_.Group | where {$_.MetricId -eq "mem.usage.average"} | Select -ExpandProperty Value  New-Object PSObject -Property @{    Cluster = $_.Group[0].Entity.Name    TimeStamp = $_.Group[0].TimeStamp    '%' = $memAvgPerc    'Avg MB' = [math]::Round(($totMem * $memAvgPerc / 1MB / 100),0)  }}$report
    
  • Average use of CPU and memory of the ESX host

    Dear team

    script of powercli necessary to fetch the last 2 month avg cpu and memory utilzaition for all ESX hosts that are managed by vcenter server.

    concerning

    Mr. Vmware

    Try something like this

    $esx = Get-VMHost
    $start = (Get-Date).AddMonths(-2)
    $metric = "cpu.usage.average","mem.usage.average"
    Get-Stat -Entity $esx -Start $start -Stat $metric | Group-Object -Property {$_.Entity.Name} |
    Select @{N="VMHost";E={$_.Name}},  @{N="Avg CPU %";E={$_.Group | where {$_.MetricId -eq "cpu.usage.average"} |
        Measure-Object -Property Value -Average | Select -ExpandProperty Average}},  @{N="Avg Memory %";E={$_.Group | where {$_.MetricId -eq "mem.usage.average"} |
        Measure-Object -Property Value -Average | Select -ExpandProperty Average}}
    
  • Get-stat cpu.usage.min

    I have a need to collect data from performance of my bunches.

    I understand cpu.usagemhz.average & mem.usage.average very well.

    What I can't do, is bring together the cpu.usage.min, the cpu.usage.max, the mem.usage.min and the mem.usage.max for clusters.

    In the reference of VI-Kit cmdlet to tools is watch the "cpu.usage.min" in detailed descriptions.  So I guess that this is possible.

    Can someone give me an example of how together these mini/maxi measures?

    Min/max metrics require at least level 3 statistics.

    You have at least one of the four historical intervals seams at least level 3?

    If so, you can get the metrics of min/max for that specific interval with the cmdlet Get-Stat.

Maybe you are looking for