If I have a 4 GB machine, I cannot have more than 4 VMs if each one requires 1 GB. True or false? Explain either answer
4 Answers
False: some VM solutions support memory overcommit(ment). Whether or not it's a good idea is another matter. (Also depends on how strongly you mean "requires".)
-
1
-
And probably will, if the host starts paging any of it to disk. If the memory is overcommitted, that's pretty likely.– ssubeOct 26, 2010 at 2:21
There's an interesting article on Memory Overcommitment and Virtualization at http://blog.gridcentriclabs.com/2010/08/virtualization-and-over-subscription.html if you're interested in the theory behind it
It also depends on the VM system you use.
For example, VMWare ESX / ESXi will happily do over committment. Xenserver makes no such claim (last I checked).
If you over commit on an ESX / ESXi box, its always better to load up several copies of the same OS, this allows better page merging. You wont get nearly such an ability to over commit if your guest operation systems are Windows, Linux and Solaris. If they are all windows (or linux, or solaris) then on those boxes, over-committing by 20% or more is unlikely to do much harm.
I'm not sure if WMWare Workstation or Player will do it. Certainly when I'm using VMware Player or workstation professionally, I find that trying to over commit will let the VMs run but the performance is horrible - mostly because of the host system paging. It's so bad I don't ever try any more.
So if using a host OS and a desktop virtualisation product, my inclination is to advise lots of RAM and don't try to over commit.
Actually, you need to make sure you have left enough memory for the host operating system too. Starting too many VMs can use all (or almost all) of the host's memory, which will lead to astonishingly poor performance. I once managed to leave only 256MB RAM for the host OS on my system, and it took almost half an hour to get one of the VMs to shut down again!