|
| 1 | +--- |
| 2 | +title: Upgrade Azure Stack HCI OS from version 20349.x (22H2) to 26100.x using PowerShell |
| 3 | +description: Learn how to use PowerShell to upgrade Azure Stack HCI OS from version 20349.x (22H2) to 26100.x. |
| 4 | +author: alkohli |
| 5 | +ms.topic: how-to |
| 6 | +ms.date: 05/28/2025 |
| 7 | +ms.author: alkohli |
| 8 | +ms.reviewer: alkohli |
| 9 | +ms.service: azure-local |
| 10 | +--- |
| 11 | + |
| 12 | +# Upgrade Azure Stack HCI OS from version 20349.x (22H2) to 26100.x using PowerShell |
| 13 | + |
| 14 | +[!INCLUDE [applies-to](../includes/hci-applies-to-23h2-22h2.md)] |
| 15 | + |
| 16 | +[!INCLUDE [end-of-service-22H2](../includes/end-of-service-22h2.md)] |
| 17 | + |
| 18 | +This article describes how to upgrade the operating system (OS) for Azure Local from version 20349.x (22H2) to 26100.x using PowerShell. This is the first step in the upgrade process, which upgrades only the OS. |
| 19 | + |
| 20 | +To upgrade the OS from version 25398.x (23H2) to 26100.x, see [Upgrade Azure Stack HCI OS, version 22H2 to version 23H2 via PowerShell](./upgrade-22h2-to-23h2-powershell.md). |
| 21 | + |
| 22 | +Throughout this article, we refer to OS version 26100.x as the *new* version and version 20349.x (22H2) as the *old* version. The version numbers shown as 20349.x and 26100.x are placeholders. Replace x with the actual build number applicable to your environment. |
| 23 | + |
| 24 | +## High-level workflow for the OS upgrade |
| 25 | + |
| 26 | +The Azure Stack HCI operating system update is available via the media that you can download from the Azure portal. |
| 27 | + |
| 28 | +To upgrade the OS on your system, follow these high-level steps: |
| 29 | + |
| 30 | +1. [Complete the prerequisites.](#complete-prerequisites) |
| 31 | +1. [Update registry keys.](#step-0-update-registry-keys) |
| 32 | +1. [Connect to Azure Local, version 22H2.](#step-1-connect-to-azure-local) |
| 33 | +1. [Check for the available updates using PowerShell.](#step-1-connect-to-azure-local) |
| 34 | +1. [Install new OS using PowerShell.](#step-2-install-new-os-using-powershell) |
| 35 | +1. [Check the status of the updates.](#step-3-check-the-status-of-an-update) |
| 36 | +1. [After the OS is upgraded, perform post-OS upgrade steps.](#next-steps) |
| 37 | + |
| 38 | +## Complete prerequisites |
| 39 | + |
| 40 | +Before you begin, make sure that: |
| 41 | + |
| 42 | +- You have access to an Azure Local running OS version 20349.3692 (22H2 5B). |
| 43 | +- The system is registered in Azure. |
| 44 | +- All the machines in your Azure Local, version 20349.x instance are healthy and show as **Online**. |
| 45 | +- You shut down virtual machines (VMs). We recommend shutting down VMs before performing the OS upgrade to prevent unexpected outages and damages to databases. |
| 46 | +- You have access to the Azure Stack HCI, version 20349.x OS software update for Azure Local. This update is available as a downloadable media. The media must be version **2505** ISO file that you can download from the [Azure portal](https://portal.azure.com/#view/Microsoft_Azure_HybridCompute/AzureArcCenterBlade/~/hciGetStarted). |
| 47 | +- Consult your Original Equipment Manufacturer (OEM) before you upgrade Azure Local to OS version 26100.x. Check with your OEM regarding the compatible drivers that must be installed before the upgrade. |
| 48 | +- You have access to a client that can connect to your Azure Local instance. This client should be running PowerShell 5.0 or later. |
| 49 | +- You run the `RepairRegistration` cmdlet only if both of the following conditions apply: |
| 50 | + |
| 51 | + - The *identity* property is either missing or doesn’t contain `type = "SystemAssigned"`. |
| 52 | + - Check this in the Resource JSON in the Azure portal |
| 53 | + - Or run the `Get-AzResource -Name <cluster_name>` PowerShell cmdlet |
| 54 | + - The **Cloud Management** cluster group is not present. Check it by running the `Get-ClusterGroup` PowerShell cmdlet. |
| 55 | + |
| 56 | + If both these conditions are met, run the `RepairRegistration` cmdlet: |
| 57 | + |
| 58 | + ```powershell |
| 59 | + Register-AzStackHCI -TenantId "<tenant_ID>" -SubscriptionId "<subscription_ID>" -ComputerName "<computer_name>" -RepairRegistration |
| 60 | + ``` |
| 61 | + |
| 62 | +- (Recommended) You enable [Secure Boot](/windows-hardware/design/device-experiences/oem-secure-boot) on Azure Local machines before you upgrade the OS. |
| 63 | + To enable Secure Boot, follow these steps: |
| 64 | + 1. Drain the cluster node. |
| 65 | + 1. Restart the OS. |
| 66 | + 1. Enter the BIOS/UEFI menu. |
| 67 | + 1. Review the **Boot** or **Security** section of the UEFI configuration options Locate the Secure Boot option. |
| 68 | + 1. Set the option to **Enabled** or **On**. |
| 69 | + 1. Save the changes and restart your computer. |
| 70 | + |
| 71 | + Consult with your hardware vendor for assistance if required. |
| 72 | + |
| 73 | +> [!NOTE] |
| 74 | +> The **2503** ISO file is only required if the machines do not have access to Windows Update to download the OS feature update. If using this method, after you [Connect to Azure Local, version 22H2](#step-1-connect-to-azure-local), skip to step 6 under [Step 2: Install new OS using PowerShell](#step-2-install-new-os-using-powershell) and perform the remaining steps. |
| 75 | +> Use of 3rd party tools to install upgrades is not supported. |
| 76 | +
|
| 77 | +## Step 0: Update registry keys |
| 78 | + |
| 79 | +To ensure Resilient File System (ReFS) and live migrations function properly during and after OS upgrade, follow these steps on each machine in the system to update registry keys. Reboot each machine for the changes to take effect. |
| 80 | + |
| 81 | +1. Set `RefsEnableMetadataValidation` to `0`: |
| 82 | + |
| 83 | + ```powershell |
| 84 | + Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "RefsEnableMetadataValidation" -Value 0 -Type DWord -ErrorAction Stop |
| 85 | + ``` |
| 86 | + |
| 87 | +1. Create the parameters key if it doesn't exist. If it already exists, the command may fail with an error, which is expected. |
| 88 | + |
| 89 | + ```powershell |
| 90 | + New-Item -Path HKLM:\SYSTEM\CurrentControlSet\Services\Vid\Parameters |
| 91 | + ``` |
| 92 | + |
| 93 | +1. Set `SkipSmallLocalAllocations` to `0`: |
| 94 | + |
| 95 | + ```powershell |
| 96 | + New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Services\Vid\Parameters -Name SkipSmallLocalAllocations -Value 0 -PropertyType DWord |
| 97 | + ``` |
| 98 | + |
| 99 | +1. Restart the machine for the changes to take effect. On machine restart, if the `RefsEnableMetadataValidation` key gets overridden and ReFS volumes fail to come online, toggle the key by first setting `RefsEnableMetadataValidation` to `1` and then back to `0` again. |
| 100 | + |
| 101 | +## Step 1: Connect to Azure Local |
| 102 | + |
| 103 | +Follow these steps on your client to connect to one of the machines of your Azure Local instance. |
| 104 | + |
| 105 | +1. Run PowerShell as Administrator on the client that you're using to connect to your system. |
| 106 | +1. Open a remote PowerShell session to a machine on your Azure Local instance. Run the following command and provide the credentials of your machine when prompted: |
| 107 | + |
| 108 | + ```powershell |
| 109 | + $cred = Get-Credential |
| 110 | + Enter-PSSession -ComputerName "<Computer IP>" -Credential $cred |
| 111 | + ``` |
| 112 | + |
| 113 | + Here's a sample output: |
| 114 | + |
| 115 | + ```Console |
| 116 | + PS C:\Users\Administrator> $cred = Get-Credential |
| 117 | + |
| 118 | + cmdlet Get-Credential at command pipeline position 1 |
| 119 | + Supply values for the following parameters: |
| 120 | + Credential |
| 121 | + PS C:\Users\Administrator> Enter-PSSession -ComputerName "100.100.100.10" -Credential $cred |
| 122 | + [100.100.100.10]: PS C:\Users\Administrator\Documents> |
| 123 | + ``` |
| 124 | + |
| 125 | +## Step 2: Install new OS using PowerShell |
| 126 | + |
| 127 | +To install the new OS using PowerShell, follow these steps: |
| 128 | + |
| 129 | +> [!NOTE] |
| 130 | +> The following steps require the Cluster-Aware Updating (CAU) role to be installed and enabled on the system. For information on how to install and enable this feature on your Azure Local, see [Cluster-Aware Updating overview](/windows-server/failover-clustering/cluster-aware-updating#installing-cluster-aware-updating). |
| 131 | +
|
| 132 | +1. Run the following cmdlets on every machine in the system. |
| 133 | + |
| 134 | + ```PowerShell |
| 135 | + Set-WSManQuickConfig |
| 136 | + Enable-PSRemoting |
| 137 | + ``` |
| 138 | + |
| 139 | +1. To test whether the system is properly set up to apply software updates using Cluster-Aware Updating (CAU), run the `Test-CauSetup` cmdlet, which notifies you of any warnings or errors: |
| 140 | + |
| 141 | + ```PowerShell |
| 142 | + Test-CauSetup -ClusterName <System name> |
| 143 | + ``` |
| 144 | + |
| 145 | +1. Validate the hardware and settings by running the `Test-Cluster` cmdlet on one of the machines in the system. If any of the condition checks fail, resolve them before proceeding to the next step. <!--ASK--> |
| 146 | + |
| 147 | + ```PowerShell |
| 148 | + Test-Cluster |
| 149 | + ``` |
| 150 | + |
| 151 | +1. Check for the available updates: |
| 152 | + |
| 153 | + ```PowerShell |
| 154 | + Invoke-CauScan -ClusterName <SystemName> -CauPluginName "Microsoft.RollingUpgradePlugin" -CauPluginArguments @{'WuConnected'='true';} -Verbose | fl * |
| 155 | + ``` |
| 156 | + |
| 157 | + Inspect the output of the above cmdlet and verify that each machine is offered the same Feature Update, which should be the case. <!--ASK--> |
| 158 | + |
| 159 | +1. You need a separate machine or VM outside the system to run the `Invoke-CauRun` cmdlet from. A separate machine ensures that orchestration isn't interrupted when the machines are rebooted. |
| 160 | + |
| 161 | + > [!IMPORTANT] |
| 162 | + > The system on which you run `Invoke-CauRun` must be running Windows Server 2022. <!--ASK--> |
| 163 | +
|
| 164 | + ```PowerShell |
| 165 | + Invoke-CauRun -ClusterName <SystemName> -CauPluginName "Microsoft.RollingUpgradePlugin" -CauPluginArguments @{'WuConnected'='true';} -Verbose -EnableFirewallRules -Force |
| 166 | + ``` |
| 167 | + |
| 168 | +1. If the system isn't connected to Windows Update and the Azure Local install media is available on a local share, CAU can also be used to upgrade the system. Be sure to update the `'PathToSetupMedia'` parameter with the share path to the ISO image. |
| 169 | + |
| 170 | + ```powershell |
| 171 | + Invoke-CauRun –ClusterName <SystemName> -CauPluginName Microsoft.RollingUpgradePlugin -CauPluginArguments @{ 'WuConnected'='false';'PathToSetupMedia'='\some\path\'; 'UpdateClusterFunctionalLevel'='true'; } -Force |
| 172 | + ``` |
| 173 | + |
| 174 | +1. Check for any further updates and install them. |
| 175 | + |
| 176 | +Wait for the update to complete and check the status of the update. |
| 177 | + |
| 178 | +[!INCLUDE [verify-update](../includes/azure-local-verify-update.md)] |
| 179 | + |
| 180 | +## Next steps |
| 181 | + |
| 182 | +- [Learn how to perform the post-OS upgrade steps for your Azure Local.](./post-upgrade-steps.md) |
0 commit comments