I have a general question regarding CPU resource allocation and expansion. If I set CPU number to 2, is it possible to allow CPU to break this constraint at runtime? In fact my application server needs more CPU resource than set in peak time and I wish it can be achieved using whatever method VMware provides. Thanks!
If you mean can you assign more vCPU's to a VM and take it away dynamically, based on resource demand then the answer is no. You can add vCPU's to a running VM - assuming the OS supports hot-swap.
If you mean can you assign more vCPU's to a VM and take it away dynamically, based on resource demand then the answer is no. You can add vCPU's to a running VM - assuming the OS supports hot-swap.
On supported OS there is also the hot-remove function for CPU:
http://communities.vmware.com/thread/284758
But it's manually. Maybe you can automate with PowerCLI...
Andre
thanks for your information! Can you provide more info on VMware support for hot-swap on WIndows platform?
Check out the following web site - it is covered very well here. For hot add CPU you need windows 2008 datacenter edition
http://gestaltit.com/all/tech/virtualization/simon/vmware-hot-add-memorycpu-support/
To be fair here, the issue I've found with hot adding CPU or memory is that while Windows will properly detect the resources most often the application will not. In my testing if I am running a CPU intensive workload and hot add a second vCPU, the applicaiton continues to use CPU0 without trying to leverage CPU1. Depending on the application you may need to restart the services, close/open the application, or in most cases reboot before the application can start using the extra CPU.
My advice is to test this feature with the expected workload to see if it will even make a difference before you start looking into how you can automate adding the extra CPU. Also at this time there is no way to remove a CPU from a running VM, at least on any guest OS I've used.
Matt
Thank you all for the valuable posts!
Your answers make me clear on the resource allocation in terms of CPU and memory. Originally I think that CPU can be expanded on the fly but it seems not to work that way. CPU reallocation is supposed to occur between VMs with CPU and memory setting fixed in the context of resource pooling configuration.