Troubleshoot Windows instance startup or feature failures after system updates

更新时间:
复制 MD 格式

Uninstall defective system patches when a Windows ECS instance fails to start or features malfunction after an update.

Symptom

After you install system updates on a Windows ECS instance, the instance fails to start or specific Windows features malfunction, such as failed driver installations or abnormal Key Management Service (KMS) behavior.

Cause

A defective system patch can prevent the operating system from starting or cause Windows features to malfunction.

Solution

Choose a method based on whether the instance can start.

The instance can start

Uninstall patches from Windows Update

  1. Connect to the ECS instance.

    See Use Workbench to connect to a Windows instance using RDP.

  2. Click the Start menu, and then click Set.

    image.png

  3. On Windows Settings, click Update & security.

    image.png

  4. On Update status, click Update history.

    image.png

  5. On Update History, click Uninstall updates.

    image.png

  6. Right-click the target update (for example, KB5029250), click Uninstall, and follow the on-screen instructions.

    image.png

Uninstall patches with PowerShell

  1. Connect to the ECS instance.

    See Use Workbench to connect to a Windows instance using RDP.

  2. Run Windows PowerShell as an administrator.

    image.png

  3. Find the package that corresponds to the patch.

    $package = Get-WindowsPackage -Online | Where-Object {$_.PackageName -match 'KB5029250'}
  4. Uninstall the package.

    $package | Remove-WindowsPackage -Online

The instance fails to start

If the instance fails to start, attach a repair disk to it, then uninstall the defective patch. The following steps assume the repair disk is attached as drive D and you want to uninstall KB5029250.

  1. Run a diagnostic for the operating system startup failure.

    1. Go to the ECS console - Troubleshooting page. Select a region and a resource group.

    2. In the Instance Start/Stop Abnormality card, click Initiate Diagnosis. In the Create Diagnostic Task dialog box, select the instance ID to diagnose and a time range, then click Initiate Diagnosis.

      Note

      The instance must be in the Stopped state. See Stop an instance.

      After the diagnostic completes, the instance enters the Running or Repairing state.

      Running and Repairing states

  2. Connect to the faulty instance.

    On the Diagnostic Result page, click VNC Connection. Enter the Administrator username and password from the diagnostic report to log on to the ECS instance with the repair disk attached. See Connect to an instance by using VNC.

  3. Run Windows PowerShell as an administrator.

    image.png

  4. Find the package that corresponds to the patch.

    $package = Get-WindowsPackage -Path D:\ | Where-Object {$_.PackageName -match 'KB5029250'}
  5. Uninstall the package.

    $package | Remove-WindowsPackage -Path D:\
  6. On the Instance page, move the pointer over the Fixing state that corresponds to the instance and click Detach Repair Disk.

  7. Restart the instance for the changes to take effect.

    See Restart an instance.

  8. Connect to the ECS instance. If the connection succeeds, the issue is resolved.

    See Log on to a Windows instance using Workbench.