The following script is based on Eric Sloof’s Resourcepool calculator.
I modified it quit a bit. It now has, logging, can be run as a scheduled task, % of resource reservation for memory and cpu that can be set on a resourcepool. The script respects the reservertion set on a particular vm.
You need to adjust the following variables:
#SCRIPTVARIABLES
$MEMRES = 30 # %OF MEMORY USED FOR RESERVATION
$CPURES = 15 # %OF CPU USED FOR RESERVATION
$HOSTCPUMHZ = 2931 # AMOUNT OF MHZ PER CPU/CORE ON THE ESX HOST
$VCSERVER = “localhost”
$ARCHDAYS = 7
$LOGFOLDER = “c:\ViLOG” #LOG DIRECTORY
$LFILEOBJ = “respool-*”
The script can be downloaded at the following site:
http://communities.vmware.com/docs/DOC-9610
Related articles
Tags: ESX, Powershell, VMware

October 14th, 2009 at 8:03 pm
Nice script, BUT

Would it be possible to grab the average usage of the cpu /memory over say the last week, and make that the reservation ?
Its a matter of tuning, and reservering memory which the vm dont use seem like a waste.
The average is there, in VC, somewhere
If it was possible to grab that average, compute it, and use that for reservation you would get a realistic reservation for a vm.
Just a thought really
Reply