Monday, February 28, 2011

PowerCli-VMwareResourceConfig

At a customer i find that resource config on VMs where strange i.e Cpu shares and Memshares where set to custom values which nobody could defend.
I used this script to set it back to default.

#Change resource config to normal and no mem and cpu limits
Get-VMHost "yourVMHostName" | Get-VM | Get-VMResourceConfiguration | `
 Set-VMResourceConfiguration -CpuSharesLevel "Normal" -MemSharesLevel "Normal" -CpuLimitMhz $null -MemLimitMB $null