VMware Cloud Community
hoosier7772
Contributor
Contributor

Quick question about allocating cpu to vm's

Hello,

I was just wondering about how many cores you can allocate or should allocate to vm's. If I have server with 1 cpu 10 cores, am I only able to allocate those cores to individual vm's? For example if I have a domain controller (allocate 4core), file server (allocate 4 cores), printer server (allocate 2 cores)... Am I pretty much done now adding vm's to this host now that 10 cores has been used? Thanks in advance for the help

Tags (1)
0 Kudos
2 Replies
DavoudTeimouri
Virtuoso
Virtuoso

Hi,

You can assign vCPUs to your VMs more than physical CPUs and cores but 1:1 ratio (Physical:Virtual) is best for give best performance on your ESXi.

Also 1:2 ratio is good but you will face with higher CPU Ready time and low performance on your virtual machine.

For best result, you should do right sizing. It means, you should not assign vCPUs to your VMs when your VM doesn't need to them.

For example: you should assign 1 CPU to your VM and check you VM performance, if your virtual machine is under high load and 1 CPU is not enough, then assign another CPU and then check the performance.

Of curse, there is some recommendation from VMware about virtualizing some services under ESXi such as SQL server that the documents are very useful.

You can do same actions for assigning memory to your VMs.

Usually, VM resources are depended to your VM workload.

-------------------------------------------------------------------------------------
Davoud Teimouri - https://www.teimouri.net - Twitter: @davoud_teimouri Facebook: https://www.facebook.com/teimouri.net/
0 Kudos
iiToby
Enthusiast
Enthusiast

Hi Hoosier7772,

You are not limited to the number of physical cores on the system to the number of vCPUs you can add to the total VMs in your environment. Because you have described your CPU having 1 Socket and 10 Cores, the most you could possibly add to a single VM is 10 vCPUs (It might be 5 sockets / 2 Cores each or 10 sockets). You can add many VMs with different CPU configurations but your limit of a single VM will be 10 vCPUs, you can have multiple VMs with 10 vCPUs each if you like.

The ratios mentioned of 1:1 and 2:1 should be used as guide lines. Best Practise, assign only a single vCPU to VM until such time it needs more. Don't build a VM for peak usage build for actual usage.

Over subscribing vCPUs causes issues within a VMware environment as this is a shared resource everyone wants their share, if everyone has a very large share then this presents problems.

The examples you have given (I know they were just examples) I would only allocate 1 vCPU to a domain controller, file server and print server. I would only be allocating more than 1 vCPU to Application Server or Database Servers as they would have a need for them.

Have fun

@iiToby

0 Kudos