L
L
Lev Mikheenko2016-04-21 11:07:14
Virtualization
Lev Mikheenko, 2016-04-21 11:07:14

How are resources allocated during virtualization?

I will try to formulate the question as clearly as possible. It became interesting to me how computer resources are distributed during the virtualization of N'th number of machines. To be more precise, I'm interested in the Unified Networking Lab. I put a virtual machine with *nix OS and allocate a certain number of resources to it. (Let it be 6 GB of RAM and 1 processor with 4 cores) Everything started, it works. But in addition to the OS itself, I throw images of Dynamips, IOL, QEMU into it, which also need to allocate a certain amount of RAM. What is the crux of the question: If I run about 20-30 of these different images inside a virtual machine and the average consumption of one image is about 512 RAM (512*25/1024=12.5) can it all work? The computer has 8 GB of RAM. Again, the virtual machine was allocated 6 GB of RAM. And how exactly does the distribution of resources on a virtual machine work? Just very recently I read somewhere that a virtual machine can be allocated 2 times more RAM than there is on a PC. it only uses half the RAM and also half the hard drive.
I'm sorry if I worded it poorly or too hard. If possible, then some links to articles or small fresh books on virtualization.
Thank you for your attention. A lion.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
athacker, 2016-04-21
@JustLooKeD

This is a very delicate question.
The fact that the virtual machine will use half of the memory is not true. All the memory that it will be allowed to use, it uses. Another question is how exactly she will do it (more precisely, for what purposes). For example, if you have 8 gigs of RAM, and applications need only 4, this does not mean that the system will use only 4 GB. It's just that the remaining 4 GB, which are not needed by applications, will be used for other purposes - for disk cache, for example. Or under the cache of memory pages (standby memory in Windows - when the pages freed by the application are not actually freed, but are stored in memory. And if the application that freed the page again suddenly wants to request memory, then an existing page will be allocated to it).
You also need to understand that the hypervisor has the means to moderate the appetites of the machine. For example, mechanisms such as balooning. That is, if the memory that the guest system allocated for some of its needs is suddenly needed by another virtual machine, then the hypervisor will inflate the baloon through a special driver and take away part of the memory from one guest machine to give it to others.
In other words - if you have 8 GB, and you allocated 16 GB to the machine, then it will work. Exactly until your guest virtual machines REALLY want to use more than 8 GB of RAM. When they want, everything will be as always, i.e., flushing pages to the disk cache, wild brakes and all that.

D
Diman89, 2016-04-21
@Diman89

It depends on the settings of the hypervisor itself (os), but the swap in the VM is already from the os in the VM, whether and how it implements
ps. vmware will not let you create a vm with more memory than it actually is.
pss. vm can have settings for limiting and reserving resources

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question