Upgrade The VM Configuration Version in Windows Server Hyper-V Cluster with PowerShell? #HyperV

3 Min. Read

In this article, we will show you how to upgrade the VM configuration version in Windows Server Hyper-V Cluster with PowerShell.

Introduction

In the previous version of Hyper-V, whenever you upgraded your host to a newer release, the moment Hyper-V sees your virtual machines, the VM configuration version will be upgraded automatically behind the scenes.

This has been changed in Windows Server 2016, Hyper-V will NOT automatically upgrade your virtual machines. This gives you the flexibility to move virtual machines back to earlier Hyper-V versions if we deem it necessary. Once you upgrade the VM configuration to the latest version, you cannot move it back to a downgrade level host. This is what is called the “Point of no Return”.

The upgrade of a virtual machine version in Windows Server 2016 is a manual operation that is separate from upgrading the host.

As a reference, 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 Hyper-V the version is 8.0.

The process to upgrade a virtual machine configuration 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.

As you can see in the UI we have got this Upgrade Configuration Version.

HVCluster-UpgradeVMConfigurationVersion-01

Upgrade The VM Configuration in a Hyper-V Cluster

We recently deployed a 4-Nodes Storage Spaces Direct (S2D) cluster and we moved all virtual machines from Windows Server 2012 R2 to 2016.

We don’t have any more Windows Server 2012 R2 hosts in the environment, and we decided to upgrade all the virtual machines’ configurations in order to get the benefit of the latest and greatest features.

Check out What’s new in Windows Server 2016 Hyper-V to get an overview of all the new features!

We moved dozens of VMs to this new shiny S2D cluster.

In order to get all virtual machines in the cluster, you can run the following command:

Get-ClusterGroup –Cluster <Cluster NAME> | ? {$_.GroupType –eq 'VirtualMachine' } | Get-VM

HVCluster-UpgradeVMConfigurationVersion-02

In order to upgrade the VM configuration version for all virtual machines, you can do this with the following commands:

$Cluster = “Cluster Name”

Get-ClusterGroup -Cluster $Cluster | ? {$_.GroupType –eq 'VirtualMachine' } | Get-VM | Stop-VM –Force

Get-ClusterGroup –Cluster $Cluster | ? {$_.GroupType –eq 'VirtualMachine' } | % {Update-VMVersion -Name $_.Name -ComputerName $_.OwnerNode -Confirm:$false }

Get-ClusterGroup -Cluster $Cluster | ? {$_.GroupType –eq 'VirtualMachine' } | Get-VM | Start-VM

Note: Please make sure to schedule a maintenance window before doing so.

Let’s check now if all VMs are upgraded successfully to version 8.0!

HVCluster-UpgradeVMConfigurationVersion-03

There’s more

Do you want to automate the upgrade of the virtual machine configuration version in Hyper-V?

We’ve created the following tool that will help you to automate the migration and the upgrade process.

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!

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.

Summary

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!

Cheers,
-Ch@rbel

Related Posts

Previous

How to Expand and Resize Storage Spaces Direct CSV Volume? #HyperV #S2D

An Unexpected Error Occurred During DPM 2016 Installation ID: 4387 #SysCtr #SCDPM

Next

Let me know what you think, or ask a question...

The content of this website is copyrighted from being plagiarized!

You can copy from the 'Code Blocks' in 'Black' by selecting the Code.

Please send your feedback to the author using this form for any 'Code' you like.

Thank you for visiting!