find ./nutanix/move/supported-OS -name 'Windows Server 2022'

Posted on Jan 15, 2022
tl;dr: Yes, it works! The fix is dead simple. We need to alter two lines and add one new line to the powershell script.

Hey Victor,

I run Windows Server 2022 on my Hyper-V VM, and now I want to migrate it to my Nutanix AHV cluster.
However, the Nutanix Move preparation script exits abruptly with an error telling me that the OS is unsupported! Can you please help me with a dirty workaround?

  Hold my “User VM OS (Microsoft Windows Server 2022) is unsupported” error, I’m going in!  


Prior to migrating a VM during using Nutanix Move, we should run a preparation script to install VirtIO drivers, etc.
The latest Move docs, however, never mentions Windows Server 2022 as a supported OS. In fact, the only place it mentions 2022 is in the top of the page, where it shows the date the documentation was last updated. :-)

Attempting to run the Move preparation script (hyperv_setup_uvm.ps1) anyway just throws an error.

User VM OS (Microsoft Windows Server 2022 Standard, 10.0.20348) is not supported for migration.

Error, unsupported OS

The fix

Please note - once again - this is just to patch the “unsupported” issue, there might (even though I didn’t notice any) be some issues during, or after migration of the VM.
Allowing the script to run on Windows Server 2022 is very simple. However - since the script is non-free, I cannot post the whole script here.
Googling the file name (hyperv_setup_uvm.ps1) will take you to some sites mirroring it, in case you need some inspiration and cannot find your own script within your Move infrastructure.

First off, we need to get the OS Version number for our current Windows version (2022). There are plenty of ways to get that, winver being one, the error message from the Move script being another, or simply use this Powershell oneliner:

[System.Environment]::OSVersion | select Version

Great, now that we’ve got them digits, use your imagination and add the following line into the hyperv_setup_uvm.ps1 where you feel like it might fit, maybe around line 18, if you use script version 4.1.0?

$Global:Win2K22Version = "10.0.20348"

Note: It seems like Nutanix' powershell developers were very tired upon writing the script, the "#### Supported OS Version" block appears twice after each other in the script.
It doesn’t matter in which of the (duplicate) blocks you add it.

Then, find the line/s:

$Global:SupportedOSStrings = @("2008", "2008 R2" [...]

In the SupportedOSStrings array, add "2022".

And the last thing we need to edit, find:

$Global:SupportedOSVersionStrings = @($Global:Win10Version, [...]

In the SupportedOSVersionStrings array, add $Global:Win2K22Version

Re-run the script

You’ll see that it won’t throw any “unsupported” error anymore. In fact, the script will even say Winodws Server 2022 is supported! It works! Enjoy moving your Windows Server 2022 VMs in a totally (un)supported way, until Nutanix officially supports the OS!