VMware Cloud Community
nguyenquangminh
Contributor
Contributor

What is relation between Reservation (of a VM) and the available un-reserved resources ??

Hi all,

I have question regarding reservation, which bases on the example below.

Say we have a DRS-enabled cluster of 2 ESXi 5.0 hosts, in which 2 VMs (with default resource settings) are running.

Now we just care about CPU resource. We go to Resource Allocation tab of the cluster, and find that Reserved Capacity is 0 MHz (because the 2 running VMs don't have cpu reservation configured), and Total Capacity and Available Capacity have the same number, say 15350 MHz (seem that when there's no reservation, all cpu resource is available for all vms).

Now I introduce a third VM, which will be configured with cpu reservation.

My first note is that, we can configure the 3rd VM (say vm3) with a cpu reservation of 15350 MHz (total available cpu resource of the cluster, not of a host) ---> this is un-practical at all, and will not work, because a VM just runs on one host at a time, so the VM's reservation should be limited by available CPU resource of the host (not of the cluster). If a settings will not work, why we are allowed to configure it ?

Now to try make it work, I have to reduce vm3's cpu reservation to meet the available cpu resource of the host it is running on. Because both ESXi hosts are the same, we can assume that the available cpu resource of each host is 15350/2 = 7675 MHz. If I configure vm3's cpu reservation to 7675 MHz and power it on, DRS will warn that there is not enough cpu resource (on any host) to start this vm. We all know why; the real available cpu resource of this host must be lower than 7675 MHz because there is already 1 VM running on it  ---> Again, why we are allowed to configure a settings that will not work for sure ? Further, why the Total Capacity and Available Capacity (of cluster) have the same number (15350 MHz) while in fact the real Available Capacity must be lower because there are already 2 VMs running in the cluster ??

Now to make it work, I will try to lower vm3's cpu reservation to about 4000 MHz, high enough to create cpu contention (competition) among 3 vms. It works, and vm3 can be powered on successfully. Pls note that all 3 vms have 2 vCPU with default CPU Share settings (normal), so each vm has cpu share value of 2000. It means that when we power on vm3 (with 4000 Mhz reservation), vm3 will compete with 2 other vms, and vm3 lower/reduces the un-reserved cpu resource available for the other 2 vms ---> My question: how much can this vm3 reduce the un-reserved cpu resource available for other 2 vms ? In other words, if vm3's reservation is high enough, can vm3 exhaust cpu resource available for other vms (even zero out cpu for others, and shut them down), or there is alwayse a limit here, and if so, what is that hidden limit ??

In short: when we look at what is called Available Capacity reported by the cluster, nothing guarantee that this Capacity is really Available when it comes to Reservation ! And if we have to configure cpu reservation for a vm, which will reserve cpu resource from the un-reserved available cpu resource, we don't know what is the limit (while we know for sure the limit exists because there are already some VMs running in the cluster) !

Something unclear, not precise, and im-practical that raise my questions.

Thanks all for your comments.

Minh

0 Kudos
1 Reply
nguyenquangminh
Contributor
Contributor

To make it more confusing, pls read paragrahps below from vSphere Resource Management - ESXi 5.0 (page 12):

Resource Allocation Reservation


A reservation specifies the guaranteed minimum allocation for a virtual machine.
vCenter Server or ESXi allows you to power on a virtual machine only if there are enough unreserved resources
to satisfy the reservation
of the virtual machine. The server guarantees that amount even when the physical
server is heavily loaded. The reservation is expressed in concrete units (megahertz or megabytes).
For example, assume you have 2GHz available and specify a reservation of 1GHz for VM1 and 1GHz for VM2.
Now each virtual machine is guaranteed to get 1GHz if it needs it. However, if VM1 is using only 500MHz,
VM2 can use 1.5GHz.

Reservation defaults to 0. You can specify a reservation if you need to guarantee that the minimum required
amounts of CPU or memory are always available for the virtual machine.

Pls first focus on this sentence: However, if VM1 is using only 500MHz, VM2 can use 1.5GHz.  --> If this sentence is right, it means that reservation is not really reservation (or dedication), reservation can still be shared  ---> that way, it affects original definitions and our logical thinking ...

Now focus on other sentence: " ... only if there are enough unreserved resources to satisfy the reservation ... "  --> from my view, this sentence seems to mean that reservations are seperated, without sharing mechanism among them --> if it's true, it's conflict with the above sentence.

0 Kudos