Hyper-V

About Hyper-V Virtual Processor Limitations

I was reviewing older posts on the Petri IT Knowledgebase when I noticed an article called Virtual Processor Limitations in Hyper-V. It occurred to me that I should write an updated post that covers a few related topics. In this article, I will clear up a few myths about Microsoft guidance and talk about support virtual processor maximums in Hyper-V.

Virtual Processors versus Logical Processors

Consider a physical computer for a moment. This machine has one or more CPUs or sockets. Each CPU has a number of cores. Most Intel desktop or server processors feature something called hyper threading. This is a design that improves parallelization, enabling a single core to process two threads of execution at once. This isn’t truly a doubling of processing horsepower, but it does improve capacity when using modern software on a modern processor. In virtualization, it is important to understand how many logical processors a host has. If you have an AMD 8-core CPU, then that CPU has 8 logical processors (LPs). If you have an Intel 8-core CPU, then it will have 8 LPs if hyper threading is disabled and 16 LPs is hyper threading is disabled.

Each virtual machine you create also has one or more single-core virtual processors. Each virtual processor executes on a host’s LPs. What does this mean? If a host has 16 LPs, then the most number of virtual processors (vCPUs) that can be executing on the host hardware at once is 16. I’ve tried to use precise wording here because there is a subtlety; I can actually overcommit my processors by having lots more virtual machines in a running state. The hypervisor will swap virtual machines in and out on the physical processors based on demand and resource control.

Let’s make this clear with a few examples.

Sponsored Content

What is “Inside Microsoft Teams”?

“Inside Microsoft Teams” is a webcast series, now in Season 4 for IT pros hosted by Microsoft Product Manager, Stephen Rose. Stephen & his guests comprised of customers, partners, and real-world experts share best practices of planning, deploying, adopting, managing, and securing Teams. You can watch any episode at your convenience, find resources, blogs, reviews of accessories certified for Teams, bonus clips, and information regarding upcoming live broadcasts. Our next episode, “Polaris Inc., and Microsoft Teams- Reinventing how we work and play” will be airing on Oct. 28th from 10-11am PST.

  • I have a host with 16 LPs.
  • At any one point in time I can have 8 virtual machines with 2 vCPUs executing on the physical processors. Or that might be 16 x 1 vCPU virtual machines, or 4 x 4 vCPU VMs, or any mix that makes up to 16 vCPUs.
  • However, I might have 50 virtual machines with one or more vCPUs actually running on that host. The hypervisor will swap them in and out of the physical processor, so I don’t notice the over-commitment.
An example of overcommitment of processors to virtual machines. (Image Credit: Aidan Finn)
An example of overcommitment of processors to virtual machines. (Image Credit: Aidan Finn)

 

That might sounds scary if you’re new to virtualization, but we’ve been doing that sort of thing for decades with software, and it’s been the norm for the last 10+ years of machine virtualization.

Maximum Processor Counts

There are four factors to consider:

  • How many logical processors are supported by your specific version of Hyper-V?
  • What are the maximum number of vCPUs supported on a host?
  • How many vCPUs are supported per LP on the host?
  • What are the performance requirements of your guests’ services?

The first two questions are easy to answer with a search engine by querying ‘Hyper-V 2012 R2 Maximums.’ In the case of Windows Server 2012 R2 (WS2012 R2) Hyper-V, a single host can have up to 320 logical processors and can support up to 2048 vCPUs on 1024 virtual machines running on a single host.

Note: When you log into a host and run Task Manager, you will see a maximum of 64 logical processors on the host; rest assured that all the logical processors are there and used by the virtual machines — it’s just that a single install of Windows Server can only use up to 64 logical processors.

In the case of Windows Server 2008 R2 (W2008 R2) Hyper-V, a host can have up to 64 logical processors, and a single host can support up to 512 running vCPUs on 384 running virtual machines.

Older versions of Hyper-V applied a vCPU:LP ratio. In the case of server workloads, Microsoft supported 8 server vCPUs per LP in the host to be running at any one time. So if my host had 8 LPs, Microsoft would support me having 32 x virtual machines, each with a 2 vCPUs. For VDI workloads, we had a 12:1 ratio. That would mean my 8 LP host could run up to 96 virtual machines with a single vCPU each. Microsoft dropped this ratio with the release of Windows Server 2012 (WS2012) Hyper-V, which is because of the fourth question above.

In reality, all these ratios and counts are theory for exams. There is no “you can run X virtual machines” on a host rule in Hyper-V. Virtual machines on all platforms are just like physical servers in terms of resource requirements. Some services are heavy consumers of cores, some services require lots of cores for multi-threading, and some services are lightweights. Microsoft’s guidance is quite realistic: you can fit as many virtual machines onto your hardware as your hardware can support, and this is dictated by the workloads that you will run in those virtual machines. In the real world, you’ll hit a performance ceiling long before you hit the theoretical maximums of supported vCPUs per host.

Hyper-V Virtual Processor Best Practices

Microsoft does not have and never has had a general rule of having one LP per vCPU. However, some products from Microsoft have issued support guidance. Some products will support 2 vCPUs per LP, and some want a 1:1 assignment. This is a per-product guidance and affects only those virtual machines running those products. You can use Resource Control to enforce this guidance.

Another best practice is to not go crazy with assigning vCPUs. The MSDN Performance Tuning Guidelines for Windows Server 2012 R2 advises that you should only assign enough vCPUs to a virtual machine to meet the needs of that machine’s services. Wastefully assigning vCPUs will reduce the performance of the host and other virtual machines.

A machine with an unacceptable processor queue length. (Image Credit: Microsoft)
A machine with an unacceptable processor queue length. (Image Credit: Microsoft)

A related tip is to monitor the processor queue length within the guest operating systems of your virtual machines, especially mutli-threaded ones such as those running SQL Server. If this metric rises beyond acceptable levels then assign more virtual CPUs to the virtual machine.

Related Topics:

BECOME A PETRI MEMBER:

Don't have a login but want to join the conversation? Sign up for a Petri Account

Register
Comments (3)

3 responses to “About Hyper-V Virtual Processor Limitations”

  1. “If you have an Intel 8-core CPU, then it will have 8 LPs if hyper threading is disabled and 16 LPs is hyper threading is disabled” maybe is “If you have an Intel 8-core CPU, then it will have 8 LPs if hyper threading is disabled and 16 LPs IF hyper threading is ENABLED ” …

  2. Informative article Aidan.

    “it’s just that a single install of Windows Server can only use up to 64 logical processors.
    ” is this not because the Host itself is a “pseudo” VM running 2012 R2, max vCpu for 2012 R2 VM is 64, hence the other LPs not visible???

  3. <p>If you have an Intel 8-core CPU, then it will have 8 LPs if hyper threading is disabled and 16 LPs is hyper threading is disabled.(16 Logical processors if Hyper Threading ENALBED)</p>

Leave a Reply

Aidan Finn, Microsoft Most Valuable Professional (MVP), has been working in IT since 1996. He has worked as a consultant and administrator for the likes of Innofactor Norway, Amdahl DMR, Fujitsu, Barclays and Hypo Real Estate Bank International where he dealt with large and complex IT infrastructures and MicroWarehouse Ltd. where he worked with Microsoft partners in the small/medium business space.
External Sharing and Guest User Access in Microsoft 365 and Teams

This eBook will dive into policy considerations you need to make when creating and managing guest user access to your Teams network, as well as the different layers of guest access and the common challenges that accompany a more complicated Microsoft 365 infrastructure.

You will learn:

  • Who should be allowed to be invited as a guest?
  • What type of guests should be able to access files in SharePoint and OneDrive?
  • How should guests be offboarded?
  • How should you determine who has access to sensitive information in your environment?

Sponsored by:

 
Live Webinar: Active Directory Security: What Needs Immediate Priority!Live on Tuesday, October 12th at 1 PM ET

Attacks on Active Directory are at an all-time high. Companies that are not taking heed are being punished, both monetarily and with loss of production.

In this webinar, you will learn:

  • How to prioritize vulnerability management
  • What attackers are leveraging to breach organizations
  • Where Active Directory security needs immediate attention
  • Overall strategy to secure your environment and keep it secured

Sponsored by: