Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save omniproc/cd4486fe3633b12b5b7a337b327819e8 to your computer and use it in GitHub Desktop.
Save omniproc/cd4486fe3633b12b5b7a337b327819e8 to your computer and use it in GitHub Desktop.
$vms = Get-Cluster CLUSTER_NAME_YOU_WANT_TO_ANALYZE | Get-VM
foreach ($vm in $vms)
{
$conf = $vm | Get-VMResourceConfiguration;
if( ($conf.CpuReservationMhz -ne 0) -or ($conf.CpuLimitMhz -ne -1) -or ($conf.CpuSharesLevel -ne "Normal") -or
($conf.MemReservationMB -ne 0) -or ($conf.MemLimitMB -ne -1) -or ($conf.MemsharesLevel -ne "Normal"))
{
$vm | Get-VMResourceConfiguration | select-object VM,CpuReservationMhz,CpuLimitMhz,CpuSharesLevel,MemReservationMB,MemLimitMB,MemsharesLevel | ft
}
}
@omniproc
Copy link
Author

omniproc commented Apr 6, 2016

Will detect any non-default share / reservation configuration and print those entries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment