Windows Server 2012 Hyper-V: Configure VM Processor Compatibility via PowerShell

Windows Server 2012 Logo

If you have a mixed Hyper-V environment with Hyper-V hosts which have different CPU generations you may cannot live migration Virtual Machines from one Hyper-V host to another without setting the VM CPU Compatibility setting.

Note: I saw a lot of different environments where different generation of Intel CPUs were used, and most of the time Live Migration did still work. I would recommend to set this setting only if you really need it.

Hyper-V VM Processor Compatibility

If you need to do this for multiple Virtual Machines you may better use Windows PowerShell to do this.

To do this you can use the new Hyper-V PowerShell module and the Get-VMProcessor and Set-VMProcessor cmdlet. With the Get-VMProcessor cmdlet you can get information about the virtual CPU of VMs. You can list this for all virtual machines running on one host by using the following command

Hyper-V Get-VMProcessor

To change this setting for all virtual machines running on the Hyper-V host you can use the following PowerShell command. This does only working with virtual machines which are not running.

Hyper-V Set-VMProcessor

If you want to shut down all the VMs first you can use the following command.

If you just want to do this for a single VM you can use the following commands.

Hyper-V Set-VMProcessor Single VM

To do a full automation you could do it the following way:

As you can see you can also find the “CompatibilityForOlderOperatingSystemsEnabled” property to enable Processor Compatibility for legacy Operating Systems in Windows Server 2012 Hyper-V for example Windows NT 4.0 Server or Windows 2000.