Linux – Is it possible to share 4 cores single CPU among 12 virtual machines on Xen

citrixlinuxvirtualizationxen

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?

Best Answer

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