Here is retail licensing:

Windows Server 2022 Licensing & Pricing | Microsoft

This is a great video explaining how many licenses you may need when dealing with virtual machines:

Windows Server 2019 Licensing Explained – YouTube

Licensing is done per physical core and sold in packs of 2, 4, or 16.

I am looking to purchase a server with two processors with 12 cores each so I will need to buy one 16 core (minimum required) and two 4 core licenses to meet my hardware core count.

If you are licensing a machine to be a Hyper-V host then you need to decide if you are going to use standard or datacenter.

Standard licensing allows for two VMs and Datacenter allows for twelve. If you have ten or more virtual machines planned then go for datacenter.

So let’s say I want 8 VMs on this new hardware this is what I will need to buy:

  • 16 core license pack
    • minimum purchase allowed for the first license
  • Two 4 core license packs
    • This licenses my hardware properly and I am allowed 2 VMs from the previous core license
  • 16 core license pack
    • allows another 2 VMs
  • 16 core license pack
    • allows another 2 VMs
  • 16 core license pack
    • allows another 2 VMs

Once a machine is licensed there is a waiting period of 90 days before you can move any licenses to other hardware.

If you purchase Software Assurance (SA) you will be entitled to move VMs between Hyper-V hosts without the 90 day restriction.

Reference:

Understanding Windows Server 2022 Licensing – Petri IT Knowledgebase

Comparison of Standard and Datacenter editions Windows Server 2019 | Microsoft Docs

Automatic Virtual Machine Activation in Windows Server | Microsoft Docs