通过 PowerShell 更新 Azure Stack HCI 版本 23H2
适用于:Azure Stack HCI 版本 23H2
重要
此处所述的过程仅适用于从一个版本的 Azure Stack HCI 版本 23H2 更新到另一个更高版本时。 有关旧版本更新的信息,请参阅 更新 Azure Stack HCI 的群集版本 22H2。
本文介绍如何使用Azure 更新管理器查找和安装所选 Azure Stack HCI 群集上的可用群集更新。 此外,我们还提供有关如何查看群集更新、跟踪进度和浏览群集更新历史记录的指导。
本文介绍如何通过 PowerShell 将解决方案更新应用到 Azure Stack HCI 群集。
本文中的过程适用于运行最新版本的单服务器和多服务器群集,其中安装了业务流程协调程序 (Lifecycle Manager) 。 如果群集是通过 Azure Stack HCI 版本 23H2 的新部署创建的,则业务流程协调程序会自动作为部署的一部分进行安装。
有关如何将解决方案更新应用于使用未安装业务流程协调程序的旧版 Azure Stack HCI 创建的群集的信息 ,请参阅更新 Azure Stack HCI 群集版本 22H2。
关于解决方案更新
Azure Stack HCI 解决方案更新可以包括平台、服务和解决方案扩展更新。 有关每种更新类型的详细信息,请参阅 关于 Azure Stack HCI 版本 23H2 的更新。
应用解决方案更新时,需要执行以下高级步骤:
- 确保所有先决条件都已完成。
- 确定群集上运行的软件版本。
- 通过远程 PowerShell 连接到 Azure Stack HCI 群集。
- 使用 环境检查器 验证群集是否处于良好运行状态。
- 发现可用的更新,并筛选可以应用于群集的更新。
- 下载更新,评估群集的更新就绪情况,准备就绪后,在群集上安装更新。 跟踪更新的进度。 如果需要,还可以监视详细进度。
- 验证已安装的更新的版本。
安装更新所需的时间可能因以下因素而异:
- 更新的内容。
- 在群集上加载。
- 群集中的服务器数。
- 所用硬件的类型。
- 使用的解决方案生成器扩展。
下表汇总了典型单服务器群集和 4 服务器群集的大致时间估算:
群集/时间 | 运行状况检查时间 hh:mm:ss |
安装更新的时间 hh:mm:ss |
---|---|---|
单个服务器 | 0:01:44 | 1:25:42 |
4 服务器群集 | 0:01:58 | 3:53:09 |
先决条件
在开始之前,请确保:
- 有权访问运行 2310 或更高版本的 Azure Stack HCI 版本 23H2 群集。 群集应在 Azure 中注册。
- 有权访问可连接到 Azure Stack HCI 群集的客户端。 此客户端应运行 PowerShell 5.0 或更高版本。
- 你可以通过网络访问解决方案更新包。 将这些更新旁加载或复制到群集的服务器。
连接到 Azure Stack HCI 群集
在客户端上按照以下步骤连接到 Azure Stack HCI 群集的其中一个服务器。
在用于连接到群集的客户端上以管理员身份运行 PowerShell。
打开与 Azure Stack HCI 群集上的服务器的远程 PowerShell 会话。 运行以下命令,并在出现提示时提供服务器的凭据:
$cred = Get-Credential Enter-PSSession -ComputerName "<Computer IP>" -Credential $cred
注意
应使用部署用户帐户凭据登录:这是在准备 Active Directory 时创建的帐户,在部署 Azure Stack HCI 系统期间使用。
下面是示例输出:
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>
步骤 1:确定群集上的标记版本
在发现更新之前,请确保使用 Azure Stack HCI 版本 23H2 软件版本 2310 部署群集。
确保已使用部署用户帐户连接到群集服务器。 运行以下命令:
whoami
若要确保群集已部署运行 Azure Stack HCI 版本 23H2,请在群集的其中一台服务器上运行以下命令:
Get-StampInformation
下面是示例输出:
PS C:\Users\lcmuser> Get-StampInformation Deployment ID : b4457f25-6681-4e0e-b197-a7a433d621d6 OemVersion : 2.1.0.0 PackageHash : StampVersion : 10.2303.0.31 InitialDeployedVersion : 10.2303.0.26 PS C:\Users\lcmuser>
记下
StampVersion
群集上的 。 标记版本反映群集正在运行的解决方案版本。
步骤 2:(可选)验证系统运行状况
在发现更新之前,可以手动验证系统运行状况。 此步骤是可选的,因为业务流程协调程序始终在应用更新之前评估更新就绪情况。
注意
严重性为 严重 性的任何错误都会阻止应用更新。
使用部署用户帐户连接到 Azure Stack HCI 群集上的服务器。
运行以下命令,通过 环境检查器验证系统运行状况。
$result = Test-EnvironmentReadiness $result | ft Name,Status,Severity
下面是示例输出:
PS C:\Users\lcmuser> whoami rq2205\lcmuser PS C:\Users\lcmuser> $result=Test-EnvironmentReadiness VERBOSE: Looking up shared vhd product drive letter. WARNING: Unable to find volume with label Deployment VERBOSE: Get-Package returned with Success:True VERBOSE: Found package Microsoft.AzureStack.Solution.Deploy.EnterpriseCloudEngine.Client.Deployment with version 10.2303.0.31 at C:\NugetStore\Microsoft.AzureStack.Solution.Deploy.EnterpriseCloudEngine.Client.Deployment.10.2303.0.31\Microsoft.Azure Stack.Solution.Deploy.EnterpriseCloudEngine.Client.Deployment.nuspec. 03/29/2023 15:45:58 : Launching StoragePools 03/29/2023 15:45:58 : Launching StoragePhysicalDisks 03/29/2023 15:45:58 : Launching StorageMapping 03/29/2023 15:45:58 : Launching StorageSubSystems 03/29/2023 15:45:58 : Launching TestCauSetup 03/29/2023 15:45:58 : Launching StorageVolumes 03/29/2023 15:45:58 : Launching StorageVirtualDisks 03/29/2023 15:46:05 : Launching OneNodeEnvironment 03/29/2023 15:46:05 : Launching NonMigratableWorkload 03/29/2023 15:46:05 : Launching FaultSummary 03/29/2023 15:46:06 : Launching SBEHealthStatusOnNode 03/29/2023 15:46:06 : Launching StorageJobStatus 03/29/2023 15:46:07 : Launching StorageCsv WARNING: There aren't any faults right now. 03/29/2023 15:46:09 : Launching SBEPrecheckStatus WARNING: rq2205-cl: There aren't any faults right now. VERBOSE: Looking up shared vhd product drive letter. WARNING: Unable to find volume with label Deployment VERBOSE: Get-Package returned with Success:True VERBOSE: Found package Microsoft.AzureStack.Role.SBE with version 4.0.2303.66 at C:\NugetStore\Microsoft.AzureStack.Role.SBE.4.0.2303.66\Microsoft.AzureStack.Role.SBE.nuspec. VERBOSE: SolutionExtension module supports Tag 'HealthServiceIntegration'. VERBOSE: SolutionExtension module SolutionExtension at C:\ClusterStorage\Infrastructure_1\Shares\SU1_Infrastructure_1\CloudMedia\SBE\Installed\Content\Configuration\SolutionExtension is valid. VERBOSE: Looking up shared vhd product drive letter. WARNING: Unable to find volume with label Deployment VERBOSE: Get-Package returned with Success:True VERBOSE: Found package Microsoft.AzureStack.Role.SBE with version 4.0.2303.66 at C:\NugetStore\Microsoft.AzureStack.Role.SBE.4.0.2303.66\Microsoft.AzureStack.Role.SBE.nuspec. VERBOSE: SolutionExtension module supports Tag 'HealthServiceIntegration'. VERBOSE: SolutionExtension module SolutionExtension at C:\ClusterStorage\Infrastructure_1\Shares\SU1_Infrastructure_1\CloudMedia\SBE\Installed\Content\Configuration\SolutionExtension is valid. PS C:\Users\lcmuser> $result|ft Name,Status,Severity Name Status Severity ---- ------ -------- Storage Pool Summary SUCCESS CRITICAL Storage Services Physical Disks Summary SUCCESS CRITICAL Storage Services Physical Disks Summary SUCCESS CRITICAL Storage Services Physical Disks Summary SUCCESS CRITICAL Storage Services Physical Disks Summary SUCCESS CRITICAL Storage Services Physical Disks Summary SUCCESS CRITICAL Storage Services Physical Disks Summary SUCCESS CRITICAL Storage Services Physical Disks Summary SUCCESS CRITICAL Storage Services Physical Disks Summary SUCCESS CRITICAL Storage Services Physical Disks Summary SUCCESS CRITICAL Storage Services Physical Disks Summary SUCCESS CRITICAL Storage Services Physical Disks Summary SUCCESS CRITICAL Storage Services Physical Disks Summary SUCCESS CRITICAL Storage Services Physical Disks Summary SUCCESS CRITICAL Storage Services Physical Disks Summary SUCCESS CRITICAL Storage Services Physical Disks Summary SUCCESS CRITICAL Storage Services Physical Disks Summary SUCCESS CRITICAL Storage Services Physical Disks Summary SUCCESS CRITICAL Storage Services Physical Disks Summary SUCCESS CRITICAL Storage Services Physical Disks Summary SUCCESS CRITICAL Storage Services Physical Disks Summary SUCCESS CRITICAL Storage Services Summary SUCCESS CRITICAL Storage Services Summary SUCCESS CRITICAL Storage Services Summary SUCCESS CRITICAL Storage Subsystem Summary SUCCESS CRITICAL Test-CauSetup SUCCESS INFORMATIONAL Test-CauSetup SUCCESS INFORMATIONAL Test-CauSetup SUCCESS INFORMATIONAL Test-CauSetup SUCCESS INFORMATIONAL Test-CauSetup SUCCESS CRITICAL Test-CauSetup SUCCESS INFORMATIONAL Test-CauSetup SUCCESS INFORMATIONAL Test-CauSetup SUCCESS INFORMATIONAL Test-CauSetup FAILURE INFORMATIONAL Test-CauSetup FAILURE INFORMATIONAL Test-CauSetup FAILURE INFORMATIONAL Storage Volume Summary SUCCESS CRITICAL Storage Volume Summary SUCCESS CRITICAL Storage Volume Summary SUCCESS CRITICAL Storage Volume Summary SUCCESS CRITICAL Storage Virtual Disk Summary SUCCESS CRITICAL Storage Virtual Disk Summary SUCCESS CRITICAL Storage Virtual Disk Summary SUCCESS CRITICAL Storage Virtual Disk Summary SUCCESS CRITICAL Get-OneNodeRebootRequired SUCCESS WARNING Test-NonMigratableVMs SUCCESS WARNING Faults SUCCESS INFORMATIONAL Test-SBEHealthStatusOnNode Success Informational Test-SBEHealthStatusOnNode Success Informational Storage Job Summary SUCCESS CRITICAL Storage Cluster Shared Volume Summary SUCCESS CRITICAL Storage Cluster Shared Volume Summary SUCCESS CRITICAL Storage Cluster Shared Volume Summary SUCCESS CRITICAL Test-SBEPrecheckStatus Success Informational PS C:\Users\lcmuser>
注意
在此版本中,的信息失败
Test-CauSetup
是预期的,不会影响更新。在继续执行发现步骤之前,请查看并解决所有失败。
步骤 3:发现更新
可以通过以下两种方式之一发现更新:
- 联机发现更新 - 群集具有良好 Internet 连接时的建议选项。 解决方案更新是通过联机更新目录发现的。
- 旁加载和发现更新 - 联机发现更新的替代方法,适用于 Internet 连接不可靠或速度缓慢的情况,或使用硬件供应商提供的解决方案扩展更新时。 在这些情况下,可将解决方案更新下载到中心位置。 然后,将更新旁加载到 Azure Stack HCI 群集,并在本地发现更新。
联机发现解决方案更新 (建议)
建议使用联机目录发现解决方案更新。 按照以下步骤联机发现解决方案更新:
使用部署用户帐户连接到 Azure Stack HCI 群集上的服务器。
验证更新服务是否发现更新包。
Get-SolutionUpdate | ft DisplayName, State
(可选)查看更新包组件的版本。
$Update = Get-SolutionUpdate $Update.ComponentVersions
下面是示例输出:
PS C:\Users\lcmuser> $Update = Get-SolutionUpdate PS C:\Users\lcmuser> $Update.ComponentVersions PackageType Version LastUpdated ----------- ------- ----------- Services 10.2303.0.31 Platform 10.2303.0.31 SBE 4.1.2.3 PS C:\Users\lcmuser>
现在可以继续 下载并安装更新。
旁加载和发现解决方案更新
如果使用硬件的解决方案扩展更新,则需要旁加载这些更新。 按照以下步骤旁加载和发现解决方案更新。
使用部署用户帐户连接到 Azure Stack HCI 群集上的服务器。
转到网络共享并获取使用的更新包。 验证旁加载的更新包是否包含以下文件:
- SolutionUpdate.xml
- SolutionUpdate.zip
- AS_Update_10.2303.4.1.zip
如果解决方案生成器扩展是更新包的一部分,则还应看到以下文件:
- SBE_Content_4.1.2.3.xml
- SBE_Content_4.1.2.3.zip
- SBE_Discovery_Contoso.xml
在群集的基础结构卷中的以下位置创建一个文件夹供更新服务发现。
New-Item C:\ClusterStorage\Infrastructure_1\Shares\SU1_Infrastructure_1\sideload -ItemType Directory
将更新包复制到在上一步中创建的文件夹。
使用更新服务手动发现更新包。 运行以下命令:
Add-SolutionUpdate -SourceFolder C:\ClusterStorage\Infrastructure_1\Shares\SU1_Infrastructure_1\sideload
验证更新服务是否发现更新包,以及它是否可用于开始准备和安装。
Get-SolutionUpdate | ft DisplayName, Version, State
下面是示例输出:
PS C:\Users\lcmuser> Get-SolutionUpdate | ft DisplayName, Version, State DisplayName Version State ----------- ------- ----- Azure Stack HCI 2303 bundle 10.2303.0.31 Ready PS C:\Users\lcmuser>
(可选)检查更新包组件的版本。 运行以下命令:
$Update = Get-SolutionUpdate $Update.ComponentVersions
下面是示例输出:
PS C:\Users\lcmuser> $Update = Get-SolutionUpdate PS C:\Users\lcmuser> $Update.ComponentVersions PackageType Version LastUpdated ----------- ------- ----------- Services 10.2303.0.31 Platform 10.2303.0.31 SBE 4.1.2.3 PS C:\Users\lcmuser>
步骤 4:下载、检查就绪情况并安装更新
可以下载更新,执行一组检查以验证群集的更新就绪情况,然后开始安装更新。
只能在不启动安装的情况下下载更新,或下载并安装更新。
若要下载并安装更新,请运行以下命令:
Get-SolutionUpdate | Start-SolutionUpdate
若要仅在不开始安装的情况下下载更新,请将 标志与 一起使用
-PrepareOnly
Start-SolutionUpdate
。
若要跟踪更新进度,请监视更新状态。 运行以下命令:
Get-SolutionUpdate | ft Version,State,UpdateStateProperties,HealthState
更新开始时,将执行以下操作:
开始下载更新。 根据下载包的大小和网络带宽,下载可能需要几分钟时间。
下面是下载更新时的示例输出:
PS C:\Users\lcmuser> Get-SolutionUpdate|ft Version,State,UpdateStateProperties,HealthState Version State UpdateStateProperties HealthState ------- ----- --------------------- ----------- 10.2303.4.1 Downloading InProgress
下载包后,将执行就绪情况检查,以评估群集的更新就绪情况。 有关就绪情况检查的详细信息,请参阅 更新阶段。 在此阶段,更新 的状态 显示为
HealthChecking
。PS C:\Users\lcmuser> Get-SolutionUpdate|ft Version,State,UpdateStateProperties,HealthState Version State UpdateStateProperties HealthState ------- ----- --------------------- ----------- 10.2303.4.1 HealthChecking InProgress
系统准备就绪后,将安装更新。 在此阶段,更新 的状态 显示为
Installing
,并UpdateStateProperties
显示已完成的安装百分比。重要
在安装过程中,群集服务器可能会重新启动,可能需要再次建立远程 PowerShell 会话来监视更新。 如果更新单个服务器,Azure Stack HCI 将遇到停机。
下面是安装更新时的示例输出。
PS C:\Users\lcmuser> Get-SolutionUpdate|ft Version,State,UpdateStateProperties,HealthState Version State UpdateStateProperties HealthState ------- ----- --------------------- ----------- 10.2303.4.1 Installing 6% complete. Success PS C:\Users\lcmuser> Get-SolutionUpdate|ft Version,State,UpdateStateProperties,HealthState Version State UpdateStateProperties HealthState ------- ----- --------------------- ----------- 10.2303.4.1 Installing 25% complete. Success PS C:\Users\lcmuser> Get-SolutionUpdate|ft Version,State,UpdateStateProperties,HealthState Version State UpdateStateProperties HealthState ------- ----- --------------------- ----------- 10.2303.4.1 Installing 40% complete. Success PS C:\Users\lcmuser> Get-SolutionUpdate|ft Version,State,UpdateStateProperties,HealthState Version State UpdateStateProperties HealthState ------- ----- --------------------- ----------- 10.2303.4.1 Installing 89% complete. Success
安装完成后, 状态 将更改为 Installed
。 有关更新的各种状态的详细信息,请参阅 安装进度和监视。
步骤 5:验证安装
安装更新后,验证环境的解决方案版本和操作系统版本。
更新处于
Installed
状态后,检查环境解决方案版本。 运行下面的命令:Get-SolutionUpdateEnvironment | ft State, CurrentVersion
下面是示例输出:
PS C:\Users\lcmuser> Get-SolutionUpdateEnvironment | ft State, CurrentVersion State CurrentVersion ----- -------------- AppliedSuccessfully 10.2303.0.31
检查操作系统版本以确认它与你安装的食谱匹配。 运行下面的命令:
cmd /c ver
下面是示例输出:
PS C:\Users\lcmuser> cmd /c ver Microsoft Windows [Version 10.0.20349.1547] PS C:\Users\lcmuser>
排查更新问题
若要通过 PowerShell 恢复以前失败的更新运行,请使用以下命令:
get-solutionupdate | start-solutionupdate
若要恢复以前由于更新运行状况检查处于 警告 状态而失败的更新,请使用以下命令:
get-solutionUpdate | start-solutionUpdate -IgnoreWarnings
若要排查其他更新运行问题,请参阅 更新疑难解答。
后续步骤
详细了解如何在未安装业务流程协调程序时 更新版本 22H2 的 Azure Stack HCI 群集 。
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈