In this article, we will show you how to automate the upgrade of the virtual machine configuration version in Hyper-V.
Table of Contents
What is Virtual Machine Configuration Version?
In the previous versions of Hyper-V, whenever you upgraded your host to a newer release, the moment Hyper-V sees your virtual machines, it will be upgraded automatically behind the scenes.
However this has been changed in Windows Server 2016, Hyper-V will not automatically upgrade your virtual machines. The upgrade of a virtual machine is a manual operation now that is separate from upgrading the host. This gives you the flexibility to move individual virtual machines back to earlier Hyper-V versions until they have been manually upgraded. This is what we call the Point of no Return.
Version 5.0 is the configuration version of Windows Server 2012 R2. Version 2.1a was for Windows Server 2008 R2 SP1. The configuration version was always there for internal usage based on the functionality and not based on the release, and it was not displayed to the users. In Windows Server 2016 Technical Preview 2 the version is 6.2.
The process to upgrade a virtual machine version requires shutdown of the VM, and doing a manual upgrade. This is a one-way process so you can either do this through PowerShell or through the Hyper-V Manager console and in the UI you can see we have got this Upgrade Configuration Version.
To upgrade the VM Configuration File through PowerShell, you need to run the following cmdlet from an elevated Windows PowerShell:
As a side note, the PowerShell cmdlet to upgrade the VM configuration version was updated in Windows Server 2016 Technical Preview 2 to Update-VMVersion, however, in Technical Preview 1, the cmdlet name was Update-VMConfigurationVersion.
The latter is shorter
Microsoft in Windows Server 2016 they have introduced a new configuration file format for Virtual Machines which is designed to increase the efficiency of reading and writing virtual machine configuration data. It is also designed to reduce the potential for data corruption in the event of a storage failure.
So after you update the VM Version, the new configuration files use the (.VMCX) extension (Replaced the old .XML files) for virtual machine configuration data and the (.VMRS) extension (Replaced the old .VSV/.BIN files) for VM runtime state data.
You can keep running the imported Virtual Machines on Hyper-V 2016 as much as you want, but you don’t get the benefit of the new features unless you upgrade the configuration version.
As we need to start preparing the migration from earlier versions to Hyper-V 2016, this becomes an iterative process.
I know it’s still early for Windows Server 2016 to be released, but nevertheless preparing your migration plan ahead of time will save you time and make sure your migration is successful.
Consider you have 50 or 100 VMs that you want to upgrade their configuration version.
PowerShell to the rescue!
So I created the following tool that will help you to automate the migration and the upgrade process.
I want to mention that this tool was created using SAPIEN PowerShell Studio 2015 which is a great support when you are creating advanced scripts or GUI Tool.
This tool will help you to live migrate Virtual Machines including their Storage from Windows Server 2012 Hyper-V to Windows Server 2016 Hyper-V or later.
When the Shared Nothing Live Migration is completed, you have the option to upgrade the VM Configuration Version of all Virtual Machines with earlier versions and get all the benefits and features of Windows Server 2016 Hyper-V!
How to use it
Run Update-VMConfigVersion1.0.exe on Windows Server 2016 Hyper-V Host.
If the Virtual Machine is in a running state, the VM will be turned off and upgraded to the current VM version 6.2 or later, and then it will be turned on.
Requires : PowerShell Version 5.0 or later. OS : Windows Server 2016 Hyper-V and Windows Server 2012 R2 Hyper-V. Module : Hyper-V-PowerShell Version 2.0 and Version 1.1. Domain : Member of the same domain with Admin privilege.
You can download a copy of this tool from
TechNet Gallery GitHub here.
This is version 1.0, do you have any other scenarios? Please leave your feedback below.
Hope that helps to make your upgrade easier!
The virtual machine configuration version represents the compatibility of the virtual machine’s configuration, saved state, and snapshot files with the version of Hyper-V. When you update the configuration version, you change the file structure that is used to store the virtual machines’ configuration and the checkpoint files.
You also update the configuration version to the latest version supported by that Hyper-V host. Upgraded virtual machines use a new configuration file format, which is designed to increase the efficiency of reading and writing virtual machine configuration data. The upgrade also reduces the potential for data corruption in the event of a storage failure.
Learn more… Check my recent Windows Server Hyper-V Cookbook for in-depth details about Hyper-V!
Until then… enjoy your day!