Understand the basic concepts of using shares, limits, and reservations in a VMware vSphere deployment.
- [Voiceover] In this video, I'll explain how resource controls can be used to manage the performance of virtual machines. Virtual machines run on ESXi hosts. So we wanna think of our virtual machines as applications that run on a physical server. The ESXi host is the physical server that your virtual machines run on. ESXi is a hypervisor software that allows multiple virtual machines to run on a set of shared hardware. The ESXi host has a finite amount of physical CPU and memory resources, and these resources are shared by all of the virtual machines running on the host.
And in most cases, these resources are oversubscribed. So what do I mean when I say oversubscribed? Let's use a restaurant as an analogy. Let's say that I'm building a new restaurant, and I project that I'll have 200 diners that visit my restaurant each day. Some will come at breakfast time, some will come for lunch, and some will come for dinner. And because these diners are spread throughout the day, I can build a 50 seat restaurant, and most of the time, I'll have plenty of room.
But if 100 diners happen to show up at the same time for dinner, I'll have a problem. This is similar to your ESXi host. The ESXi host is often sized to handle a normal workload. But if many virtual machines are performing a resource-intensive task at the same time, we may have a problem. So I'll show you how to control the effects of resource contention in the configuring shares, limits, and reservations demo. When we create virtual machines, we'll allocate a certain amount of memory and CPU.
These resource allocations define the maximum amount of resources that a virtual machine can use. For example, let's assume that we configure a virtual machine with two gigs of memory. That virtual machine will never be able to consume more than two gigs of memory, but if the VM only needs 500 MGs of memory, the remaining 1.5 gigs that's left over can be used by other virtual machines. So now that we understand this concept of oversubscription, let's talk about some of the resource controls that we have at our disposal, including shares, limits, and reservations.
Reservations are used to guarantee physical resources to a virtual machine. For example, let's say you allocate two gigs of memory to a virtual machine, and then configure a one gig memory reservation on that virtual machine. It can still use a maximum of two gigs of memory, but it's guaranteed one gig of memory at all times. We don't wanna configure too many reservations, though, because they tie up resources. When you create a one gig memory reservation on a VM, that means that this VM will consume one gig of physical memory at all times.
That one gig cannot be used by other virtual machines, even if the VM with the reservation isn't using it. The other consideration we need to be aware of is admission control. If a virtual machine has a reservation that the ESXi host cannot satisfy, that VM will not be able to boot up. So we need to make sure that our hosts are adequately equipped to satisfy any reservations that we may have created. A limit is another resource control that we have available. You can place a CPU or memory limit on a virtual machine and the limit creates a hard ceiling on the resources that that virtual machine can consume.
So, why do we need these limits? Let's say, for example, we only want a virtual machine to be able to consume two gigs of physical memory. Well, why not just build that virtual machine with two gigs of memory and be done with it? And in most cases, that's the approach you should take. However, there are some good use cases for limits. Limits are useful if you need to place a ceiling on resource usage that is less than the resources that you have allocated to a virtual machine.
So, for example, let's assume you've created a virtual machine with a single virtual CPU. You can set a limit on the megahertz of processing resources that are available to that VM. So, in essence, while we've allocated it with one virtual CPU, we're actually giving it access to less than one CPU, in this case. The third resource control we have is shares, and shares are used to define relative priority compared to other virtual machines. For example, assume that you've created a virtual machine with two gigs of memory and no memory reservation.
Simply giving that virtual machine two gigs of memory does not guarantee that VM access to two gigs of physical memory at all times. So, what if the host is low on memory, and other virtual machines are competing for resources? During times of contention, our share structure is enforced. The actual amount of memory that this VM is entitled to will depend on the number of shares that it has configured, compared to other virtual machines that it's competing with. So, if our example VM has 2000 shares, and another VM has 1000 shares, the VM with 2000 shares will be entitled to twice as much memory.
We can set a specific number of shares, or we can simply set the share value to high, normal, or low. Shares are a great way to control resource contention. In this course, we'll take a much deeper look at these resource controls, and I'll demonstrate how to configure them.
VMware Certified Instructor Rick Crisci provides an overview of vSphere resource controls—shares, limits, and reservations—and their impact on performance and VSWP file size. Rick explains exactly what happens when virtual machines compete for resources, the role of swap files, and how resource controls help automate allocation.
In chapter 2, Rick shows how to manage performance with resource pools, including child pools. He explains the impact a reservation has on resource pools, and includes a demo on creating and configuring a resource pool. Chapter 3 is an overview of the vFlash architecture for leveraging SSD resources. Watch this chapter to learn how to configure vFlash reservations and to assign a reservation to a VM.
Note: This course maps to the Administer and Manage vSphere 6.x Resources domain of the vSphere Certified Professional 6—Data Center Virtualization (VCP6DCV) exam.
- Allocating memory and CPU
- Using ESXTOP
- Configuring reservations, limits, and shares
- Managing performance with resource pools
- Creating child and tiered resource pools
- Leveraging SSD resources with vFlash