A virtual machine that was upgraded from Windows Server 2019 to Windows Server 2025. Need to update the Guest OS setting in vCenter from "Windows Server 2019" to "Windows Server 2025". However, this setting is grayed out and cannot be modified while the VM is powered on. It only becomes editable when the virtual machine is powered off.
Running powercli also fails:
Get-VM -Name vm1 | Set-VM -GuestId windows2022srvNext_64Guest -Confirm:$false | Out-Null
The operation for the entity "vm1" failed with the following message: "The attempted operation cannot be performed in the current state (Powered on)."
vSphere 7.0.x
vSphere 8.0.x
This is an expected result , there is no way to change the Guest OS setting while the VM is powered on.
The VM must be powered off first, then change the guest OS settings.
This can be done in vCenter Web GUI manually, or via Powercli:
Get-VM -Name vm1 | Set-VM -GuestId windows2022srvNext_64Guest -Confirm:$false | Out-Null