Get Cluster Provisioned Resources

The script below pulls a list of your clusters with their CPU & Memory Total Capacity as well as how much has been provisioned. It then displays the ratio to physical to virtual to help you maintain your over-commitment ratios. Its setup as a function so you can choose whether to display text on screen with | FT or Export to csv with | Export-CSV

Function Name: VPF-ClusterAllocated

This is also likely to be my last post of the year so i hope those of you having time off over the christmas period get to enjoy spending some well earned time with your families

Function VPF-ClusterAllocated
Get-Datacenter | Get-Cluster |
Select Name, HAEnabled, DRSEnabled,
    $script:totalCores = Get-VMHost -Location $_ | Measure-Object NumCpu -Sum | Select -ExpandProperty Sum
    $script:provisionedcores = Get-VMHost -Location $_ | get-vm | Measure-Object NumCpu -Sum | Select -ExpandProperty Sum
 $script:TotalMem = Get-VMHost -Location $_ | Measure-Object MemoryTotalGB -Sum | Select -ExpandProperty Sum
 $script:ProvisionedMem = Get-VMHost -Location $_ | get-vm | Measure-Object MemoryGB -Sum | Select -ExpandProperty Sum


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.