Luc,
Many thanks for the quick script to calculate the CPU oversubscription ratio, I have updated the script below to the following:
ForEach ($esx in Get-VMHost) {
$vCPU = Get-VM -Location $esx | Measure-Object -Property NumCpu -Sum | select -ExpandProperty Sum
$esx | Select Name,
@{N='pCPU cores available';E={$_.NumCpu}},
@{N='vCPU assigned to VMs';E={$vCPU}},
@{N='Ratio';E={[math]::Round($vCPU/$_.NumCpu,1)}},
@{N='CPU Overcommit (%)';E={[Math]::Round(100*(($vCPU - $_.NumCpu) / $_.NumCpu), 1)}}
}
but somehow it cannot be exported to Excel as CSV?
Please correct me if I'm wrong, Does the formula to calculate the over commit % is make sense to you ? so for example the CPU Overcommit (%) shown as -x% it means that the host is underutilized and if the CPU Overcommit (%) is at 100% it means that the 1:1 ratio of CPU overcommit ratio is fully allocated,