VMware Cloud Community
grittyminder
Contributor
Contributor
Jump to solution

Allocating CPU/Memory to a VM and/or Resource Pool

Greetings!

I have a question about resource allocation and resource pools in VI 3.5. Traditionally when commissioning a new physical server, you decide how much processing power to add based on the expected peak load for that server. However, in in the world of virtualization, this rule doesn't necessarily apply.

Say, for example, I have 4 servers that have been specked out in the physical world at 3Ghz and 2GB RAM per machine by somebody who knows absolutely nothing about virtualization. Rather than purchasing a couple of additional physical servers we plan on incorporating the web servers into our VI environment. The person who specked the machines (and who also has the contract for maintaining the system running on these machines) wants 4 separate virtual machines each with 3Ghz CPU and 2GB RAM. I'm thinking, well, were using virtualization now, we should be able to do something a little bit more clever.

Now, from what I understand in VI it is possible to allocate resources, such as CPU and memory, to groups of VMs (i.e. resource pools). Would it be possible to spec the 4 VMs at 1Ghz CPU 1 GB RAM each, put them into a resource pool with 12Ghz CPU and 8GB RAM, and then later shrink the resource pool to adjust for the 'real' server load? Or am I off my rocker in this case?

0 Kudos
1 Solution

Accepted Solutions
Yattong
Expert
Expert
Jump to solution

Hey

You cannot spec the cpu for a vm as you can with RAM. The VM will see straight to the proc/core.

You can however, throttle the cpu usage on each vm via the 'edit settings \ Resources tab'

If you spec a vm with 1GB RAM, it will only use 1GB RAM, even if its in a resource pool of 10GB RAM.

I would suggest you provide reasonable spec vms, monitor the performance and then you can then set limits via the vm or resource pool.

e.g. 2GB RAM vm, and if it never uses more than 1GB, you can set a limit to this vm/resource pool.

Increasing or decreasing specs of the vm e.g. RAM will need downtime of the vm,

whereas you can set limits dynamically via the resource tab or resource pools. ~my english is really bad this morning Smiley Wink



If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points

~y

If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points ~y

View solution in original post

0 Kudos
7 Replies
Yattong
Expert
Expert
Jump to solution

Hey

You cannot spec the cpu for a vm as you can with RAM. The VM will see straight to the proc/core.

You can however, throttle the cpu usage on each vm via the 'edit settings \ Resources tab'

If you spec a vm with 1GB RAM, it will only use 1GB RAM, even if its in a resource pool of 10GB RAM.

I would suggest you provide reasonable spec vms, monitor the performance and then you can then set limits via the vm or resource pool.

e.g. 2GB RAM vm, and if it never uses more than 1GB, you can set a limit to this vm/resource pool.

Increasing or decreasing specs of the vm e.g. RAM will need downtime of the vm,

whereas you can set limits dynamically via the resource tab or resource pools. ~my english is really bad this morning Smiley Wink



If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points

~y

If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points ~y
0 Kudos
robertortel
Hot Shot
Hot Shot
Jump to solution

As far as I understand VI this should work. I am limiting my VMs via shares, but currently without a ressource pool.

But why do you want to configure a 12 Ghz / 8 GB pool, if your 4 VMs all together are limited to 4 Ghz / 4 GB?

Robert

Yattong
Expert
Expert
Jump to solution

Share do not limit resource allocation, they set a prioritisation when there is contention.

Read up on this guys

http://www.vmware.com/pdf/vi3_35/esx_3/r35/vi3_35_25_resource_mgmt.pdf



If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points

~y

If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points ~y
grittyminder
Contributor
Contributor
Jump to solution

@Yattong

No need to apologize--I understood what you said crystal clear. What you are suggesting sounds like music to my ears. I must admit, I haven't studied up on resource allocation yet. I quess that I'm a little skeptical because, well, it sounds all too good to be true. Is there anything unusual, pit-falls and whatnot, that I should be aware of?

0 Kudos
grittyminder
Contributor
Contributor
Jump to solution

@robert

Yeah, the 1Ghz per VM was just an arbitrary number I made up. I chose 12Ghz for the CPU pool simply because 3Ghz * 4VMs = 12Ghz. Not a good example, I admit...

0 Kudos
Yattong
Expert
Expert
Jump to solution

Thats the beauty of VI3 / VMWare! Smiley Wink

Give the doc a read, and post back with anything specific that you're sceptical about.



If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points

~y

If you found this or any other answer useful please consider the use of the Helpful or correct buttons to award points ~y
0 Kudos
Ken_Cline
Champion
Champion
Jump to solution

Best practice is to allocate minimal resources to your VMs and add capacity as required. Typically, you'll create a new VM with one vCPU which will have the same performance characteristics as one core of your physical CPU. You then allocate RAM as required (a "typical" Windows VM will work quite well with 512MB RAM allocated). If, during the course of normal operations, you experience performance problems that can be attributed to insufficient resources (validate with esxtop), then you can allocated more of the needed resource (vCPU / vRAM), but it will require a virtual power cycle to make the change.

Resource pools are typically used to restrict the amount of a particular resource that a collection of VMs can use as an aggregate. Most folks don't set limits on their resource pools unless they are doing some sort of a chargeback system where consumers get only what they pay for. Setting a limit on a resource pool can leave you in a situation where VMs within the resource pool are needing resources, which are available on the host, but which are being denied because the resource pool's limit has been reached.

Take a look at the documents referenced in this post for some very good information that should help you decide how to set things up.

Ken Cline

Technical Director, Virtualization

Wells Landers

TVAR Solutions, A Wells Landers Group Company

VMware Communities User Moderator

Ken Cline VMware vExpert 2009 VMware Communities User Moderator Blogging at: http://KensVirtualReality.wordpress.com/
0 Kudos