Skip to content

Commit

Permalink
feat: add win2k25 as supported for the efi pipeline
Browse files Browse the repository at this point in the history
Signed-off-by: Karel Simon <[email protected]>
  • Loading branch information
ksimon1 committed Nov 20, 2024
1 parent cff603f commit b05c65b
Show file tree
Hide file tree
Showing 12 changed files with 497 additions and 14 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ Visit [RBAC permissions for running the tasks](docs/tasks-rbac-permissions.md) i

#### [Windows EFI Installer Pipeline](release/pipelines/windows-efi-installer)

Downloads a Windows ISO file into a PVC and automatically installs Windows 10, 11 or Server 2k22 with EFI enabled by using a custom Answer file into a new base DataVolume.
Supported Windows versions: Windows 10, 11, Server 2k22
Downloads a Windows ISO file into a PVC and automatically installs Windows 10, 11 or Server 2k22, 2k25 with EFI enabled by using a custom Answer file into a new base DataVolume.
Supported Windows versions: Windows 10, 11, Server 2k22, 2k25

#### [Windows Customize Pipeline](release/pipelines/windows-customize)

Applies customizations to an existing Windows 10, 11, Server 2k22 installation by using a custom Answer file and creates a new base DataVolume.
Supported Windows versions: Windows 10, 11, Server 2k22
Applies customizations to an existing Windows 10, 11, Server 2k22, 2k25 installation by using a custom Answer file and creates a new base DataVolume.
Supported Windows versions: Windows 10, 11, Server 2k22, 2k25

#### [Disk Uploader Pipeline](release/pipelines/disk-uploader)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
generateName: windows2k25-customize-run-
labels:
pipelinerun: windows2k25-customize-run
spec:
params:
- name: sourceDiskImageName
value: win2k25
- name: baseDvName
value: win2k25-customized
- name: preferenceName
value: windows.2k25.virtio
- name: customizeConfigMapName
value: windows-sqlserver
pipelineRef:
name: windows-customize
19 changes: 19 additions & 0 deletions automation/e2e-pipelines/test-files/windows2k25-dv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
apiVersion: cdi.kubevirt.io/v1beta1
kind: DataVolume
metadata:
name: iso-dv
annotations:
cdi.kubevirt.io/storage.bind.immediate.requested: "true"
spec:
source:
registry:
url: docker://quay.io/openshift-cnv/containerdisks:Win2025_English_x64
secretRef: tekton-tasks-container-disk-puller
storage:
volumeMode: Filesystem
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 8Gi
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
generateName: windows2k25-installer-run-
labels:
pipelinerun: windows2k25-installer-run
spec:
params:
- name: winImageDownloadURL
value: http://http-server/disk.img
- name: acceptEula
value: "true"
- name: preferenceName
value: windows.2k25.virtio
- name: autounattendConfigMapName
value: windows2k25-autounattend
- name: baseDvName
value: win2k25
- name: isoDVName
value: win2k25
pipelineRef:
name: windows-efi-installer
48 changes: 45 additions & 3 deletions release/pipelines/windows-efi-installer/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Windows EFI Installer Pipeline

This Pipeline installs Windows 10, 11 or Server 2k22 into a new DataVolume. This DataVolume is suitable to be used as a default boot source
or golden image for Windows 10, 11 or Server 2k22 VirtualMachines.
This Pipeline installs Windows 10, 11 or Server 2k22, 2k25 into a new DataVolume. This DataVolume is suitable to be used as a default boot source
or golden image for Windows 10, 11 or Server 2k22, 2k25 VirtualMachines.

This example Pipeline is suitable only for Windows 10, 11 or Server 2k22 (or other Windows versions which require EFI - not tested!). When using this example Pipeline always adjust Pipeline parameters for Windows version you are currently using (e.g. different name, different autoattend config map, different base image name, etc.). Each Windows version requires change in autounattendConfigMapName parameter (e.g. using `windows2k22-autounattend` config map will not work with Windows 11 and vice versa - e.g. due to different storage drivers path).
This example Pipeline is suitable only for Windows 10, 11 or Server 2k22, 2k25 (or other Windows versions which require EFI - not tested!). When using this example Pipeline always adjust Pipeline parameters for Windows version you are currently using (e.g. different name, different autoattend config map, different base image name, etc.). Each Windows version requires change in autounattendConfigMapName parameter (e.g. using `windows2k22-autounattend` config map will not work with Windows 11 and vice versa - e.g. due to different storage drivers path).

The Pipeline implements this by modifying the supplied Windows ISO. It extracts all files from the ISO, replaces the prompt bootloader with the no-prompt bootloader and creates a new bootable ISO.
This helps with automated installation of Windows in EFI boot mode. By default Windows in EFI boot mode uses a prompt bootloader, which will not continue with the boot process until a key is pressed. By replacing it with the no-prompt bootloader no key press is required to boot into the Windows installer. Then Task packs updated packages to new ISO, converts it with qemu-img and replaces original ISO file in PVC.
Expand Down Expand Up @@ -199,6 +199,48 @@ spec:
timeout: 1h0m0s
EOF
```
```yaml
oc create -f - <<EOF
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
generateName: windows2k25-installer-run-
spec:
params:
- name: winImageDownloadURL
value: ${WIN_IMAGE_DOWNLOAD_URL}
- name: acceptEula
value: false
- name: preferenceName
value: windows.2k25.virtio
- name: autounattendConfigMapName
value: windows2k25-autounattend
- name: baseDvName
value: win2k25
- name: isoDVName
value: win2k25
pipelineRef:
params:
- name: catalog
value: kubevirt-tekton-pipelines
- name: type
value: artifact
- name: kind
value: pipeline
- name: name
value: windows-efi-installer
- name: version
value: v0.22.0
resolver: hub
taskRunSpecs:
- pipelineTaskName: modify-windows-iso-file
podTemplate:
securityContext:
fsGroup: 107
runAsUser: 107
timeout: 1h0m0s
EOF
```

## Cancelling/Deleting PipelineRuns

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -448,3 +448,153 @@ data:
# Eject CD, to avoid that the unattend.xml on the CD is picked up by sysprep
(New-Object -COMObject Shell.Application).NameSpace(17).ParseName("F:").InvokeVerb("Eject")
---
apiVersion: v1
kind: ConfigMap
metadata:
name: windows2k25-autounattend
data:
autounattend.xml: |
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
<servicing>
<package action="configure">
<assemblyIdentity name="Microsoft-Windows-ServerDatacenterEvalEdition" version="10.0.20348.587" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="" />
</package>
</servicing>
<settings pass="windowsPE">
<component language="neutral" name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SetupUILanguage>
<UILanguage>en-US</UILanguage>
</SetupUILanguage>
<InputLocale>en-US</InputLocale>
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
<UILanguageFallback>en-US</UILanguageFallback>
<UserLocale>en-US</UserLocale>
</component>
<component language="neutral" name="Microsoft-Windows-PnpCustomizationsWinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DriverPaths>
<PathAndCredentials wcm:action="add" wcm:keyValue="1">
<Path>E:\amd64\2k25\</Path>
</PathAndCredentials>
</DriverPaths>
</component>
<component language="neutral" name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<DiskConfiguration>
<Disk wcm:action="add">
<CreatePartitions>
<CreatePartition wcm:action="add">
<Order>1</Order>
<Type>Primary</Type>
<Size>700</Size>
</CreatePartition>
<CreatePartition wcm:action="add">
<Order>2</Order>
<Type>EFI</Type>
<Size>100</Size>
</CreatePartition>
<CreatePartition wcm:action="add">
<Order>3</Order>
<Type>MSR</Type>
<Size>128</Size>
</CreatePartition>
<CreatePartition wcm:action="add">
<Order>4</Order>
<Type>Primary</Type>
<Extend>true</Extend>
</CreatePartition>
</CreatePartitions>
<ModifyPartitions>
<ModifyPartition wcm:action="add">
<Order>1</Order>
<PartitionID>1</PartitionID>
<Label>WINRE</Label>
<Format>NTFS</Format>
<TypeID>DE94BBA4-06D1-4D40-A16A-BFD50179D6AC</TypeID>
</ModifyPartition>
<ModifyPartition wcm:action="add">
<Order>2</Order>
<PartitionID>2</PartitionID>
<Label>EFI</Label>
<Format>FAT32</Format>
</ModifyPartition>
<ModifyPartition wcm:action="add">
<Order>3</Order>
<PartitionID>3</PartitionID>
</ModifyPartition>
<ModifyPartition wcm:action="add">
<Order>4</Order>
<PartitionID>4</PartitionID>
<Label>Windows</Label>
<Letter>C</Letter>
<Format>NTFS</Format>
</ModifyPartition>
</ModifyPartitions>
<DiskID>0</DiskID>
<WillWipeDisk>true</WillWipeDisk>
</Disk>
</DiskConfiguration>
<ImageInstall>
<OSImage>
<InstallFrom>
<MetaData wcm:action="add">
<Key>/IMAGE/NAME</Key>
<Value>Windows Server 2025 SERVERSTANDARDCORE</Value>
</MetaData>
</InstallFrom>
<InstallTo>
<DiskID>0</DiskID>
<PartitionID>4</PartitionID>
</InstallTo>
</OSImage>
</ImageInstall>
<UserData>
<AcceptEula>false</AcceptEula>
<FullName>AdminAccount</FullName>
<Organization>OrgName</Organization>
</UserData>
</component>
</settings>
<settings pass="specialize">
<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<InputLocale>0409:00000409</InputLocale>
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
<UserLocale>en-US</UserLocale>
</component>
</settings>
<settings pass="oobeSystem">
<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<Reseal>
<Mode>Audit</Mode>
</Reseal>
</component>
</settings>
<settings pass="auditUser">
<component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Path>PowerShell -ExecutionPolicy Bypass -NoProfile F:\post-install.ps1</Path>
<Description>Run post-install script</Description>
</RunSynchronousCommand>
</RunSynchronous>
<Generalize>
<ForceShutdownNow>true</ForceShutdownNow>
<Mode>OOBE</Mode>
</Generalize>
</component>
</settings>
</unattend>
post-install.ps1: |
# Install virtio guest drivers
Start-Process msiexec -Wait -ArgumentList "/i E:\virtio-win-gt-x64.msi /qn /passive /norestart"
# Install qemu guest agent
Start-Process msiexec -Wait -ArgumentList "/i E:\guest-agent\qemu-ga-x86_64.msi /qn /passive /norestart"
# Rename cached unattend.xml to avoid it is picked up by sysprep
mv C:\Windows\Panther\unattend.xml C:\Windows\Panther\unattend.install.xml
# Eject CD, to avoid that the unattend.xml on the CD is picked up by sysprep
(New-Object -COMObject Shell.Application).NameSpace(17).ParseName("F:").InvokeVerb("Eject")
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,43 @@ spec:
runAsUser: 107
fsGroup: 107
timeout: 1h0m0s
---
apiVersion: tekton.dev/v1
kind: PipelineRun
metadata:
generateName: windows2k25-installer-run-
spec:
params:
- name: winImageDownloadURL
value: ${WIN_IMAGE_DOWNLOAD_URL}
- name: acceptEula
value: false
- name: preferenceName
value: windows.2k25.virtio
- name: autounattendConfigMapName
value: windows2k25-autounattend
- name: baseDvName
value: win2k25
- name: isoDVName
value: win2k25
pipelineRef:
resolver: hub
params:
- name: catalog
value: kubevirt-tekton-pipelines
- name: type
value: artifact
- name: kind
value: pipeline
- name: name
value: windows-efi-installer
- name: version
value: v0.22.0
taskRunSpecs:
- pipelineTaskName: "modify-windows-iso-file"
podTemplate:
securityContext:
runAsUser: 107
fsGroup: 107
timeout: 1h0m0s

Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ metadata:
name: windows-efi-installer
spec:
description: >-
This pipeline installs Windows 10/11/2k22 into a new DataVolume. Then the
This pipeline installs Windows 10/11/2k22/2k25 into a new DataVolume. Then the
DataVolume is suitable to be used as a default boot source or golden image
for Windows 10/11/2k22 VMs. Different OS versions requires different
for Windows 10/11/2k22/2k25 VMs. Different OS versions requires different
customizeConfigMapName parameter with unattend.xml.
params:
- description: Download URL to Windows 10, 11 or server 2022 installation ISO (English United States x64 version is needed). You can follow https://www.microsoft.com/en-us/software-download/windows11 or https://www.microsoft.com/en-us/evalcenter/evaluate-windows-server-2022 to get one.
Expand Down
6 changes: 3 additions & 3 deletions templates-pipelines/windows-efi-installer/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Windows EFI Installer Pipeline

This Pipeline installs Windows 10, 11 or Server 2k22 into a new DataVolume. This DataVolume is suitable to be used as a default boot source
or golden image for Windows 10, 11 or Server 2k22 VirtualMachines.
This Pipeline installs Windows 10, 11 or Server 2k22, 2k25 into a new DataVolume. This DataVolume is suitable to be used as a default boot source
or golden image for Windows 10, 11 or Server 2k22, 2k25 VirtualMachines.

This example Pipeline is suitable only for Windows 10, 11 or Server 2k22 (or other Windows versions which require EFI - not tested!). When using this example Pipeline always adjust Pipeline parameters for Windows version you are currently using (e.g. different name, different autoattend config map, different base image name, etc.). Each Windows version requires change in autounattendConfigMapName parameter (e.g. using `windows2k22-autounattend` config map will not work with Windows 11 and vice versa - e.g. due to different storage drivers path).
This example Pipeline is suitable only for Windows 10, 11 or Server 2k22, 2k25 (or other Windows versions which require EFI - not tested!). When using this example Pipeline always adjust Pipeline parameters for Windows version you are currently using (e.g. different name, different autoattend config map, different base image name, etc.). Each Windows version requires change in autounattendConfigMapName parameter (e.g. using `windows2k22-autounattend` config map will not work with Windows 11 and vice versa - e.g. due to different storage drivers path).

The Pipeline implements this by modifying the supplied Windows ISO. It extracts all files from the ISO, replaces the prompt bootloader with the no-prompt bootloader and creates a new bootable ISO.
This helps with automated installation of Windows in EFI boot mode. By default Windows in EFI boot mode uses a prompt bootloader, which will not continue with the boot process until a key is pressed. By replacing it with the no-prompt bootloader no key press is required to boot into the Windows installer. Then Task packs updated packages to new ISO, converts it with qemu-img and replaces original ISO file in PVC.
Expand Down
Loading

0 comments on commit b05c65b

Please sign in to comment.