Project

General

Profile

Actions

action #117577

closed

Create a job to periodically run Windows Update

Added by pherranz over 2 years ago. Updated 3 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
-
Start date:
2022-10-05
Due date:
% Done:

0%

Estimated time:
Tags:

Description

Introduction

The jobs of WSL rely on the Windows version underneath, which sometimes leads to failure due to some fixes that Microsoft periodically releases but are not included in our qcow2 image.

Action to take

It would be a good idea, in parallel with #105160, to run a job periodically in order to have the latest Windows Updates and maybe try to reduce the number of failures in our WSL product tests.


Related issues 4 (1 open3 closed)

Related to Containers and images - action #116470: test fails in install_from_MSStore (search does not find results)Resolvedpherranz2022-09-12

Actions
Related to Containers and images - coordination #138137: [WSL][epic] Improvement of the installation processesNew2023-10-17

Actions
Has duplicate Containers and images - action #105160: Automatic triggering of Windows Image Update test runsResolved2022-01-20

Actions
Blocks Containers and images - action #134903: [WSL] Improve WSL installation processResolvedpherranz2023-08-31

Actions
Actions #1

Updated by pherranz over 2 years ago

  • Related to action #105160: Automatic triggering of Windows Image Update test runs added
Actions #2

Updated by pherranz over 2 years ago

  • Assignee set to pherranz
Actions #3

Updated by pherranz over 2 years ago

  • Status changed from Workable to Blocked

Right now there's a 122GB update, which maybe is a mistake from MS. This blocks the updater and also makes the OS crash and reboot sometimes. Let's wait until MS fixes or removes this huge update.

Actions #4

Updated by pherranz over 2 years ago

Trying to run these jobs in my "local" instance of openQA

Actions #5

Updated by pherranz over 2 years ago

  • Status changed from Blocked to In Progress

I'm going to check if the blocking updates (KB5017308 and KB5017328) are really that size.

Actions #6

Updated by pherranz over 2 years ago

A great idea will be to chain all the WSL jobs with the update one using the method described here.

Actions #7

Updated by openqa_review about 2 years ago

This is an autogenerated message for openQA integration by the openqa_review script:

This bug is still referenced in a failing openQA test: wsl-main+register@win11_uefi
https://openqa.suse.de/tests/9871334#step/firstrun/1

To prevent further reminder comments one of the following options should be followed:

  1. The test scenario is fixed by applying the bug fix to the tested product or the test is adjusted
  2. The openQA job group is moved to "Released" or "EOL" (End-of-Life)
  3. The bugref in the openQA scenario is removed or replaced, e.g. label:wontfix:boo1234

Expect the next reminder at the earliest in 28 days if nothing changes in this ticket.

Actions #8

Updated by pherranz about 2 years ago

I've managed to send the output of a PowerShell command through the COM1, to a better parsing of the script. Pending to check if I can overwrite the same HDD_1 parameter with PUBLISH_HDD_1.

https://openqa.suse.de/tests/9927990
https://openqa.suse.de/tests/9927968

Actions #9

Updated by pherranz about 2 years ago

If the update takes too long, it will cause the test to fail. Is there a way to limit this time and force a soft_failure?

Actions #10

Updated by pherranz about 2 years ago

  • Related to action #116470: test fails in install_from_MSStore (search does not find results) added
Actions #11

Updated by pherranz about 2 years ago

  • Status changed from In Progress to Workable
  • Assignee deleted (pherranz)

The updating process is very unstable. Every time the update window shows up, there's a new text or image that makes the needles fail.
Also, trying through CLI with PSWindowsUpdate 'plugin' is buggy too, due to the 'cumulative update' that is +100GB size (this has to be a mistake).

There's need to make further research to look for a better way of automating this process.

Actions #12

Updated by ph03nix over 1 year ago

  • Related to deleted (action #105160: Automatic triggering of Windows Image Update test runs)
Actions #13

Updated by ph03nix over 1 year ago

  • Has duplicate action #105160: Automatic triggering of Windows Image Update test runs added
Actions #14

Updated by ph03nix over 1 year ago

https://progress.opensuse.org/issues/105160 is a duplicate of this ticket.

Actions #15

Updated by pherranz over 1 year ago

Looks like Microsoft provides a sample script to update the system. It's not intended to be used in production, but we can extract some useful commands from it maybe.

https://learn.microsoft.com/en-us/windows/win32/wua_sdk/searching--downloading--and-installing-updates?redirectedfrom=MSDN

Actions #16

Updated by pherranz over 1 year ago

  • Status changed from Workable to In Progress
  • Assignee set to pherranz
Actions #17

Updated by pherranz over 1 year ago

Actions #18

Updated by pherranz over 1 year ago

After several days trying to use the script I found, several issues that prevent me from going on. Some of them are:

  • In Windows 11, the screen locks due to inactivity. After researching, it does not seem to be so easy to disable this feature through Powershell
  • When the flag /RebootToComplete is used to fully automate the installation, the script throws an error. I've dived into Microsoft's Windows Update Agent (WUA) API and looks like the script is using a function that is not defined, or deprecated, or I couldn't find in the reference, which causes it to fail
  • After checking with Martin Loviska, it seems that the best way of knowing that the updates have finished is wait_serial with a timeout of 1h, but the script does not outputs anything when finishes so the tests fails

There are two possibilities to have an updated Windows image:

  1. To create our own script that REALLY uses serial interface to notify when it has finished, and also learn how to disable "inactivity lock screen" in Win11
  2. Periodically download the qcow2 image from OSD, update it manually in a local VM and upload it again

Let's discuss this today in the qe-c standup meeting.

Actions #19

Updated by pherranz over 1 year ago

Actions #20

Updated by pherranz over 1 year ago

After some workout, the scripts communicates with the worker through the serial interface, so it knows when the update process has ended. These three VRs show good results:

Next step is to export the updated qcow image.

Actions #21

Updated by pherranz over 1 year ago

The update process works now. Pending to merge the PR

Actions #22

Updated by pherranz over 1 year ago

  • Status changed from In Progress to Resolved
Actions #23

Updated by ph03nix over 1 year ago

Actions #24

Updated by ph03nix 3 months ago

  • Tags set to WSL
Actions #25

Updated by ph03nix 3 months ago

  • Project changed from 199 to Containers and images
Actions

Also available in: Atom PDF