Microsoft Hyper-V contains myriads of configuration options that are able to be taken advantage of by Hyper-V administrators. The virtual machines themselves offer a wide variety of configurations that enable administrators to define the capabilities of the Hyper-V virtual machine itself. Two of these configuration related terms when working with a Microsoft Hyper-V environment are the Virtual Machine Generations and the VM Configuration Version. Both of these configuration related terms with Hyper-V deal with the virtual hardware and various capabilities that are enabled on the virtual machines themselves.
What are Hyper-V VM Configuration Version and Generations?
How are they related to virtual machines that are provisioned in a Hyper-V environment?
What are important things to note about each?
Let’s take a look at Hyper-V VM Configuration Version and Generations and what configuring both for a virtual machine means for the Hyper-V administrator.
Hyper-V VM Configuration Version
Those who are familiar with VMware hypervisor environments are familiar with the compatibility level of the virtual machines contained in a VMware vSphere environment. The compatibility level defines the feature set and capabilities of the virtual machine hardware contained in vSphere.
Much the same as VMware has done, Microsoft Hyper-V contains what is called the VM configuration version that defines the virtual machine configuration, saved state, and snapshot capabilities of the Hyper-V virtual machine. The VM configuration version sets the blueprint for what features the virtual machine has made available to it.
The rule of thumb with Hyper-V VM configuration versions is that newer Hyper-V hosts that have the ability to run the latest VM configuration level are backwards compatible with virtual machines configured for older VM configuration versions. However, older Hyper-V hosts cannot run the new configuration versions.
With earlier versions of Hyper-V, when Hyper-V was updated, the virtual machine configuration version was automatically updated. However, since Windows Server 2016 Hyper-V, Microsoft has decoupled this process from the upgrade. This approach has advantages over the automatic upgrades. This can allow moving virtual machines between Hyper-V versions very easily as in certain environments this may be a use case. With the new stance from Microsoft, they have committed to the backwards compatibility of the VM configuration version including saved states and checkpoints.
Hyper-V administrators are encouraged to upgrade the VM configuration version to take advantage of the newest features of Hyper-V virtual machines. Features that have been added with newer configuration versions in the newest releases include:
- Hot Add/Remove Memory – VM Configuration Version 6.2
- Secure Boot for Linux VMs – VM Configuration Version 6.2
- Production Checkpoints – VM Configuration Version 6.2
- Virtual Trusted Platform Module (vTPM) – VM Configuration Version 7.0
- Virtual machine multi queues (VMMQ) – VM Configuration Version 7.1
- Nested Virtualization – VM Configuration Version 8.0
- Virtual Processor count – VM Configuration Version 8.0
- Large memory VMs – VM Configuration Version 8.0
To check the VM configuration version of your virtual machines running in Hyper-V, you can easily see the versions in bulk by using PowerShell.
Take a look at the below PowerShell commandlet that queries the virtual machines and returns the VM configuration version.
- Get-VM * | Select-Object Name, Version
Upgrading the Hyper-V VM Configuration Version
Upgrading the Hyper-V VM Configuration Version allows you to take advantage of all the newest features available in the latest Hyper-V releases.
What does the upgrade process look like in upgrading the VM configuration version? It is quite easy and can be accomplished from the Hyper-V manager tool. You can simply right-click on a virtual machine that is of an older VM configuration version and you will see the option to Upgrade Configuration Version… menu option.
Hyper-V will display the confirmation dialog box, which allows you to confirm the upgrade process on the VM configuration version.
Hyper-V will automatically create a new virtual machine running the latest VM configuration version. What if you need to create a virtual machine on a new Windows Server 2016 host running a lower VM configuration version? You can do that easily with PowerShell.
Hyper-V Virtual Machine Generation
Another configuration consideration with Hyper-V virtual machines is the generation of the virtual machine. The legacy generation of virtual machine that has been around since the beginnings of Hyper-V is the generation 1 virtual machine. With generation 1 virtual machines, much of the same physical hardware found in physical servers of the time were emulated in the virtual hardware. By the introduction of Windows Server 2012 R2, Hyper-V generation 2 virtual machines were introduced. This provided a whole new set of features and functionality for the Hyper-V virtual machine that is not tied to much of the older physical emulation that generation 1 VMs were concerned with and introduced much of the newer, modern technology into VMs.
This allowed for a much more modern underlying virtual hardware configuration for a VM as well as a much more secure platform for production workloads. Benefits of the generation 2 virtual machine include:
- UEFI firmware
- Newer Hardware
- Better Performance
- Better Security
- Lighter footprint from a resource perspective
You might think you should always use the generation 2 virtual machine. What can make the decision to use the older generation 1 virtual machine, even if you could benefit from the newer features of generation 2? You may use generation 1 instead of generation 2 if:
- You want to run legacy operating systems or 32-bit
- VHD virtual disks require generation 1 virtual machines
- If you want to integrate with Azure, currently Azure is still a generation 1 virtual machine environment
- Older hardware emulation for devices such as floppy drives, COM ports, etc
You can easily use PowerShell to see the generation versions for Hyper-V by using the following PowerShell commandlet:
- Get-VM | Format-List Name, Generation
There is no built in, supported way to convert generation 1 VMs to generation 2 VMs, however, there are certainly PowerShell scripts out there that allow you to do this. Note, again, this is not supported by Microsoft, but is doable. Just make sure you have good backups of your virtual machine before proceeding.
Running virtual machines on top of the Hyper-V platform gives organizations a powerful and versatile solution for production workloads. Hyper-V has various configuration options for virtual machines. This includes both the VM configuration version and the generation level of the virtual machine. Both of these considerations have to do with the version of virtual hardware that brings its own set of features and functionality to the virtual machine per the configuration imposed. There are certainly considerations that Hyper-V administrators need to make before upgrading the VM configuration version and the generation level to the latest and greatest. These include considering whether legacy Hyper-V hosts will need to serve as platforms for running virtual machines. The virtual machine configuration level is backwards compatible, but older hosts cannot run newer configuration versions.
If you are running a hybrid cloud environment with Microsoft Azure, be sure to consider the interoperability aspect of the VM configuration version and VM generation. Microsoft Azure support may not be there for certain configuration levels and this should certainly be considered. While there is an easy way to upgrade the VM configuration level, there is no way to downgrade the VM configuration level, so be advised to think through the process beforehand. Additionally, there is no built in way to convert from generation 1 VMs to generation 2, although there are unsupported PowerShell scripts available that will allow you to do this.