4 Replies Latest reply on Jun 10, 2019 12:57 PM by esxi1979

    Cluster Capcity Report

    esxi1979 Hot Shot

      Hi All

       

      I need help to get the capacity info in below format :

      Data CenterCluster NameTotal ServersServer TypeSockets Per Server All servers have Hyperthreading Enabled ?Cores Per Socker Per Server Total Phy CoresCPURAM GBRAM in clusterTotal Powered On VMsCores allocatedCPU RatioAllocated RAMRAM RatioCPU usage % ApproxRAM Usage % ApproxCPU GHz CapacityCPU GHz Used

       

      Also i need to ensure we consider only Powered on VMs  in each cluster.

       

      Thanks

        • 1. Re: Cluster Capcity Report
          LucD Guru
          vExpertUser ModeratorsCommunity Warriors

          What do you already have?

          • 2. Re: Cluster Capcity Report
            esxi1979 Hot Shot

            Hi LucD

             

            I have a script from  Jonathan Medd , i did small change for power on vms

             

            ==

             

             

             

             

             

            function Get-ClusterCapacityCheck {

            <#

            .SYNOPSIS

            Retrieves basic capacity info for VMware clusters

             

            .DESCRIPTION

            Retrieves basic capacity info for VMware clusters

             

            .PARAMETER  ClusterName

            Name of the computer to test the services for

             

            .EXAMPLE

            PS C:\> Get-ClusterCapacityCheck -ClusterName Cluster01

             

            .EXAMPLE

            PS C:\> Get-Cluster | Get-ClusterCapacityCheck

             

            .NOTES

            Author: Jonathan Medd

            Date: 18/01/2012

            #>

             

            [CmdletBinding()]

            param(

            [Parameter(Position=0,Mandatory=$true,HelpMessage="Name of the cluster to test",

            ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$true)]

            [System.String]

            $ClusterName

            )

             

            begin {

            $Finish = (Get-Date -Hour 0 -Minute 0 -Second 0)

            $Start = $Finish.AddDays(-1).AddSeconds(1)

             

            New-VIProperty -Name FreeSpaceGB -ObjectType Datastore -Value {

            param($ds)

            [Math]::Round($ds.FreeSpaceMb/1KB,0)

            } -Force

             

            }

             

            process {

             

            $Cluster = Get-Cluster $ClusterName

             

            $ClusterCPUCores = $Cluster.ExtensionData.Summary.NumCpuCores

            $ClusterEffectiveMemoryGB = [math]::round(($Cluster.ExtensionData.Summary.EffectiveMemory / 1KB),0)

             

            $ClusterVMs = $Cluster | Get-VM | Where-Object -Property PowerState -eq 'PoweredOn'

             

            $ClusterAllocatedvCPUs = ($ClusterVMs | Measure-Object -Property NumCPu -Sum).Sum

            $ClusterAllocatedMemoryGB = [math]::round(($ClusterVMs | Measure-Object -Property MemoryMB -Sum).Sum / 1KB)

             

            $ClustervCPUpCPURatio = [math]::round($ClusterAllocatedvCPUs / $ClusterCPUCores,2)

            $ClusterActiveMemoryPercentage = [math]::round(($Cluster | Get-Stat -Stat mem.usage.average -Start $Start -Finish $Finish | Measure-Object -Property Value -Average).Average,0)

             

            $VMHost = $Cluster | Get-VMHost | Select-Object -Last 1

            $ClusterFreeDiskspaceGB = ($VMHost | Get-Datastore | Where-Object {$_.Extensiondata.Summary.MultipleHostAccess -eq $True} | Measure-Object -Property FreeSpaceGB -Sum).Sum

             

            New-Object -TypeName PSObject -Property @{

            Cluster = $Cluster.Name

            ClusterCPUCores = $ClusterCPUCores

            ClusterAllocatedvCPUs = $ClusterAllocatedvCPUs

            ClustervCPUpCPURatio = $ClustervCPUpCPURatio

            ClusterEffectiveMemoryGB = $ClusterEffectiveMemoryGB

            ClusterAllocatedMemoryGB = $ClusterAllocatedMemoryGB

            ClusterActiveMemoryPercentage = $ClusterActiveMemoryPercentage

            ClusterFreeDiskspaceGB = $ClusterFreeDiskspaceGB

            }

            }

            }

             

             

            #

            • 3. Re: Cluster Capcity Report
              LucD Guru
              Community WarriorsvExpertUser Moderators

              So what are you missing?

              • 4. Re: Cluster Capcity Report
                esxi1979 Hot Shot

                script gives ( sample output )

                 

                ClusterEffectiveMemoryGB      : 1116

                Cluster                       : xx

                ClusterAllocatedvCPUs         : 172

                ClusterCPUCores               : 60

                ClusterFreeDiskspaceGB        : 3268

                ClustervCPUpCPURatio          : 2.87

                ClusterAllocatedMemoryGB      : 680

                ClusterActiveMemoryPercentage : 56

                 

                ===

                 

                 

                 

                 

                below info is missing

                Data Center

                Total Phy Servers in cluster

                Server Type ( Hardware Model )

                Sockets Per Server

                All servers have Hyper-threading Enabled ?

                Cores Per Socket  Per Server

                Total Powered On VMs

                RAM Ratio

                CPU GHz Capacity

                CPU GHz Used

                CPU Model