Lesson 1 - Resource Management and Monitoring
Resource Management and Monitoring This lesson examines the following virtual CPU and memory concepts: Describing CPU and RAM in a virtualized environment Describing RAM over commitment Identifying technology that improves memory utilization Describing symmetrical virtual multi-processing (SMP) RAM reclamation Hyper threading CPU load balancing
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
Already have an account? Sign In »
14 hours 13 minutes
Resource Management and Monitoring This lesson examines the following virtual CPU and memory concepts:
Describing CPU and RAM in a virtualized environment
Describing RAM over commitment
Identifying technology that improves memory utilization
Describing symmetrical virtual multi-processing (SMP)
CPU load balancing
Hello, I'm Dean Pompilio. Welcome to Cyber Eri were in the virtual ization installation configuration Management course beginning in module 10.
Lesson number one deals with resource management and monitoring.
We'll have five lessons in this module,
so starting out with less than one we're looking at virtual CPU and memory concepts.
We want to know how your CPU and RAM works in a virtualized environment. The CPU ram on your host that iss
also gonna talk about what over commitment means
and identify a technology that lets you
the ram that your host actually contains.
And then we'll look lastly at the symmetrical multi processing configuration of your host and how that applies to the virtual machine environment.
So we think about the way that your your host has its own physical ram. Right?
Maybe you have eight Big 12 gig 32 wherever you wherever you can afford to put in there
within your virtual machine.
I've got my application.
So I've got the guest operating system.
It has its virtual ram that's used by the Guest OS, whether it's Server 2012 or Window seven or Lennox,
the operating system of the VM itself
also has, ah, physical ram that's allocated to the guest operating system.
This all comes from the hosts physical ramp. So the way that we subdivide this finite resource among each of the V EMS that are being used
is what we're getting at here.
VM, where allows for over commitment of memory resource is you can get away with
actually allocating more memory to the virtual machines
that you've configured, then they can actually support if they were all using their maximum allocation of RAM.
So this is an interesting concept. Is doesn't work this way. In the rial
it's only possible in the virtual world.
So, for instance, I could,
uh, say that I'm my vm needs a reservation of 256 megabytes,
But maybe I can allocate up to 512 megabytes to that virtual machine. So the way that works
for instance, the VM has to have the reservation met in order to boot up in order to start.
So I've got some minimum level off memory that's required for the virtual machine to actually boot,
and then I can set
a maximum or a limit on that amount of RAM so that I don't go beyond 5 12 mag. In this case,
if you do exceed the allocated amount of RAM, you might start swapping. Swap file gets created.
And if you remember,
swap file had a file extension of dot V S
So there's only gets created
when you're your allocation exceeds
what was what was designed when you created the V M or when you edited its configuration settings.
If you start to swap, obviously that's going to have an effect on your performance. So
it's best to pick your your reservation in your limits for your V M's memory requirements very carefully. Or at least start with numbers that are rather small
and only increase
if it's required based on your performance monitoring or other tasks.
now we can think about how how do we get,
uh, to use more physical
are utilized the physical rant the host has,
and actually over allocate that for virtual machines.
So if my host had,
let's say, eight gigabytes of ram,
I could actually create enough virtual machines that would say that I really need 12 gigabytes of RAM
because all those V M's aren't using all their available memory allocation at the same time, this is possible.
If they did try to use all their memory at the same time, and it really did need 12 gigabytes of RAM, then I would have to start swapping and taking advantage of other technologies which help better utilize
the hosts physical memory
so we can reclaim memory in various different ways. One of the ingenious ways of doing that is known as TPS or transparent paid sharing.
And the way this works is
if I have
several V EMS running it on my host,
there's an excellent chance that if they're running very similar operating systems or similar applications that I will have pages of memory that are actually the same between those different virtual machines.
So if I have three virtual machines, let's say they're all running window seven.
There's gonna be some portion of the memory
in this virtual machine.
Let's let's say it's like three pages of memory here, three pages of memory here
and three pages of memory here.
They might be identical because they're all running the same operating system.
What I can do is Aiken transparently share these memory pages
so these get de allocated, they're no longer needed, and all I've got is pointers
to the actual pages.
So now three virtual machines can actually share
the same pages of memory that one virtual machine was using
if the if the page of memory changes. If there's some update, then of course, we go back to using the memory pages individually.
But if they are identical that were basically de duplicating the memory pages and sharing those pages that are identical among several machines,
it's a great way to economize your use of the hosts memory.
Another feature is the balloon driver.
So when memory starts to get scarce, before you actually begin
swapping, for instance,
I could borrow memory from other V EMS so I might have
a requirement for joins the green again, and I have a requirement
for an extra
four pages of RAM here. Let's just say they were given by each are sorry mega by each.
Maybe I've got another requirement for four more.
I can't satisfy all eight pages of memory that's needed by this VM. So what I can do? Let's say I've got some allocated on these V EMS. I've got eight here,
and I've got eight here.
If this PM needs 12 pages of memory and these two only needs six, I can steal, too,
from each of these and Adam
to this BM.
So the balloon basically inflates
the memory on the VM that needs it the most
and the V EMS that had some of their memory moved over to be used by this bm
uh, more or less don't suffer for that.
If if the memory requirement now
eyes removed and this B M no longer needs that memory,
then that memory goes back to the original eight and it gets returned to the VM that it was borrowed from. So the balloon inflates to get more memory bios it, and then it deflates and gives the memory back.
So it's another neat feature for economizing your memory usage.
Another thing that's available is the compression of memory.
So if I've got pages of memory stored in the hosts, physical Ram
compression algorithms could be used to actually condense the amount of space that those memory pages take.
So I might have,
you know, dozens and dozens and dozens of
pages of ran here.
Let's just say it's 20 pages of ramp.
By using compression, I might be able to reduce this to only using nine or 10 pages of RAM, or maybe 11 or 12
still storing the same amount of information. But it's being compressed the same where you compress images into a J pedophile or you compress a file from a CD into an MP three format. You're not losing any information. You're just using sub some advanced mathematics to have a take last storage space.
Another option is to provide slop space on the host using an SSD drive
so you can have an additional disk on the host
using SSD technology, which is the fastest storage available, currently
much faster than spindle disc.
And this SSD drive could be dedicated just for swapping.
So in the event that swapping does happen, why not put it on the fastest possible dr that you can? That's the idea here,
And ultimately, if these techniques do not provide enough memory for the V EMS that need it,
we will have to
have each individual virtual machine page. It's memory to its own storage, just the way that that a Windows machine will have a page file created or limits machine has a swap file created. The same thing will happen with the V M. This is the worst possible scenario. That means that all these other methods
have have been exhausted as far as what they can provide for
utilizing memory more efficiently. And now I'm down to my last possible option,
which means that the performance will really suffer. Although the memory requirements may be met, the virtual machines will continue to run, will run very slowly to that memory pressure gets alleviated,
and we can go back to using some of the other technologies that give a more efficient and smooth performance for the virtual machines.
So one of the things that we're looking at here is the symmetrical multi processor configuration of your host and how that relates to the V EMS and how they work.
We can see I've got a uni processor VM, a dual processor VM and acquired processor VM.
These air virtual processors, the black boxes.
So in the case of a single core dual socket system, I've got two sockets to CPU chips.
Each one has one core each,
so you know Ah ah, single processor VM would just arbitrarily get scheduled to use one of those two cores. The CPU scheduler decides which one
and it might stay with that were move around as needed.
However, if I have a V M that's got to virtual CP use,
I might be better off using a dual core.
So two cores, but only one socket, meaning there's one physical chip with two cores
in order to more efficiently use that processor architecture. Each of the Virtual CP use would map to each of the course
that will you get the best possible performance.
Same thing would apply if I had a dual core. I'm sorry. Quad core single socket
with VM with four virtual si pues Each one would get assigned its own core within that, sock it to get the best performance.
Now this is the basic way that this works. If you have a processor architecture that allows for hyper threading, now you've got some other options.
Now we have
the ability for each court. Execute two threads or two instructions at the same time,
and if we think about each of these cores having two threads running one of the top eggs, one at the bottom edge.
I could have a dual core
to course, one socket
with hyper threading enabled
so my single processor BM would use,
um, one thread.
The duel VM
would use the second threat on the first core and a single thread on the second court.
So this way I'm still using one processor for each of the virtual CP use. But I'm
I'm allowed to do too
threads on each court the same time. So this spreads out the load a little bit more evenly
if we think about CPU load bouncing in the bigger picture,
The Super scheduler is trying to figure out a way to use each virtual CPU independently based on the available cores and sockets that the host provides.
It's trying to spread that out,
And if I've got a multi virtual see PVM, it should try to use two different cores if it can't
so here I've got a dual core dual socket,
so two cores each to sockets,
hyper threading architecture.
My, my single processor VM can use any of these two course. However, the duel one might use the second threat here in the first threat here,
or another scenario could be that one of these might actually be used on a different process altogether. Different processor socket.
It just depends on what they're,
CPU architecture, supports and what you're
configuration settings might dictate.
So, to review,
we talked about
how the virtual memory gets used
from the physical host memory of the of the host,
and then we know that we can overcome it, that memory
because of the way that we can, uh,
get better use of it with these reclamation technologies.
And we also know that the VM could only power up if the swap
is not exceeding the difference between allocated and the reserved ramp. So if I've allocated 5 12 for of'em, I need 2 56 to boot. That means my swap file can't be bigger than 2 56 in this particular example,
And the reservation means that's a minimum, that I need to get the machine to power up, and I can set a limit for how much it will actually allowed to use.
If the limit get succeeded, then we start using these other technologies to try to make more efficient use of the hosts, physical Ram
and We also cover how multi CPU, multi virtual CPU PM's will utilize the sockets and cores in a particular host environment.
And then with hyper threading enabled, we've got two threads per
per a cool.
And that can help with spreading out the load more evenly as we've seen some of these other examples.
Okay, that concludes lesson one. See you in less than two. Thank you.