diff --git a/README.md b/README.md index 125cfd6f1..c3f181102 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/automation/e2e-pipelines/test-files/windows2k25-customize-pipelinerun.yaml b/automation/e2e-pipelines/test-files/windows2k25-customize-pipelinerun.yaml new file mode 100644 index 000000000..031f020ce --- /dev/null +++ b/automation/e2e-pipelines/test-files/windows2k25-customize-pipelinerun.yaml @@ -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 diff --git a/automation/e2e-pipelines/test-files/windows2k25-dv.yaml b/automation/e2e-pipelines/test-files/windows2k25-dv.yaml new file mode 100644 index 000000000..38bc66b49 --- /dev/null +++ b/automation/e2e-pipelines/test-files/windows2k25-dv.yaml @@ -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 diff --git a/automation/e2e-pipelines/test-files/windows2k25-installer-pipelinerun.yaml b/automation/e2e-pipelines/test-files/windows2k25-installer-pipelinerun.yaml new file mode 100644 index 000000000..2c960a03d --- /dev/null +++ b/automation/e2e-pipelines/test-files/windows2k25-installer-pipelinerun.yaml @@ -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 diff --git a/release/pipelines/windows-efi-installer/README.md b/release/pipelines/windows-efi-installer/README.md index be85e30a4..7e03b4572 100644 --- a/release/pipelines/windows-efi-installer/README.md +++ b/release/pipelines/windows-efi-installer/README.md @@ -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. @@ -199,6 +199,48 @@ spec: timeout: 1h0m0s EOF ``` +```yaml +oc create -f - < + + + + + + + + + + en-US + + en-US + en-US + en-US + en-US + en-US + + + + + E:\amd64\2k25\ + + + + + + + + + 1 + Primary + 700 + + + 2 + EFI + 100 + + + 3 + MSR + 128 + + + 4 + Primary + true + + + + + 1 + 1 + + NTFS + DE94BBA4-06D1-4D40-A16A-BFD50179D6AC + + + 2 + 2 + + FAT32 + + + 3 + 3 + + + 4 + 4 + + C + NTFS + + + 0 + true + + + + + + + /IMAGE/NAME + Windows Server 2025 SERVERSTANDARDCORE + + + + 0 + 4 + + + + + false + AdminAccount + OrgName + + + + + + 0409:00000409 + en-US + en-US + en-US + + + + + + Audit + + + + + + + + 1 + PowerShell -ExecutionPolicy Bypass -NoProfile F:\post-install.ps1 + Run post-install script + + + + true + OOBE + + + + + 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") diff --git a/release/pipelines/windows-efi-installer/pipelineruns/pipelineruns.yaml b/release/pipelines/windows-efi-installer/pipelineruns/pipelineruns.yaml index b530a7968..7d81df1f5 100644 --- a/release/pipelines/windows-efi-installer/pipelineruns/pipelineruns.yaml +++ b/release/pipelines/windows-efi-installer/pipelineruns/pipelineruns.yaml @@ -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 + diff --git a/release/pipelines/windows-efi-installer/windows-efi-installer.yaml b/release/pipelines/windows-efi-installer/windows-efi-installer.yaml index 8599c8b70..60d985692 100644 --- a/release/pipelines/windows-efi-installer/windows-efi-installer.yaml +++ b/release/pipelines/windows-efi-installer/windows-efi-installer.yaml @@ -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. diff --git a/templates-pipelines/windows-efi-installer/README.md b/templates-pipelines/windows-efi-installer/README.md index 9e58b3823..904e4fabd 100644 --- a/templates-pipelines/windows-efi-installer/README.md +++ b/templates-pipelines/windows-efi-installer/README.md @@ -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. diff --git a/templates-pipelines/windows-efi-installer/configmaps/windows-efi-installer-configmaps.yaml b/templates-pipelines/windows-efi-installer/configmaps/windows-efi-installer-configmaps.yaml index ca83fb0da..9158bff61 100644 --- a/templates-pipelines/windows-efi-installer/configmaps/windows-efi-installer-configmaps.yaml +++ b/templates-pipelines/windows-efi-installer/configmaps/windows-efi-installer-configmaps.yaml @@ -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: | + + + + + + + + + + + en-US + + en-US + en-US + en-US + en-US + en-US + + + + + E:\amd64\2k25\ + + + + + + + + + 1 + Primary + 700 + + + 2 + EFI + 100 + + + 3 + MSR + 128 + + + 4 + Primary + true + + + + + 1 + 1 + + NTFS + DE94BBA4-06D1-4D40-A16A-BFD50179D6AC + + + 2 + 2 + + FAT32 + + + 3 + 3 + + + 4 + 4 + + C + NTFS + + + 0 + true + + + + + + + /IMAGE/NAME + Windows Server 2025 SERVERSTANDARDCORE + + + + 0 + 4 + + + + + false + AdminAccount + OrgName + + + + + + 0409:00000409 + en-US + en-US + en-US + + + + + + Audit + + + + + + + + 1 + PowerShell -ExecutionPolicy Bypass -NoProfile F:\post-install.ps1 + Run post-install script + + + + true + OOBE + + + + + 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") diff --git a/templates-pipelines/windows-efi-installer/manifests/windows-efi-installer.yaml b/templates-pipelines/windows-efi-installer/manifests/windows-efi-installer.yaml index 0648438c8..7bbebd377 100644 --- a/templates-pipelines/windows-efi-installer/manifests/windows-efi-installer.yaml +++ b/templates-pipelines/windows-efi-installer/manifests/windows-efi-installer.yaml @@ -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. diff --git a/templates-pipelines/windows-efi-installer/pipelineruns/pipelineruns.yaml b/templates-pipelines/windows-efi-installer/pipelineruns/pipelineruns.yaml index c7c80301b..d7256ce3c 100644 --- a/templates-pipelines/windows-efi-installer/pipelineruns/pipelineruns.yaml +++ b/templates-pipelines/windows-efi-installer/pipelineruns/pipelineruns.yaml @@ -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: {{ pipelines_catalog }} + - name: type + value: {{ catalog_type }} + - name: kind + value: pipeline + - name: name + value: {{ item.pipeline_name }} + - name: version + value: {{ catalog_version }} + taskRunSpecs: + - pipelineTaskName: "modify-windows-iso-file" + podTemplate: + securityContext: + runAsUser: 107 + fsGroup: 107 + timeout: 1h0m0s +