Skip to content

Commit f83c88f

Browse files
feat: provide unified Windows golden image manifest for customers
Replace byoi.yaml with a single golden-image.yaml manifest that gives customers everything needed to create and configure a Windows Server 2022 golden image. Two methods in one file: - Method 1 (default): Tekton pipeline installs Windows from ISO with sysprep (SSH, guest agent, Administrator/Administrator, vTPM). - Method 2 (alternative): DataVolume import for users who already have a prepared image (HTTP, registry, PVC clone, or upload). This addresses the review feedback to "provide the customer with exactly what is needed, i.e. a Tekton pipeline" — single oc apply, full automation. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 7b03948 commit f83c88f

8 files changed

Lines changed: 989 additions & 343 deletions

File tree

README.md

Lines changed: 58 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -248,52 +248,89 @@ $ podman run -e OCP_VIRT_VALIDATION_IMAGE=${OCP_VIRT_VALIDATION_IMAGE} -e DRY_RU
248248

249249
### Windows Testing (Optional)
250250

251-
The validation checkup supports optional Windows VM testing. When enabled, the checkup will:
252-
1. Create a Windows 11 golden image using the `windows-efi-installer` Tekton pipeline
253-
2. Run Windows-specific tests from the tier2 test suite
251+
The validation checkup supports optional Windows VM testing. There are two options:
254252

255-
#### Prerequisites for Windows Testing
256-
- **OpenShift Pipelines operator** must be installed on the cluster
257-
- **Internet access** is required to download the Windows ISO and fetch the pipeline from Artifact Hub (see [Disconnected Environments](#disconnected-environments) for air-gapped clusters)
258-
- **Sufficient storage** for the Windows golden image (~64GB recommended)
253+
#### Option 1: Customer-Managed (Apply Manifest)
259254

260-
#### Enabling Windows Testing
261-
To enable Windows testing, set the `ACCEPT_WINDOWS_EULA` environment variable to `true`:
255+
A ready-to-use manifest is provided that creates a Windows Server 2022 golden image from scratch using a Tekton pipeline. It includes namespace, RBAC, sysprep configuration, and a PipelineRun — single `oc apply`, full automation.
256+
257+
**Prerequisites:**
258+
- **OpenShift Pipelines operator** must be installed
259+
- **cluster-admin** access (for privileged SCC assignment)
260+
- **Internet access** to download the Windows ISO and fetch the pipeline from Artifact Hub (see [`disconnected/README.md`](disconnected/README.md) for air-gapped setups)
261+
- **Sufficient storage** (~64GB recommended for the Windows image)
262+
263+
**Setup:**
264+
265+
1. Apply the manifest:
266+
```bash
267+
oc apply -f manifests/windows/golden-image.yaml
268+
```
269+
2. Wait for the pipeline to complete (~1-2 hours):
270+
```bash
271+
oc get pipelinerun -n validation-os-images -w
272+
```
273+
3. Verify the DataSource is Ready:
274+
```bash
275+
oc get datasource win2k22 -n validation-os-images -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}'
276+
```
277+
4. Run the tool normally (no `ACCEPT_WINDOWS_EULA` needed):
278+
```bash
279+
podman run -e OCP_VIRT_VALIDATION_IMAGE=${OCP_VIRT_VALIDATION_IMAGE} ${OCP_VIRT_VALIDATION_IMAGE} generate | oc apply -f -
280+
```
281+
282+
The tool detects the existing DataSource and runs Windows tests automatically. After tests complete, **nothing is deleted** — your resources remain for future runs.
283+
284+
The manifest also includes a commented-out alternative (Method 2) for users who already have a prepared Windows image and want to import via HTTP, registry, or upload.
285+
286+
See [`manifests/windows/golden-image.yaml`](manifests/windows/golden-image.yaml) for full details and image requirements.
287+
288+
#### Option 2: Automated (Tool Creates Everything)
289+
290+
The tool downloads a Windows Server 2022 ISO, runs a Tekton pipeline to install it, and creates all resources. Everything is cleaned up after tests finish.
291+
292+
**Prerequisites:**
293+
- **OpenShift Pipelines operator** must be installed
294+
- **Internet access** to download the ISO and fetch the pipeline from Artifact Hub
295+
- **Sufficient storage** (~64GB recommended)
296+
- **`STORAGE_CLASS`** set to a valid storage class (required by the Windows setup script)
297+
298+
**Usage:**
262299
```bash
263300
$ podman run -e OCP_VIRT_VALIDATION_IMAGE=${OCP_VIRT_VALIDATION_IMAGE} \
264301
-e ACCEPT_WINDOWS_EULA=true \
302+
-e STORAGE_CLASS=<your-storage-class> \
265303
${OCP_VIRT_VALIDATION_IMAGE} generate
266304
```
267305

268306
**Note:** By setting `ACCEPT_WINDOWS_EULA=true`, you acknowledge acceptance of Microsoft's End User License Agreement for Windows.
269307

270-
#### Optional Windows Parameters
308+
**Optional Parameters:**
271309

272310
| Environment Variable | Description | Default |
273311
|---------------------|-------------|---------|
274312
| `ACCEPT_WINDOWS_EULA` | Enable Windows testing (must be `true` to enable) | `false` |
275-
| `WIN_IMAGE_DOWNLOAD_URL` | Custom Windows 11 ISO download URL | Default Microsoft URL |
276-
| `WIN_IMAGE_NAME` | Name of an existing Windows DataSource to use (skips golden image creation) | _(none)_ |
313+
| `WIN_IMAGE_DOWNLOAD_URL` | Custom Windows Server 2022 ISO download URL | Default Microsoft URL |
277314
| `TEKTON_PIPELINE_VERSION` | Version of the `windows-efi-installer` pipeline | `>=v4.21.0` |
278315

279316
Example with custom ISO URL:
280317
```bash
281318
$ podman run -e OCP_VIRT_VALIDATION_IMAGE=${OCP_VIRT_VALIDATION_IMAGE} \
282319
-e ACCEPT_WINDOWS_EULA=true \
283-
-e WIN_IMAGE_DOWNLOAD_URL="https://my-internal-server/windows11.iso" \
320+
-e STORAGE_CLASS=<your-storage-class> \
321+
-e WIN_IMAGE_DOWNLOAD_URL="https://my-internal-server/SERVER_EVAL_x64FRE_en-us.iso" \
284322
${OCP_VIRT_VALIDATION_IMAGE} generate
285323
```
286324

287-
#### How It Works
288-
When Windows testing is enabled:
325+
**How It Works:**
289326
1. The checkup verifies that the OpenShift Pipelines operator is installed
290-
2. A Windows 11 golden image is created in the `openshift-virtualization-os-images` namespace using the `windows-efi-installer` Tekton pipeline (fetched automatically via the hub resolver)
291-
3. The tier2 test suite includes Windows-specific tests marked with `@pytest.mark.windows`
292-
4. The golden image is reused for subsequent runs if it already exists
293-
294-
**Note:** The initial Windows image creation takes approximately 60-90 minutes. Subsequent runs will skip this step if the golden image already exists.
327+
2. Creates the `validation-os-images` namespace, RBAC, and runs the `windows-efi-installer` Tekton pipeline
328+
3. The pipeline downloads the ISO and installs Windows Server 2022 with OpenSSH, QEMU guest agent, and firewall disabled
329+
4. A DataSource (`win2k22`) is created backed by the output PVC
330+
5. The tier2 test suite runs tests matching `@pytest.mark.conformance`; when no golden image is available, tests with `@pytest.mark.windows` are excluded
331+
6. After tests complete, the entire `validation-os-images` namespace is deleted
295332

296-
**Note:** Windows-specific tests require the `@pytest.mark.windows` marker to be added to the [openshift-virtualization-tests](https://github.com/RedHatQE/openshift-virtualization-tests) repository. Until then, enabling Windows testing will prepare the golden image but no Windows-specific tests will run.
333+
**Note:** The initial Windows image creation takes approximately 1-2 hours (up to 3 hours on slow networks).
297334

298335
## Disconnected Environments
299336
The validation checkup can be run on disconnected (air-gapped) OpenShift clusters by mirroring the required test images to an accessible registry and configuring mirror sets (ITMS + IDMS). No changes to the checkup configuration are needed -- mirror sets transparently redirect image pulls at the CRI-O level.

disconnected/README.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -350,22 +350,26 @@ The script will:
350350

351351
Windows testing requires additional setup in disconnected environments because the `windows-efi-installer` Tekton pipeline normally uses the hub resolver to fetch the pipeline and tasks from Artifact Hub, which requires internet access.
352352

353+
**Recommended:** Apply `manifests/windows/golden-image.yaml` once. Pre-install the Tekton pipeline (see Step 2 below), set `winImageDownloadURL` to your internal ISO mirror in the manifest, and wait for the pipeline to finish. Then run the checkup **without** `ACCEPT_WINDOWS_EULA` — the tool detects the existing DataSource and skips the pipeline entirely, avoiding repeated downloads and rebuilds.
354+
355+
The steps below describe the **alternative (ephemeral)** path using `ACCEPT_WINDOWS_EULA=true`, which rebuilds the golden image on every run.
356+
353357
### Prerequisites for Disconnected Windows Testing
354358

355359
1. **OpenShift Pipelines operator** installed on the cluster
356-
2. **Windows 11 ISO** available on an accessible internal server
360+
2. **Windows Server 2022 ISO** available on an accessible internal server
357361
3. **Tekton pipeline and tasks** pre-installed manually
358362

359-
### Step 1: Download the Windows ISO
363+
### Step 1: Download the Windows Server 2022 ISO
360364

361-
Download the Windows 11 ISO from Microsoft on a connected machine and host it on an internal HTTP server accessible from the cluster:
365+
Download the Windows Server 2022 evaluation ISO from Microsoft on a connected machine and host it on an internal HTTP server accessible from the cluster:
362366

363367
```bash
364368
# On connected machine
365-
curl -L -o windows11.iso "https://software-static.download.prss.microsoft.com/dbazure/888969d5-f34g-4e03-ac9d-1f9786c66749/26200.6584.250915-1905.25h2_ge_release_svc_refresh_CLIENT_CONSUMER_x64FRE_en-us.iso"
369+
curl -L -o SERVER_EVAL_x64FRE_en-us.iso "https://software-static.download.prss.microsoft.com/sg/download/888969d5-f34g-4e03-ac9d-1f9786c66749/SERVER_EVAL_x64FRE_en-us.iso"
366370

367371
# Copy to your internal HTTP server
368-
scp windows11.iso user@internal-server:/var/www/html/images/
372+
scp SERVER_EVAL_x64FRE_en-us.iso user@internal-server:/var/www/html/images/
369373
```
370374

371375
### Step 2: Pre-install the Tekton Pipeline
@@ -387,10 +391,12 @@ curl -L -o windows-efi-installer-configmaps.yaml \
387391

388392
Transfer and apply to the disconnected cluster:
389393
```bash
390-
# Apply to the golden image namespace
391-
oc apply -f windows-efi-installer-tasks.yaml -n openshift-virtualization-os-images
392-
oc apply -f windows-efi-installer-configmaps.yaml -n openshift-virtualization-os-images
393-
oc apply -f windows-efi-installer.yaml -n openshift-virtualization-os-images
394+
oc create namespace validation-os-images
395+
oc label namespace validation-os-images app=ocp-virt-validation
396+
oc label namespace validation-os-images pod-security.kubernetes.io/enforce=privileged
397+
oc apply -f windows-efi-installer-tasks.yaml -n validation-os-images
398+
oc apply -f windows-efi-installer-configmaps.yaml -n validation-os-images
399+
oc apply -f windows-efi-installer.yaml -n validation-os-images
394400
```
395401

396402
Alternatively, get the manifests from Artifact Hub:
@@ -403,13 +409,14 @@ When running the validation checkup, specify your internal Windows ISO URL:
403409
```bash
404410
$ podman run -e OCP_VIRT_VALIDATION_IMAGE=${OCP_VIRT_VALIDATION_IMAGE} \
405411
-e ACCEPT_WINDOWS_EULA=true \
406-
-e WIN_IMAGE_DOWNLOAD_URL="http://internal-server.example.com/images/windows11.iso" \
412+
-e STORAGE_CLASS=<your-storage-class> \
413+
-e WIN_IMAGE_DOWNLOAD_URL="http://internal-server.example.com/images/SERVER_EVAL_x64FRE_en-us.iso" \
407414
${OCP_VIRT_VALIDATION_IMAGE} generate
408415
```
409416

410417
### Notes for Disconnected Windows Testing
411418

412-
- The Windows golden image will be created in the `openshift-virtualization-os-images` namespace
413-
- The image creation takes approximately 60-90 minutes on first run
414-
- Once created, the golden image is reused for subsequent test runs
419+
- The pipeline output PVC backs a `win2k22` DataSource in a custom `validation-os-images` namespace created by the tool -- no intermediate VMs or snapshots
420+
- The image creation takes approximately 1-2 hours on first run (up to 3 hours on slow networks)
421+
- With `ACCEPT_WINDOWS_EULA=true`, each run rebuilds the golden image from scratch and cleans up on completion
415422
- If the hub resolver fails (due to no internet), the checkup will provide instructions for manual pipeline installation

manifests/run/generate.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ STORAGE_CLASS=${STORAGE_CLASS:-""}
2020
STORAGE_CAPABILITIES=${STORAGE_CAPABILITIES:-""}
2121
ACCEPT_WINDOWS_EULA=${ACCEPT_WINDOWS_EULA:-"false"}
2222
WIN_IMAGE_DOWNLOAD_URL=${WIN_IMAGE_DOWNLOAD_URL:-""}
23-
WIN_IMAGE_NAME=${WIN_IMAGE_NAME:-""}
2423
TEKTON_PIPELINE_VERSION=${TEKTON_PIPELINE_VERSION:-""}
2524

2625
# Calculate storage size based on test suites (2Gi per suite, 10Gi for tier2)
@@ -224,8 +223,6 @@ spec:
224223
value: "${ACCEPT_WINDOWS_EULA}"
225224
- name: WIN_IMAGE_DOWNLOAD_URL
226225
value: "${WIN_IMAGE_DOWNLOAD_URL}"
227-
- name: WIN_IMAGE_NAME
228-
value: "${WIN_IMAGE_NAME}"
229226
- name: TEKTON_PIPELINE_VERSION
230227
value: "${TEKTON_PIPELINE_VERSION}"
231228
volumeMounts:

0 commit comments

Comments
 (0)