Repository: kubevirt/common-instancetypes
Pull request #383: feat(preference): Add Windows Server 2003 preference
Author: login: jcanocan
Labels: name: dco-signoff: yes
description: Indicates the PR's author has DCO signed all their commits.
name: size/M
name: lgtm
description: Indicates that a PR is ready to be merged.
name: release-note
description: Denotes a PR that will be considered when it comes time to generate release notes.
name: approved
description: Indicates a PR has been approved by an approver from all required OWNERS files.
Created: 2025-05-21T15:10:37Z | Merged: 2025-05-22T16:23:29Z

**What this PR does / why we need it**:

It adds `windows.2k3` preference and `rtl8139` component, as well as functional test and container disk flag.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes # [https://issues.redhat.com/browse/CNV-61457](https://issues.redhat.com/browse/CNV-61457)

**Special notes for your reviewer**:

**Release note**:
<!--  Write your release note:
1. Enter your extended release note in the below block. If the PR requires additional action from users switching to the new release, include the string "action required".
2. If no release note is required, just write "NONE".
-->
```release-note
Added `windows.2k3` preference for Windows Server 2003
```



Diff:
diff --git a/README.md b/README.md
index e6eb2070..fb57764c 100644
--- a/README.md
+++ b/README.md
@@ -320,4 +320,5 @@ windows.2k22 | Microsoft Windows Server 2022
 windows.2k22.virtio | Microsoft Windows Server 2022 (virtio)
 windows.2k25 | Microsoft Windows Server 2025
 windows.2k25.virtio | Microsoft Windows Server 2025 (virtio)
+windows.2k3 | Microsoft Windows Server 2003
 windows.xp | Microsoft Windows XP
diff --git a/preferences/components/interfacemodel-rtl8139/kustomization.yaml b/preferences/components/interfacemodel-rtl8139/kustomization.yaml
new file mode 100644
index 00000000..274e9d5d
--- /dev/null
+++ b/preferences/components/interfacemodel-rtl8139/kustomization.yaml
@@ -0,0 +1,11 @@
+---
+apiVersion: kustomize.config.k8s.io/v1alpha1
+kind: Component
+
+patches:
+  - path: ./rtl8139.yaml
+    target:
+      kind: VirtualMachinePreference
+  - path: ./rtl8139.yaml
+    target:
+      kind: VirtualMachineClusterPreference
diff --git a/preferences/components/interfacemodel-rtl8139/rtl8139.yaml b/preferences/components/interfacemodel-rtl8139/rtl8139.yaml
new file mode 100644
index 00000000..2ebf7690
--- /dev/null
+++ b/preferences/components/interfacemodel-rtl8139/rtl8139.yaml
@@ -0,0 +1,8 @@
+---
+apiVersion: instancetype.kubevirt.io/v1beta1
+kind: VirtualMachinePreference
+metadata:
+  name: rtl8139
+spec:
+  devices:
+    preferredInterfaceModel: rtl8139
diff --git a/preferences/windows/2k3/kustomization.yaml b/preferences/windows/2k3/kustomization.yaml
new file mode 100644
index 00000000..d8a59e5b
--- /dev/null
+++ b/preferences/windows/2k3/kustomization.yaml
@@ -0,0 +1,14 @@
+---
+apiVersion: kustomize.config.k8s.io/v1beta1
+kind: Kustomization
+
+resources:
+  - ../base
+
+components:
+  - ./metadata
+  - ./requirements
+  - ../../components/pcihole64
+  - ../../components/interfacemodel-rtl8139
+
+nameSuffix: ".2k3"
diff --git a/preferences/windows/2k3/metadata/kustomization.yaml b/preferences/windows/2k3/metadata/kustomization.yaml
new file mode 100644
index 00000000..9f42f6ec
--- /dev/null
+++ b/preferences/windows/2k3/metadata/kustomization.yaml
@@ -0,0 +1,11 @@
+---
+apiVersion: kustomize.config.k8s.io/v1alpha1
+kind: Component
+
+patches:
+  - path: ./metadata.yaml
+    target:
+      kind: VirtualMachinePreference
+  - path: ./metadata.yaml
+    target:
+      kind: VirtualMachineClusterPreference
diff --git a/preferences/windows/2k3/metadata/metadata.yaml b/preferences/windows/2k3/metadata/metadata.yaml
new file mode 100644
index 00000000..369887d1
--- /dev/null
+++ b/preferences/windows/2k3/metadata/metadata.yaml
@@ -0,0 +1,7 @@
+---
+apiVersion: instancetype.kubevirt.io/v1beta1
+kind: VirtualMachinePreference
+metadata:
+  name: metadata
+  annotations:
+    openshift.io/display-name: "Microsoft Windows Server 2003"
diff --git a/preferences/windows/2k3/requirements/kustomization.yaml b/preferences/windows/2k3/requirements/kustomization.yaml
new file mode 100644
index 00000000..91dcc692
--- /dev/null
+++ b/preferences/windows/2k3/requirements/kustomization.yaml
@@ -0,0 +1,11 @@
+---
+apiVersion: kustomize.config.k8s.io/v1alpha1
+kind: Component
+
+patches:
+  - path: ./requirements.yaml
+    target:
+      kind: VirtualMachinePreference
+  - path: ./requirements.yaml
+    target:
+      kind: VirtualMachineClusterPreference
diff --git a/preferences/windows/2k3/requirements/requirements.yaml b/preferences/windows/2k3/requirements/requirements.yaml
new file mode 100644
index 00000000..93d7f0b4
--- /dev/null
+++ b/preferences/windows/2k3/requirements/requirements.yaml
@@ -0,0 +1,12 @@
+---
+apiVersion: instancetype.kubevirt.io/v1beta1
+kind: VirtualMachinePreference
+metadata:
+  name: requirements
+spec:
+  # https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2003/cc738496(v=ws.10)#windows-server-2003-standard-edition-system-requirements-1
+  requirements:
+    cpu:
+      guest: 1
+    memory:
+      guest: 256Mi
diff --git a/preferences/windows/kustomization.yaml b/preferences/windows/kustomization.yaml
index 822d7cb5..a90d946d 100644
--- a/preferences/windows/kustomization.yaml
+++ b/preferences/windows/kustomization.yaml
@@ -3,6 +3,7 @@ apiVersion: kustomize.config.k8s.io/v1beta1
 kind: Kustomization
 
 resources:
+  - ./2k3
   - ./2k16
   - ./2k16_virtio
   - ./2k19
diff --git a/tests/functests/instancetype_test.go b/tests/functests/instancetype_test.go
index 350d394a..55e20f93 100644
--- a/tests/functests/instancetype_test.go
+++ b/tests/functests/instancetype_test.go
@@ -272,6 +272,9 @@ var _ = Describe("Common instance types func tests", func() {
 			Entry("[test_id:????] Windows 11", windows11ContainerDisk, "u1.2xmedium",
 				map[string]string{"amd64": "windows.11.virtio"},
 				[]testFn{expectGuestAgentToBeConnected, expectSSHToRunCommandOnWindows}),
+			Entry("[test_id:????] Windows Server 2003", windows2k3ContainerDisk, "u1.nano",
+				map[string]string{"amd64": "windows.2k3"},
+				[]testFn{expectGuestAgentToBeConnected}),
 			Entry("[test_id:????] Windows Server 2016", windows2k16ContainerDisk, "u1.2xmedium",
 				map[string]string{"amd64": "windows.2k16.virtio"},
 				[]testFn{expectGuestAgentToBeConnected, expectSSHToRunCommandOnWindows}),
diff --git a/tests/functests/test_suite_test.go b/tests/functests/test_suite_test.go
index f5dd8179..afee1dfa 100644
--- a/tests/functests/test_suite_test.go
+++ b/tests/functests/test_suite_test.go
@@ -44,6 +44,7 @@ const (
 	defaultValidationOsContainerDisk       = "registry:5000/validation-os-container-disk:latest"
 	defaultWindows10ContainerDisk          = "registry:5000/windows10-container-disk:latest"
 	defaultWindows11ContainerDisk          = "registry:5000/windows11-container-disk:latest"
+	defaultWindows2k3ContainerDisk         = "registry:5000/windows2k3-container-disk:latest"
 	defaultWindows2k16ContainerDisk        = "registry:5000/windows2k16-container-disk:latest"
 	defaultWindows2k19ContainerDisk        = "registry:5000/windows2k19-container-disk:latest"
 	defaultWindows2k22ContainerDisk        = "registry:5000/windows2k22-container-disk:latest"
@@ -71,6 +72,7 @@ var (
 	validationOsContainerDisk       string
 	windows10ContainerDisk          string
 	windows11ContainerDisk          string
+	windows2k3ContainerDisk         string
 	windows2k16ContainerDisk        string
 	windows2k19ContainerDisk        string
 	windows2k22ContainerDisk        string
@@ -134,6 +136,8 @@ func init() {
 		defaultWindows10ContainerDisk, "Windows 10 container disk used by functional tests")
 	flag.StringVar(&windows11ContainerDisk, "windows-11-container-disk",
 		defaultWindows11ContainerDisk, "Windows 11 container disk used by functional tests")
+	flag.StringVar(&windows2k3ContainerDisk, "windows-2k3-container-disk",
+		defaultWindows2k3ContainerDisk, "Windows Server 2003 container disk used by functional tests")
 	flag.StringVar(&windows2k16ContainerDisk, "windows-2k16-container-disk",
 		defaultWindows2k16ContainerDisk, "Windows Server 2016 container disk used by functional tests")
 	flag.StringVar(&windows2k19ContainerDisk, "windows-2k19-container-disk",


Reviews:
user: login: 0xFelix
body: /lgtm
state: APPROVED
author_association: MEMBER
submitted_at: 2025-05-22T09:44:16Z
user: login: codingben
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-22T09:51:14Z
user: login: jcanocan
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-22T10:09:14Z
user: login: 0xFelix
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-22T12:00:15Z
user: login: jcanocan
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-22T13:12:20Z
user: login: codingben
body: /lgtm
state: APPROVED
author_association: MEMBER
submitted_at: 2025-05-22T13:36:49Z
user: login: codingben
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-05-22T13:37:14Z
user: login: jcanocan
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-22T13:39:54Z
user: login: jcanocan
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-22T14:32:54Z

Review comments:
diff_hunk: @@ -0,0 +1,12 @@
+---
+apiVersion: instancetype.kubevirt.io/v1beta1
+kind: VirtualMachinePreference
+metadata:
+  name: requirements
+spec:
+  # https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2003/cc738496(v=ws.10)#windows-server-2003-standard-edition-system-requirements-1
+  requirements:
+    cpu:
+      guest: 1
+    memory:
+      guest: 256Mi
path: preferences/windows/2k3/requirements/requirements.yaml
user: login: codingben
body: I see that you're using `u1.nano` which is a `512Mi` from the resources table. Is it valid?
created_at: 2025-05-22T09:51:13Z
author_association: MEMBER
diff_hunk: @@ -0,0 +1,12 @@
+---
+apiVersion: instancetype.kubevirt.io/v1beta1
+kind: VirtualMachinePreference
+metadata:
+  name: requirements
+spec:
+  # https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2003/cc738496(v=ws.10)#windows-server-2003-standard-edition-system-requirements-1
+  requirements:
+    cpu:
+      guest: 1
+    memory:
+      guest: 256Mi
path: preferences/windows/2k3/requirements/requirements.yaml
user: login: jcanocan
body: Here, we define the minimum memory required for this to work. The instancetype with the smallest amount of memory is `u1.nano`. Therefore, yes, it is correct imho.
created_at: 2025-05-22T10:09:13Z
author_association: CONTRIBUTOR
diff_hunk: @@ -272,6 +272,9 @@ var _ = Describe("Common instance types func tests", func() {
 			Entry("[test_id:????] Windows 11", windows11ContainerDisk, "u1.2xmedium",
 				map[string]string{"amd64": "windows.11.virtio"},
 				[]testFn{expectGuestAgentToBeConnected, expectSSHToRunCommandOnWindows}),
+			Entry("[test_id:????] Windows Server 2003", windows2k3ContainerDisk, "u1.nano",
+				map[string]string{"amd64": "windows.2k3"},
+				[]testFn{expectGuestAgentToBeConnected, expectSSHToRunCommandOnWindows}),
path: tests/functests/instancetype_test.go
user: login: 0xFelix
body: We could think about dropping the requirement for SSH. IMO the guest agent suffices.
created_at: 2025-05-22T12:00:15Z
author_association: MEMBER
diff_hunk: @@ -272,6 +272,9 @@ var _ = Describe("Common instance types func tests", func() {
 			Entry("[test_id:????] Windows 11", windows11ContainerDisk, "u1.2xmedium",
 				map[string]string{"amd64": "windows.11.virtio"},
 				[]testFn{expectGuestAgentToBeConnected, expectSSHToRunCommandOnWindows}),
+			Entry("[test_id:????] Windows Server 2003", windows2k3ContainerDisk, "u1.nano",
+				map[string]string{"amd64": "windows.2k3"},
+				[]testFn{expectGuestAgentToBeConnected, expectSSHToRunCommandOnWindows}),
path: tests/functests/instancetype_test.go
user: login: jcanocan
body: Done.
created_at: 2025-05-22T13:12:19Z
author_association: CONTRIBUTOR
diff_hunk: @@ -272,6 +272,9 @@ var _ = Describe("Common instance types func tests", func() {
 			Entry("[test_id:????] Windows 11", windows11ContainerDisk, "u1.2xmedium",
 				map[string]string{"amd64": "windows.11.virtio"},
 				[]testFn{expectGuestAgentToBeConnected, expectSSHToRunCommandOnWindows}),
+			Entry("[test_id:????] Windows Server 2003", windows2k3ContainerDisk, "u1.nano",
+				map[string]string{"amd64": "windows.2k3"},
+				[]testFn{expectGuestAgentToBeConnected, expectSSHToRunCommandOnWindows}),
path: tests/functests/instancetype_test.go
user: login: codingben
body: @jcanocan Do you want also to drop it in Windows XP, in another PR later?
created_at: 2025-05-22T13:37:14Z
author_association: MEMBER
diff_hunk: @@ -272,6 +272,9 @@ var _ = Describe("Common instance types func tests", func() {
 			Entry("[test_id:????] Windows 11", windows11ContainerDisk, "u1.2xmedium",
 				map[string]string{"amd64": "windows.11.virtio"},
 				[]testFn{expectGuestAgentToBeConnected, expectSSHToRunCommandOnWindows}),
+			Entry("[test_id:????] Windows Server 2003", windows2k3ContainerDisk, "u1.nano",
+				map[string]string{"amd64": "windows.2k3"},
+				[]testFn{expectGuestAgentToBeConnected, expectSSHToRunCommandOnWindows}),
path: tests/functests/instancetype_test.go
user: login: jcanocan
body: Yes, I will do it in a follow-up PR. It is quite unrelated with this one.
created_at: 2025-05-22T13:39:54Z
author_association: CONTRIBUTOR
diff_hunk: @@ -272,6 +272,9 @@ var _ = Describe("Common instance types func tests", func() {
 			Entry("[test_id:????] Windows 11", windows11ContainerDisk, "u1.2xmedium",
 				map[string]string{"amd64": "windows.11.virtio"},
 				[]testFn{expectGuestAgentToBeConnected, expectSSHToRunCommandOnWindows}),
+			Entry("[test_id:????] Windows Server 2003", windows2k3ContainerDisk, "u1.nano",
+				map[string]string{"amd64": "windows.2k3"},
+				[]testFn{expectGuestAgentToBeConnected, expectSSHToRunCommandOnWindows}),
path: tests/functests/instancetype_test.go
user: login: jcanocan
body: Here we go: https://github.com/kubevirt/common-instancetypes/pull/384
created_at: 2025-05-22T14:32:54Z
author_association: CONTRIBUTOR

PR comments:
user: login: jcanocan
created_at: 2025-05-21T15:11:18Z
body: /cc @0xFelix 
author_association: CONTRIBUTOR
user: login: kubevirt-bot
created_at: 2025-05-22T13:20:09Z
body: @jcanocan: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-common-instancetypes-kubevirt-functest-fedora-s390x | d1ef708ad4547adc21ab3ccbb095d0ac9569b59f | [link](https://prow.ci.kubevirt.io/view/gs/kubevirt-prow/pr-logs/pull/kubevirt_common-instancetypes/383/pull-common-instancetypes-kubevirt-functest-fedora-s390x/1925540210548936704) | false | `/test pull-common-instancetypes-kubevirt-functest-fedora-s390x`

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
author_association: CONTRIBUTOR
user: login: lyarwood
created_at: 2025-05-22T16:21:57Z
body: /approve
author_association: MEMBER
user: login: kubevirt-bot
created_at: 2025-05-22T16:22:02Z
body: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/kubevirt/common-instancetypes/pull/383#issuecomment-2901843486" title="Approved">lyarwood</a>*

The full list of commands accepted by this bot can be found [here](https://prow.ci.kubevirt.io/command-help?repo=kubevirt%2Fcommon-instancetypes).

The pull request process is described [here](https://github.com/kubevirt/community/blob/main/docs/add-merge-automation-to-your-repository.md#example-workflow)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/kubevirt/common-instancetypes/blob/main/OWNERS)~~ [lyarwood]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->
author_association: CONTRIBUTOR