VMware Cloud Community
Ram67
Contributor
Contributor

How to get the Available CPU and Memory capacity in Cluster via Powershell ?

Hi All,

I'm looking for ps1 command/script to grab the information of Available CPU & Memory from the Cluster using powershell commans of script.

I instaled vCenter server/Powercli on Wn 2008 R2 server.

Capture.PNG

i need above information in "Resource Allocation Tab" (highlighted in RED box).



Thanks

-Ram


4 Replies
LucD
Leadership
Leadership

Have a look at Re: Cluster Statistics


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

Ram67
Contributor
Contributor

Thank you so much,

can you tell me how to get Available memory in MB ?

Actually i'm getting output as follows , Memory Available Capacity=5759770624

Thanks again Smiley Happy

0 Kudos
LucD
Leadership
Leadership

Sure, replace this line

"Memory Available Capacity" = $rp.Runtime.Memory.MaxUsage - $rp.Runtime.Memory.ReservationUsed

with this

"Memory Available Capacity MB" = [math]::Round(($rp.Runtime.Memory.MaxUsage - $rp.Runtime.Memory.ReservationUsed)/1MB,0)



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

Ram67
Contributor
Contributor

Thanks Alot Smiley Happy

0 Kudos