Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a desktop with Core i3 + 8GB.

It looks like I need to assign one of my CPU cores to a VM. That means I can only run one VM at a time?

Does VM application actually uses a core for each VM images? Or Do they depend on memory?

share|improve this question
2  
You need to tell it how many CPUs to virtualize (depending on VM stack), but that's not the same as giving up a physical CPU in it's entirety. What makes you think you need to assign a CPU? What VM software are you using? What have you tried already? –  techie007 Jul 10 '12 at 0:56
add comment

4 Answers

up vote 4 down vote accepted

The core you assign to the VM is a virtual core. You have an effectively unlimited supply of virtual cores.

share|improve this answer
    
While factual, if the number of virtual cores used exceeds the number of physical cores, there is a probability of overall performance taking a hit. –  killermist Jul 10 '12 at 4:39
    
@killermist: that depends entirely on whether or not the virtual cores are actually "in use". 10 VMs idling on a 4-core machine will not significantly slow down the single VM doing actual work (unless, of course memory is restricted as well). –  Joachim Sauer Jul 10 '12 at 6:12
    
@JoachimSauer True. When you get into virtual ... anything (except memory), things get fuzzy. –  killermist Jul 10 '12 at 6:18
add comment

Though the other answers are correct, there are a few things that you do want to be aware of.

  1. Do not exceed the number of actual threads that you have available on the server within a single VM. For example, if your Core i3 has 4 threads (ie Dual Core with HTT) then do not create a VM with 8 threads. They will most often freak out and actually run extremely slow.

  2. Though you can allocate more RAM to your VMs than what your server actually has, beware of actual RAM used and try not to exceed your bare metal max. You'll start using SWAP and that is just hella slow. You're better off lowering the RAM on each VM if the amount used is starting to use SWAP (Virtual Memory).

  3. Just because your CPU idles at 25-50% doesn't mean that you have room for 2-4x the number of VMs. You do not want to run your CPU at idle (or minimal processes) very high. There is always a natural amount of CPU usage and overtime you will see some statistical data on your servers to know peak times and how much more you can realistically put on the server.

  4. Typically with VMs and Clouds, the slowest part of the server is the hard drives. It's best to match the number of VMs that you're planning on running with a SAN/HDDs that can support them. My Raid5 reliably pushes 300MBps.

My private cloud has about 20 VMs running on it at any given time. A few of the VMs include Proxy Server, VPN server, WHS, Database Server, 5 Ruby on Rails Applications, Astrix Phone Server, 2 Wordpress servers, Virtual Host Web Server (10 websites).

It's a Intel Xeon E3-1270, 32GB RAM, 8x1TB 7200 RPM RAID5, and 50Mbps connection. For the most part, it idles around 5-10% CPU usage. It peaks around 75% CPU usage. I'm using Proxmox as my virtualization solution and love it. I've been using it for a few years now.

share|improve this answer
add comment

A CPU in a virtual machine does not map directly to a physical CPU [core]. You can safely run dozens of VM, each with multiple virtual CPUs even if you only have a single 'real' CPU core.

share|improve this answer
add comment

I've quite comfortably run 3-4 VMs at once on a c2d. There's a few concepts here. Firstly that while a core can run one thread at a time (not counting hyperthreading and such), it can switch between threads, Two cores is better since they don't need to switch a core between threads as often, but it isn't a showstopper.

Its no different from running multiple copies of a program (Chrome for example runs a process per tab), or a single multithreaded piece of software.

Your ram and processor usage is far more critical than coredness, and even dedicated VM hosts have far less cores than VMs running.

I'd also note that some vm host software lets you run more virtual cores than physical ones, so its quite certain that you don't need a core per vm.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.