Windows Server Datacenter Edition - Unlimited Virtual Machines [duplicate]

Windows VMs running on Datacenter are licensed through Automatic Virtual Machine Activation, which lets a VM activate via the Hyper-V service on the host.

All you need to do is to provision the VM with the appropriate AVMA product key, which are provided in Microsoft's documentation.