VMware Cloud Community
HenrikElm
Contributor
Contributor
Jump to solution

CPU setting on pool AND vm, which wins?

If I set CPU resource restrictions on a VM and then put it into a pool that has more liberal or more stringent CPU restrictions, which setting takes precedence?

/Henrik

Reply
0 Kudos
1 Solution

Accepted Solutions
Troy_Clavell
Immortal
Immortal
Jump to solution

yes, a little backwards, I would say

View solution in original post

Reply
0 Kudos
11 Replies
Troy_Clavell
Immortal
Immortal
Jump to solution

Add Virtual Machines to a Resource Pool

When you create a virtual machine, the New Virtual Machine wizard allows you to specify a resource pool location as part of the creation process. You can also add an existing virtual machine to a resource pool.

When you move a virtual machine to a new resource pool:

  • The virtual machine’s reservation and limit do not change.

  • If the virtual machine’s shares are high, medium, or low, %Shares adjusts to reflect the total number of shares in use in the new resource pool.

see page 38 for more details

http://www.vmware.com/pdf/vsphere4/r40/vsp_40_resource_mgmt.pdf

Reply
0 Kudos
HenrikElm
Contributor
Contributor
Jump to solution

-

Reply
0 Kudos
HenrikElm
Contributor
Contributor
Jump to solution

Ah, ok. So.. As the VM settings are retained, a VM with a CPU reseravtion of 2 GHz would retain all of those 2 GHz altough it is inserted into a resource pool with a limit of, say, 1 GHz?

In other words, a setting on the VM wins over a setting on the respool. Interesting..

Better check carefully who has the right to set those limits then I guess.

/Henrik

Reply
0 Kudos
Troy_Clavell
Immortal
Immortal
Jump to solution

yes, in most cases if you have limit/custom shares/reservations, etc set on a standalone VM and then add it to a resource pool, those settings will not change.

Reply
0 Kudos
HenrikElm
Contributor
Contributor
Jump to solution

Hm.. Would you agree that this could be a bit troublesome in some cases? The hierarchy kind of suggests intuitively that the VMs are subordinates to the pool? Ah well.. It is what it is, I only needed to know how it works.

Thanks for a fast reply!

/Henrik

Reply
0 Kudos
Troy_Clavell
Immortal
Immortal
Jump to solution

yes, a little backwards, I would say

Reply
0 Kudos
weinstein5
Immortal
Immortal
Jump to solution

With the example you give - VM has a reservation of 2 GHz and the pool has a limit of 1 GHz - I do not think you would be allowed to move the VM into the resource pool unless the resource pool pool was set to allow expanded reservations - the resource pool has to have the resources available to satisfy the reservation requirements of the VM residing in the pool - definitely in the xample you give you would not be able to power on the VM -

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
Reply
0 Kudos
HenrikElm
Contributor
Contributor
Jump to solution

To settle this, I did a test.

1) I set the VM CPU limit to 1.7 GHz.

2) I created a Pool with a non-expandable limit of 1 GHz.

3) I moved the VM into the pool without any error message just fine. The VM CPU limit of 1.7 GHz was still set on the VM afterwards when I looked.

4) I ran a small script in the VM to pressure the CPU 100%. It took 28 seconds to run.

5) I reconfigured the VM to "Unlimited" CPU. After this, it said 1GHz as max limit, just like the pool was set to. After this, I could not reconfigure the CPU back to over what the Pool is set to.

6) I ran the same script again. It ran in 28 seconds again.

So.. I conclude that the VM settings are moved into the pool with the VM, but are not honored. The pool CPU settings "wins" over the VMs individual setting. Although the VM retains its CPU setting, it is not in effect. Quite confusing I'd say. If I see a setting, I'd expect it to be effective?

This above seem to be the case as I tested it in real life anyway.

Henrik

Reply
0 Kudos
frankdenneman
Expert
Expert
Jump to solution

Henrik,

DRS relies upon host-level scheduling and host-level resource pools (RPs) to implement DRS-level RPs and enforce RP and VM-level resource settings. DRS effectively leaves VM-level settings alone, passing them through to the host, where they are enforced by the host-level cpu and memory schedulers. So limits on the VM takes precedence over Resource pool settings.

The maximum resource entitlement of the virtual machine is the limit configured on the VM.

When you set a reservation on a VM inside a resource pool with a reservation, the VM-level reservation is passed to the host and the minimum resource entitlement is equal to the configured reservation. The reservation used by the virtual machine is subtracted from the RP level.

So when a VM has a VM-level res of 2GB and the RP-level res is set to 10GB, the available RP reservation after VM power-on is 8GB.

This 8GB is available for other VMs.

Does this make any sense?

Frank Denneman

http://frankdenneman.nl

@frankdenneman

Co-author: vSphere 4.1 HA and DRS technical Deepdive

Blogging: frankdenneman.nl Twitter: @frankdenneman Co-author: vSphere 4.1 HA and DRS technical Deepdive, vSphere 5x Clustering Deepdive series
Reply
0 Kudos
frankdenneman
Expert
Expert
Jump to solution

The pool limit overruled the vm limit, because it was more restrictive.

Set the VM-level to 500 and the RP level on 1000 and see what happens.

Frank Denneman

http://frankdenneman.nl

@frankdenneman

Co-author: vSphere 4.1 HA and DRS technical Deepdive

Blogging: frankdenneman.nl Twitter: @frankdenneman Co-author: vSphere 4.1 HA and DRS technical Deepdive, vSphere 5x Clustering Deepdive series
Reply
0 Kudos
bilalhashmi
Expert
Expert
Jump to solution

Henrik,

This makes complete sense to me. You never set the reservation for the VM. You only set a limit of 1.7 GHz. What that means is that the VM will not use CPU more than that. Not anywhere is the VM guarenteed that resource.

When you placed the VM in a RP that had a limit of 1GHz, the VM used up to 1GHz only and couldnt go beyond that because the RP ristrcited it from doing so.

Now had set a reservation of of 1.7 GHz for the VM and then tried to place that VM in a RP that was limited to 1 GHz only, it should have slapped your hand.. hope that helps..

Follow me @ www.cloudbuddy.com

Blog: www.Cloud-Buddy.com | Follow me @hashmibilal
Reply
0 Kudos