I can get the hosts total physical memory, and service console memory, but cannot seem to find the memory used by the system, ideally I want to retreive the figures shown in virtual centre
get-vmhost | get-view | %{ $_.SystemResources.config.MemoryAllocation }
No?
-Cody Bunch
What you get with QuickStats is "Physical memory usage on the host in MB."
I think he wants what the VI Client shows as System and Virtual Machines memory.

Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
My numbers match up with what is shown on the summary page for my host using the VI Client... Am I missing something?
Sorry, I only looked at your QuickStats statement.
The one with SystemResources matches the value in the VI client.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
When connecting this to a VC how do i get it to display the ESX host for each one?
and also how do i get it in to a table format
Reservation : 45379
ExpandableReservation : False
Limit : 45379
Shares : VMware.Vim.SharesInfo
OverheadLimit : 0
DynamicType :
DynamicProperty :
to something like
Host Reservation ExpandableReservation Limit Shares
ESX01 45379 False 45379 VMware.Vim.SharesInfo
Something like this:
$report = @()
Get-VMHost | Sort-Object -property Name | %{
$_ | Get-View | %{
$row = "" | select Host, Reservation, ExpandableReservation,Limit,Shares
$row.Host = $_.Name
$row.Reservation = $_.SystemResources.config.MemoryAllocation.Reservation
$row.ExpandableReservation = $_.SystemResources.config.MemoryAllocation.ExpandableReservation
$row.Limit = $_.SystemResources.config.MemoryAllocation.Limit
$row.Shares = $_.SystemResources.config.MemoryAllocation.Shares.Shares
$report += $row}}
$report | ft
For the Shares property I used the actual Shares value instead of the name of the object.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
