...hopefully some useful VMware related stuff

Return slot size information in vSphere

03/11/2009 08:22

This script will return the slot size information from a vCenter server.

Download here

- - -

# slotsizes.ps1
# 20091103
# https://www.a2-alpha.co.uk
# This script checks to see whether you are using
# vSphere 4 and if so brings back information on slot sizes
# If you are not using vSphere 4 an information message is displayed

If ((Get-View ServiceInstance).Content.About.Version-ge “4.0.0“)
{
$Slots = @()
Foreach ($Cluster in (Get-Cluster |Get-View)){
$SlotDetails = $Cluster.RetrieveDasAdvancedRuntimeInfo()
$Details = “” |Select "Cluster Name", "Total Slots", "Used Slots", "Available Slots", "Number of vCPUs in Slot", "CPU MHz in Slot", "Memory (MB) in Slot"
$Details."Cluster Name"= $Cluster.Name
$Details."Total Slots" = $SlotDetails.TotalSlots
$Details."Used Slots" = $SlotDetails.UsedSlots
$Details."Available Slots" = $SlotDetails.TotalSlots - $SlotDetails.UsedSlots
$Details."Number of vCPUs in Slot" = $SlotDetails.SlotInfo.NumvCpus
$Details."CPU MHz in Slot" = $SlotDetails.SlotInfo.CpuMHz
$Details."Memory (MB) in Slot" = $SlotDetails.SlotInfo.MemoryMB
$Slots += $Details
}
""
$Slots
""
}
Else
{
""
"This version of vCenter is less than vSphere 4 so slot sizes are unavailable by this method."
""
}

Search site