Upgrade Azure Stack HCI OS, version 22H2 via PowerShell

Applies to: Azure Local, versions 23H2 and 22H2

This article describes how to upgrade the operating system (OS) for Azure Local from version 22H2 to version 23H2 via PowerShell. Upgrade using PowerShell is the recommended method to upgrade the OS

There are other methods to upgrade the OS that include using Windows Admin Center and the Server Configuration tool (SConfig). For more information about these methods, see Upgrade the Azure Stack HCI OS, version 22H2 OS via Windows Admin Center and Upgrade Azure Local to new OS using other methods.

Throughout this article, we refer to OS version 23H2 as the new version and version 22H2 as the old version.

Important

To keep your Azure Local service in a supported state, you have up to six months to install this new OS version. The update is applicable to all Azure Local instances running version 22H2. We strongly recommend that you install this version as soon as it becomes available.

High-level workflow for the OS upgrade

The Azure Stack HCI operating system update is available via the Windows Update and via the media that you can download from the Azure portal.

To upgrade the OS on your system, follow these high-level steps:

  1. Complete the prerequisites.
  2. Connect to Azure Local, version 22H2.
  3. Check for the available updates using PowerShell.
  4. Install new OS using PowerShell.
  5. Check the status of the updates.
  6. After the OS is upgraded, perform post-OS upgrade steps.

Complete prerequisites

Before you begin, make sure that:

  • You have access to an Azure Local running version 22H2.
  • The system is registered in Azure.
  • Make sure that all the machines in your Azure Local, version 22H2 instance are healthy and show as Online.
  • You have access to the Azure Stack HCI, version 23H2 OS software update for Azure Local. This update is available via Windows Update or as a downloadable media. The media is an ISO file that you can download from the Azure portal.
  • You have access to a client that can connect to your Azure Local instance. This client should be running PowerShell 5.0 or later.

Note

The 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, skip to step 6 under Step 2: Install new OS using PowerShell and perform the remaining steps.

Step 1: Connect to Azure Local

Follow these steps on your client to connect to one of the machines of your Azure Local instance.

  1. Run PowerShell as Administrator on the client that you're using to connect to your system.

  2. 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:

    $cred = Get-Credential
    Enter-PSSession -ComputerName "<Computer IP>" -Credential $cred 
    

    Here's a sample output:

    PS C:\Users\Administrator> $cred = Get-Credential
    
    cmdlet Get-Credential at command pipeline position 1
    Supply values for the following parameters:
    Credential
    PS C:\Users\Administrator> Enter-PSSession -ComputerName "100.100.100.10" -Credential $cred 
    [100.100.100.10]: PS C:\Users\Administrator\Documents>
    

Step 2: Install new OS using PowerShell

To install the new OS using PowerShell, follow these steps:

Note

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.

  1. Run the following cmdlets on every machine in the system.

    Set-WSManQuickConfig
    Enable-PSRemoting
    
  2. 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:

    Test-CauSetup -ClusterName <System name>
    
  3. 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.

    Test-Cluster
    
  4. Check for the available updates:

    Invoke-CauScan -ClusterName <SystemName> -CauPluginName "Microsoft.RollingUpgradePlugin" -CauPluginArguments @{'WuConnected'='true';} -Verbose | fl *
    

    Inspect the output of the above cmdlet and verify that each machine is offered the same Feature Update, which should be the case.

  5. 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.

    Important

    The system on which you run Invoke-CauRun must be running Windows Server 2022.

    Invoke-CauRun -ClusterName <SystemName> -CauPluginName "Microsoft.RollingUpgradePlugin" -CauPluginArguments @{'WuConnected'='true';} -Verbose -EnableFirewallRules -Force
    
  6. 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.

    Invoke-CauRun –ClusterName <SystemName> -CauPluginName Microsoft.RollingUpgradePlugin -CauPluginArguments @{ 'WuConnected'='false';'PathToSetupMedia'='\some\path\'; 'UpdateClusterFunctionalLevel'='true'; } -Force
    
  7. Check for any further updates and install them.

Wait for the update to complete and check the status of the update.

Step 3: Check the status of an update

To get the summary information about an update in progress, run the Get-CauRun cmdlet:

Get-CauRun -ClusterName <SystemName>

Here's a sample output:

RunId                   : <Run ID> 
RunStartTime            : 10/13/2024 1:35:39 PM 
CurrentOrchestrator     : NODE1 
NodeStatusNotifications : { 
Node      : NODE1 
Status    : Waiting 
Timestamp : 10/13/2024 1:35:49 PM 
} 
NodeResults             : { 
Node                     : NODE2 
Status                   : Succeeded 
ErrorRecordData          : 
NumberOfSucceededUpdates : 0 
NumberOfFailedUpdates    : 0 
InstallResults           : Microsoft.ClusterAwareUpdating.UpdateInstallResult[] 
}

You're now ready to perform the post-OS upgrade steps for your system.

Next steps