Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 230777

Re: Script to count total amount of Memory allocated to VM's on each ESX host

$
0
0

I just ran LucD's script and then sub'd in your modification and the two scripts produce two different results.

Your modification:

PowerCLI C:\> Get-VMhost | Select Name,@{N="Memory used MB";E={$_ | Get-VM | %{$_.MemoryMB} | Measure-Object -Sum | Select -ExpandProperty Sum}}

Name                                                                                                                                   Memory used MB
----                                                                                                                                   --------------
10.2.5.86                                                                                                                                       75776
10.2.5.87                                                                                                                                      106496
10.2.5.85                                                                                                                                       88064

 

LucD's script:

PowerCLI C:\> Get-VMhost | Select Name,@{N="Memory used MB";E={ $_ | Get-VM | %{$_.ExtensionData.Summary.QuickStats.HostMemoryUsage} |  Measure-Object -Sum | Select -ExpandProperty Sum}}

Name                                                                                                                                   Memory used MB
----                                                                                                                                   --------------
10.2.5.86                                                                                                                                       63415
10.2.5.87                                                                                                                                       87734
10.2.5.85                                                                                                                                       81205

 

I ran the two variations back to back. LucD's takes a bit longer to run than yours. When I look at the host's summary page the memory utilization is more consistent with LucD's version. I'm not quite sure why there is a difference or where it is coming from, I just thought I'd throw my two cents in.


Viewing all articles
Browse latest Browse all 230777

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>