MSLab
MSLab copied to clipboard
Updating from Server 2022 to Server 2025 fails due to limited RAM
This issue originally came as: ISSUE - Hyper-V VM In-Place Upgrade (IPU) WS 2022 to WS 2025 b26063 fails - Microsoft Community Hub
My developed repro steps are:
- Download the scripts here: microsoft/MSLab: Azure Stack HCI, Windows 10 and Windows Server rapid lab deployment scripts (github.com)
- Run the initial lab steps using an ISO of Windows Server 2022. I used: en-us_windows_server_2022_updated_feb_2024_x64_dvd_95120870.iso
- Replace LabConfig.ps1 with the contents in the discussion below.
- Start up the mslab-WACGW VM.
- Mount a current Windows Server 2025 insider ISO as a DVD for that VM. I used:
- Windows_InsiderPreview_Server_vNext_en-us_26080.iso
- Run setup.exe and go through the upgrade path.
EXPECTED: Upgrade should work.
ACTUAL: It rolls back to Server 2022.
#basic config for Windows Server 2022, that creates VMs for S2D Hyperconverged scenario https://github.com/Microsoft/MSLab/tree/master/Scenarios/S2D%20Hyperconverged
$LabConfig=@{AllowedVLANs="1-10,711-719" ; DomainAdminName='LabAdmin'; AdminPassword='LS1setup!' ; DCEdition='4'; Internet=$true ; TelemetryLevel='Full' ; TelemetryNickname='' ; AdditionalNetworksConfig=@() ; SecureBoot=$true ; VMs=@() ; CustomDnsForwarders=@("1.1.1.1","1.0.0.1")}
#Azure Stack HCI 22H2
#1..2 | ForEach-Object {$LABConfig.VMs += @{ VMName="AzSHCI$_" ; Configuration='S2D' ; ParentVHD='AzSHCI22H2_G2.vhdx' ; HDDNumber=4 ; HDDSize=1TB ; MemoryStartupBytes=1GB; VMProcessorCount=4 ; vTPM=$true}}
#Azure Stack HCI 22H2 with nested virtualization
#1..2 | ForEach-Object {$LABConfig.VMs += @{ VMName="AzSHCI$_" ; Configuration='S2D' ; ParentVHD='AzSHCI22H2_G2.vhdx' ; HDDNumber=4 ; HDDSize=1TB ; MemoryStartupBytes=32GB ; VMProcessorCount=8 ; vTPM=$true ; NestedVirt=$true}}
#Windows Admin Center in GW mode
$LabConfig.VMs += @{ VMName = 'WACGW' ; ParentVHD = 'Win2022Core_G2.vhdx'; MGMTNICs=1}
#Management machine
$LabConfig.VMs += @{ VMName = 'Management' ; ParentVHD = 'Win2022_G2.vhdx'; MGMTNICs=1}
My investigation found that the update failed because the in-place upgrade is failing to allocate a large enough block of RAM (about 500MB) to set up the ramdisk needed to do the upgrade.
Setting the minimum RAM for the VM to 2048 MB solved the problem.
This is consistent with the minimum RAM documented here: https://learn.microsoft.com/en-us/windows-server/get-started/hardware-requirements?tabs=cpu
Appreciate your investigation and all the time spent! the specific one to change is the startup RAM from 512MB to 2048 MB (or 2GB). I will try out if this also works with startup RAM of 1GB and if there is any change between 2019 > 2022 IPU behaviour and 2022 > 2025 IPU behaviour.
Checking with mslab24.04, the startup ram and minimum RAM is ok for the hydrated Domain Controller. @jaromirk I would like to suggest to review the 3_Deploy.ps1 to raise the bar for additional VMs by default.
If not specified in Labconfig, it defaults to 512 MB which is too low for Windows Server with Desktop Experience. 2048 MB is required to avoid issues.
I have no tried if 512MB is enough for Core. Adding the distinguished Edition Core or GUI into the code would require "loosy" checks on the filename of the parentdisk specified in labconfig. This could be prone for failures if users choose different naming for parent files.
MemoryStartupBytes= 512MB; # Startup memory size
proposed fix: https://github.com/microsoft/MSLab/pull/590
Reference, see information box: https://learn.microsoft.com/en-us/windows-server/get-started/hardware-requirements?tabs=ram
Thank you for your investigation and assistance @michbern-ms!
This appears to be fixed in 2_createparentpartition.ps1 for the mslab DC. Yet to test if usual VM creations are still affected.
Tested today with 24.06.2, if not specified otherwise in Labconfig.ps1, the default is still 512 MB. @jaromirk thank you for a review and merge of #590 into the next release.
@michbern-ms feel free to merge the changes.
Thank you Jaromir. The code change is prepared in named PR above your comment.
Let me look into it tonight. There's more needed to modify than 512MB startup. I should also sync with @machv and @michbern-ms to plan some more changes (labconfig overhaul...)
To solve this specific issue, tested, it's not. but I understand there are more pending changes that would fuel a new release.
Please let me know, if I can be of any help for your planned changes.
fixed in latest dev. Defaulting to 1Gb if memorystartupbytes not specified