Powershell - Hyper-V - Managing virtual machine configuration versions

To support me, you can subscribe to the channel, share and like the videos, disable your ad blocker or make a donation. Thank you!

Hello,

If you have created a virtual machine from an earlier version of Hyper-V and have upgraded to a more recent version of Hyper-V, you will need to update the configuration version of the virtual machine so that it can use the new features available on your new Hyper-V.

# Display the configuration versions supported by your Hyper-V
Get-VMHostSupportedVersion
# Display virtual machine configuration versions
Get-VM | Select-Object Name,Version
# Update the configuration version of the virtual machine
# This action is not reversible
# The machine must be in a Disabled state (stopped)
# If the machine is in a Registered state, the update removes the mise en mémoire state.
Update-VMVersion -VM VM-Test
# Update the configuration version of the virtual machine to a more recent version.
# This action is not reversible
# The machine must be in a stopped state
# If the machine is in a Saved state, the update removes the out-of-memory state
Update-VMVersion -VM VM-Test2 -TargetVersion 9.0

By default, a virtual machine is created with the latest supported configuration version, but if the machine is to be migrated or imported to an older Hyper-V server, it will not work.

It is therefore necessary to create it with a specific configuration version

# Create a virtual machine in a previous configuration version
New-VM -Name VM_Test_V8 -Version 8.0

Related links