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

Powercli - get configured memory on a resource pool.

$
0
0

In vSphere, version 5, when you click on a resource pool and hit the summary tab, in the Memory box under resource settings you can see something like:

 

Reservation: 0.00MB

Limit: 48:00GB

Configured 29:00GB.

 

I want to be able to pull out that number for "Configured" with powercli. Then I can see what pools are over or under allocated.

I believe it can be found in a property called summary.configuredMemoryMB from ResourcePoolSummary, but I have no idea how to use either of these objects. I have tried.

 

I am able to get the Limit, which is MemLimitGB. Here is my script:

 

**********************************************************************************

 

$report = @()
$Rpool = Get-ResourcePool  | select Name, ParentID, MemLimitGB, Parent
foreach ($pool in $Rpool)
          {
       
   $row = "" | Select Name, ParentID, MemLimitGB, Parent, "VC"
   $row.Name = $pool.Name
   $row.ParentID = $pool.ParentID
   $row.MemLimitGB = [int]$pool.MemLimitGB
   $row.Parent = $pool.Parent
   $row."VC" = $vc
  
    $report += $row
}
$report | Export-Csv

 

 

I would like:

 

$report = @()
$Rpool = Get-ResourcePool  | select Name, ParentID, MemLimitGB, Parent, "CONFIGMEM"
foreach ($pool in $Rpool)
          {
       
   $row = "" | Select Name, ParentID, MemLimitGB, Parent, "VC"
   $row.Name = $pool.Name
   $row.ParentID = $pool.ParentID
   $row.MemLimitGB = [int]$pool.MemLimitGB
   $row.Parent = $pool.Parent
   $row."VC" = $vc
   $row."CONFIGMEM" = $pool.summary.configuredMemoryMB   <<<<<<- Something like this. THIS IS WHERE I AM STUCK
  
    $report += $row
}
$report | Export-Csv
#############################################
Any help would be appreciated.
thanks.

Viewing all articles
Browse latest Browse all 228631

Trending Articles



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