Take the 2-minute tour ×

I have to host about 12 virtual machines on Xen server. all of them are very lightweight Linux machines. Means not resource intensive.

I have a xen server with single CPU with 4 cores. so is it possible i can share 2-3 CPUs among all of the virtual machines?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

Yes, the Xen hypervisor (as well as others) will just share timeslices of the available CPUs to your virtual machines. And yes, you can overbook the amount of vCPUs. You could pin the vCPUs to physical CPU cores, but this is not required at all, in which case you let the hypervisor decide what VM gets a certain amount of timeslices of a physical CPU core.

From the perspective of a VM you'll notice that some CPU time will get stolen at some points in time. For example in top the percentage of st raises above 0 when a lot of CPU time is requested but overbooked.

Cpu(s):  0.7%us,  0.7%sy,  0.0%ni, 98.7%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
share|improve this answer
add comment

Yes that is not a problem, just make sure you monitor the resources of this servers closely.

In my experience disk i/o is a much bigger issue than CPU power and memory these days...

What you should do though, dedicate one cpu core and some RAM to the dom0. The dom0 will setup some buffers based on the RAM allocated, and that can lead to some strange behaviour when the RAM shrinks (because it's allocated to domUs) during operation. In addition you'll want to be sure that the dom0 is always able to execute a command, even when some domUs block all the cores. Cores pinned to the dom0 wont get allocated to the domUs. To check memory and CPU resources of both dom0 and domUs use xm top

To achieve that use the following kernel options

dom0_mem=1024M dom0_max_vcpus=1 dom0_vcpus_pin

You do not need to do any further configuration so that the CPUs are shared. Just add vcpus=number of cores to your xen domU configuration files to specify how many virtual cores a single domU can use. If you do not explicitly pin some cores to a domU (using cpus= in the configuration file), the dom0 will distribute the load accordingly over all available CPUs / Cores.

share|improve this answer
sorry,but my question has already mentioned that i have no issue with other resources. and your post does not have clear instructions that in what steps the CPU is to be shared among each VM. –  Farhan Nov 21 '12 at 12:23
Added some more explanations. Hope that helps... –  rbtux Nov 21 '12 at 12:29
add comment

Your Answer


