Windows Server 2012 Hyper-V: Configure VM Processor Compatibility for Legacy Operating Systems

Windows Server 2012 Logo

In Windows Server 2008 R2 you had a setting in the Hyper-V Manager GUI to enable Processor Compatibility for legacy operating systems such as Windows NT 4.0 Server or Windows Server 2000. In Windows Server 2012 Hyper-V this setting is gone from the GUI, but you can still change it via Windows PowerShell.

By using the Get-VMProcessor cmdlet you can list the virtual CPU information of your Hyper-V virtual machines.

Hyper-V Get-VMProcessor

As you can see you can find a property called CompatibilityForOlderOperatingSystemsEnabled which is set to “False” by default and this is okay in 99% of all cases. But even if Windows NT 4.0 Server or Windows Server 2000 is not officially supported by Microsoft anymore there are some customers which have to run some VMs with legacy operating systems and by changing this setting via Windows PowerShell and the Set-VMProcessor cmdlet you can allow VMs to run old operating systems.


Set-VMProcessor NT4VM -CompatibilityForOlderOperatingSystemsEnabled 1

And of course you can also change it back


Set-VMProcessor NT4VM -CompatibilityForOlderOperatingSystemsEnabled 0

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


Get-VMProcessor *

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.


Get-VMProcessor * | Set-VMProcessor -CompatibilityForMigrationEnabled 1

Hyper-V Set-VMProcessor

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


Get-VM | Stop-VM

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


Get-VM TMG | Stop-VM

Get-VM TMG | Set-VMProcessor -CompatibilityForMigrationEnabled 1

Hyper-V Set-VMProcessor Single VM

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


Get-VM * | Stop-VM

Get-VM * | Set-VMProcessor -CompatibilityForMigrationEnabled 1

Get-VM * | Start-VM

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.

Cannot remove Hyper-V Host from SCVMM

System Center Logo

Today I run in to the problem where I could not remove a Hyper-V Hosts from System Center Virtual Machine Manager. The Hyper-V host was reinstalled before he was removed from SCVMM and the host was showing has HOSTNAME (pending) in the SCVMM Management Console. If you did a right click to remove the host, the Remove option was greyed out.

But don’t worry Windows PowerShell came to the rescue, with the following command you can remove the Hyper-V host from Virtual Machine Manager.


Get-SCVMHost <HOSTNAME> | Remove-SCVMHost -force

Add drivers to Windows 8 ISO Image

Windows 8 Logo

I already did a post how you can add drivers to you Windows 7 image with command line tools like dism and imagex. With Windows 8 you cannot use the command line tool imagex anymore but you have a new Windows PowerShell module for dism which allows you basically the same with. In this tutorial I will add drivers to a Windows 8 ISO image.

First I created three new folders:

  • Drivers – which includes all the extracted drivers for Windows 8
  • ISO – This includes the extracted Windows 8 ISO image
  • Mount – This is a empty folder which will be used to mount the WIM files

PowerShell Dism Folders

First we have to check in which Windows edition we want to add drivers. We can do this by using the Get-WindowsImage cmdlet:

 Get-WindowsImage -ImagePath .\ISO\sources\install.wim 

Get-WindowsImage

This will show you all the Images which are included in this WIM file.

After we have seen the Index numbers we can now mount the Windows Image our Mount folder. In my example I use Image Index 3 which is the Windows Server 2012 Datacenter Core Edition. If you use Windows 8 you see other editions.

 Mount-WindowsImage -Path .\Mount -ImagePath .\ISO\sources\install.wim -Index 3 

Mount-WindowsImage

After the image is mounted we can now add the drivers from the Drivers folder.

 Add-WindowsDriver -Path .\Mount -Driver .\Drivers -Recurse 

When all drivers are added to the Image you can dismount the image and save it.

 Dismount-WindowsImage -Path .\Mount -Save 

Dismount-WindowsImage

We have now added the drivers to the Install image, you should also added the drivers to your boot image. To do this just do the same steps to the .\ISO\sources\boot.wim.

After that you can create a ISO file


oscdimg -n -m -bc:\temp\ISO\boot\etfsboot.com C:\temp\ISO C:\temp\mynew.iso 

Hyper-V Converged Fabric with System Center 2012 SP1 – Virtual Machine Manager

System Center Logo

This blog post is a part of a series of blog posts about System Center 2012 Virtual Machine Manager, I am writing together with Michel Luescher (Consultant from Microsoft Switzerland).

Hyper-V Converged Fabric

Last year I already wrote a blog post about Windows Server 2012 Hyper-V Converged Fabric or Converged Networking. Hyper-V Converged Fabric in a simple way allows you to use network adapters for different type of traffic. In Windows Server 2008 R2 Hyper-V we didn’t really had this capabilities because the network teaming relied on 3rd party software and Hyper-V itself didn’t offered a mature QoS solution. In other words, we had to go with what I now would call a traditional Hyper-V host design.

Traditional Design

traditional Hyper-V host

Each dedicated Hyper-V network such as CSV communication or the Live Migration network used an own dedicated physical network interface. These different network interfaces could also be teamed with third party software, example with the software from HP, Broadcom or Intel. This design is still a good design in Windows Server 2012 but there are other configurations which are a lot more flexible.

In Windows Server 2012 you can get much more out of your network configuration. First of all NIC Teaming is now integrated and therefor out-of-the-box supported in Windows Server 2012. Another cool feature is the use of virtual network adapters in the Management OS (a.k.a. Parent Partition). This allows you to create a Hyper-V Hosts with all the necessary networks (Management, Live Migration, Cluster,…) by teaming just two or more physical adapters for a virtual switch and then create the additional virtual network adapters (vNICs) for the Hyper-V Management OS.

Continue reading

Add Cisco UCS drivers to Windows Server 2012 Hyper-V ISO Image

Windows Server 2012 Logo

I already did a post how you can add the Cisco UCS drivers to a Windows Server 2008 R2 Hyper-V Image using dism and imagex. With Windows Server 2012 you cannot use the command line tool imagex anymore but you have a new Windows PowerShell module for dism which allows you basically the same with. In this tutorial I will add the Cisco UCS drivers to a Windows Server 2012 ISO image or a Microsoft Hyper-V Server Image.

First I created three new folders:

  • Drivers – which includes all the extracted drivers for Windows Server 2012 (I removed all the drivers which are not related to Windows Server 2012)
  • ISO – This includes the extracted Windows Server 2012 ISO image
  • Mount – This is a empty folder which will be used to mount the WIM files

PowerShell Dism Folders

First we have to check in which Windows edition we want to add drivers. We can do this by using the Get-WindowsImage cmdlet:

 Get-WindowsImage -ImagePath .\ISO\sources\install.wim 

Get-WindowsImage

This will show you all the Images which are included in this WIM file.

After we have seen the Index numbers we can now mount the Windows Image our Mount folder. In my example I use Image Index 3 which is the Windows Server 2012 Datacenter Core Edition

 Mount-WindowsImage -Path .\Mount -ImagePath .\ISO\sources\install.wim -Index 3 

Mount-WindowsImage

After the image is mounted we can now add the drivers from the Drivers folder.

 Add-WindowsDriver -Path .\Mount -Driver .\Drivers -Recurse 

When all drivers are added to the Image you can dismount the image and save it.

 Dismount-WindowsImage -Path .\Mount -Save 

Dismount-WindowsImage

We have now added the drivers to the Install image, you should also added the drivers to your boot image. To do this just do the same steps to the .\ISO\sources\boot.wim.

After that you can create a ISO file


oscdimg -n -m -bc:\temp\ISO\boot\etfsboot.com C:\temp\ISO C:\temp\mynew.iso 

Add drivers to Windows Server 2012 ISO Image

Windows Server 2012 Logo

I already did a post how you can add drivers to a Windows Server 2008 R2 installation image with the command line tools dism and imagex. With Windows Server 2012 you cannot use the command line tool imagex anymore but you have a new Windows PowerShell module for dism which allows you basically the same with. In this tutorial I will add drivers to a Windows Server 2012 ISO image or a Microsoft Hyper-V Server Image.

First I created three new folders:

  • Drivers – which includes all the extracted drivers for Windows Server 2012 (I removed all the drivers which are not related to Windows Server 2012)
  • ISO – This includes the extracted Windows Server 2012 ISO image
  • Mount – This is a empty folder which will be used to mount the WIM files

PowerShell Dism Folders

First we have to check in which Windows edition we want to add drivers. We can do this by using the Get-WindowsImage cmdlet:

 Get-WindowsImage -ImagePath .\ISO\sources\install.wim 

Get-WindowsImage

This will show you all the Images which are included in this WIM file.

After we have seen the Index numbers we can now mount the Windows Image our Mount folder. In my example I use Image Index 3 which is the Windows Server 2012 Datacenter Core Edition

 Mount-WindowsImage -Path .\Mount -ImagePath .\ISO\sources\install.wim -Index 3 

Mount-WindowsImage

After the image is mounted we can now add the drivers from the Drivers folder.

 Add-WindowsDriver -Path .\Mount -Driver .\Drivers -Recurse 

When all drivers are added to the Image you can dismount the image and save it.

 Dismount-WindowsImage -Path .\Mount -Save 

Dismount-WindowsImage

We have now added the drivers to the Install image, you should also added the drivers to your boot image. To do this just do the same steps to the .\ISO\sources\boot.wim.

After that you can create a ISO file


oscdimg -n -m -bc:\temp\ISO\boot\etfsboot.com C:\temp\ISO C:\temp\mynew.iso