diff --git a/isar-apps/ocp-v/HyperConverged.yaml b/isar-apps/ocp-v/HyperConverged.yaml index e25a518..486d269 100644 --- a/isar-apps/ocp-v/HyperConverged.yaml +++ b/isar-apps/ocp-v/HyperConverged.yaml @@ -7,6 +7,7 @@ metadata: annotations: argocd.argoproj.io/sync-wave: "100" spec: + defaultCPUModel: IvyBridge-v2 # https://github.com/stormshift/support/issues/248 permittedHostDevices: pciHostDevices: diff --git a/isar-apps/ocp-v/instancetypes/README.md b/isar-apps/ocp-v/instancetypes/README.md new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/isar-apps/ocp-v/instancetypes/README.md @@ -0,0 +1 @@ + diff --git a/isar-apps/ocp-v/instancetypes/rhel-broadwell-vmcit.yaml b/isar-apps/ocp-v/instancetypes/rhel-broadwell-vmcit.yaml new file mode 100644 index 0000000..17513ee --- /dev/null +++ b/isar-apps/ocp-v/instancetypes/rhel-broadwell-vmcit.yaml @@ -0,0 +1,12 @@ +apiVersion: instancetype.kubevirt.io/v1beta1 +kind: VirtualMachineClusterInstancetype +metadata: + name: custom-rhel-broadwell-instancetype +spec: + cpu: + guest: 2 + model: "Broadwell-v4" + memory: + guest: "4Gi" + nodeSelector: + usage-broadwell: "yes" diff --git a/isar-apps/ocp-v/instancetypes/rhel-haswell-vmcit.yaml b/isar-apps/ocp-v/instancetypes/rhel-haswell-vmcit.yaml new file mode 100644 index 0000000..79cd77c --- /dev/null +++ b/isar-apps/ocp-v/instancetypes/rhel-haswell-vmcit.yaml @@ -0,0 +1,12 @@ +apiVersion: instancetype.kubevirt.io/v1beta1 +kind: VirtualMachineClusterInstancetype +metadata: + name: custom-rhel-haswell-instancetype +spec: + cpu: + guest: 2 + model: "Haswell-v4" + memory: + guest: "4Gi" + nodeSelector: + usage-haswell: "yes" diff --git a/isar-apps/ocp-v/instancetypes/rhel10-ds-custom-broadwell.yaml b/isar-apps/ocp-v/instancetypes/rhel10-ds-custom-broadwell.yaml new file mode 100644 index 0000000..ce9e7f3 --- /dev/null +++ b/isar-apps/ocp-v/instancetypes/rhel10-ds-custom-broadwell.yaml @@ -0,0 +1,19 @@ + +apiVersion: cdi.kubevirt.io/v1beta1 +kind: DataSource +metadata: + name: custom-rhel10-broadwell + namespace: custom-os-images + annotations: + virt.kubevirt.io/os-display-name: "RHEL 10 Custom (Broadwell)" + labels: + app.kubernetes.io/component: storage + kubevirt.io/dynamic-credentials-support: "true" + os.template.kubevirt.io/rhel10: "true" + instancetype.kubevirt.io/default-instancetype: rhel-broadwell-instancetype + instancetype.kubevirt.io/default-instancetype-kind: VirtualMachineClusterInstancetype +spec: + source: + pvc: + name: rhel10-clean-base + namespace: custom-os-images diff --git a/isar-apps/ocp-v/instancetypes/rhel10-ds-custom-haswell.yaml b/isar-apps/ocp-v/instancetypes/rhel10-ds-custom-haswell.yaml new file mode 100644 index 0000000..9a172ff --- /dev/null +++ b/isar-apps/ocp-v/instancetypes/rhel10-ds-custom-haswell.yaml @@ -0,0 +1,18 @@ +apiVersion: cdi.kubevirt.io/v1beta1 +kind: DataSource +metadata: + name: custom-rhel10-haswell + namespace: custom-os-images + annotations: + virt.kubevirt.io/os-display-name: "RHEL 10 Custom (Haswell)" + labels: + app.kubernetes.io/component: storage + kubevirt.io/dynamic-credentials-support: "true" + os.template.kubevirt.io/rhel10: "true" + instancetype.kubevirt.io/default-instancetype: rhel-haswell-instancetype + instancetype.kubevirt.io/default-instancetype-kind: VirtualMachineClusterInstancetype +spec: + source: + pvc: + name: rhel10-clean-base + namespace: custom-os-images diff --git a/isar-apps/ocp-v/instancetypes/rhel10-dv-import.yaml b/isar-apps/ocp-v/instancetypes/rhel10-dv-import.yaml new file mode 100644 index 0000000..5ae520b --- /dev/null +++ b/isar-apps/ocp-v/instancetypes/rhel10-dv-import.yaml @@ -0,0 +1,17 @@ +apiVersion: cdi.kubevirt.io/v1beta1 +kind: DataVolume +metadata: + name: rhel10-clean-base + namespace: custom-os-images +spec: + source: + registry: + url: "docker://registry.redhat.io/rhel10/rhel-guest-image:latest" + secretRef: redhat-registry-credentials + storage: + storageClassName: coe-netapp-san + accessModes: + - ReadWriteMany + resources: + requests: + storage: 30Gi diff --git a/isar-apps/ocp-v/instancetypes/rhel9-ds-custom-broadwell.yaml b/isar-apps/ocp-v/instancetypes/rhel9-ds-custom-broadwell.yaml new file mode 100644 index 0000000..772c6b0 --- /dev/null +++ b/isar-apps/ocp-v/instancetypes/rhel9-ds-custom-broadwell.yaml @@ -0,0 +1,18 @@ +apiVersion: cdi.kubevirt.io/v1beta1 +kind: DataSource +metadata: + name: custom-rhel10-broadwell + namespace: custom-os-images + annotations: + virt.kubevirt.io/os-display-name: "RHEL 10 Custom (Broadwell)" + labels: + app.kubernetes.io/component: storage + kubevirt.io/dynamic-credentials-support: "true" + os.template.kubevirt.io/rhel10: "true" + instancetype.kubevirt.io/default-instancetype: rhel-broadwell-instancetype + instancetype.kubevirt.io/default-instancetype-kind: VirtualMachineClusterInstancetype +spec: + source: + pvc: + name: rhel10-clean-base + namespace: custom-os-images diff --git a/isar-apps/ocp-v/instancetypes/rhel9-ds-custom-haswell.yaml b/isar-apps/ocp-v/instancetypes/rhel9-ds-custom-haswell.yaml new file mode 100644 index 0000000..1ffda5d --- /dev/null +++ b/isar-apps/ocp-v/instancetypes/rhel9-ds-custom-haswell.yaml @@ -0,0 +1,18 @@ +apiVersion: cdi.kubevirt.io/v1beta1 +kind: DataSource +metadata: + name: custom-rhel9-haswell + namespace: custom-os-images + annotations: + virt.kubevirt.io/os-display-name: "RHEL 9 Custom (Haswell)" + labels: + app.kubernetes.io/component: storage + kubevirt.io/dynamic-credentials-support: "true" + os.template.kubevirt.io/rhel9: "true" + instancetype.kubevirt.io/default-instancetype: "rhel-haswell-instancetype" + instancetype.kubevirt.io/default-instancetype-kind: "VirtualMachineClusterInstancetype" +spec: + source: + pvc: + name: rhel9-clean-base + namespace: custom-os-images diff --git a/isar-apps/ocp-v/instancetypes/rhel9-dv-import.yaml b/isar-apps/ocp-v/instancetypes/rhel9-dv-import.yaml new file mode 100644 index 0000000..dfddff1 --- /dev/null +++ b/isar-apps/ocp-v/instancetypes/rhel9-dv-import.yaml @@ -0,0 +1,17 @@ +apiVersion: cdi.kubevirt.io/v1beta1 +kind: DataVolume +metadata: + name: rhel9-clean-base + namespace: custom-os-images +spec: + source: + registry: + url: "docker://registry.redhat.io/rhel9/rhel-guest-image:latest" + secretRef: redhat-registry-credentials + storage: + storageClassName: coe-netapp-san + accessModes: + - ReadWriteMany + resources: + requests: + storage: 30Gi diff --git a/isar-apps/ocp-v/instancetypes/setup.yaml b/isar-apps/ocp-v/instancetypes/setup.yaml new file mode 100644 index 0000000..41a8114 --- /dev/null +++ b/isar-apps/ocp-v/instancetypes/setup.yaml @@ -0,0 +1,35 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: custom-os-images + labels: + openshift.io/cluster-monitoring: "true" +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: all-user-view-images + namespace: custom-os-images +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: view +subjects: +- kind: Group + name: system:authenticated + apiGroup: rbac.authorization.k8s.io +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: cdi-image-puller + namespace: custom-os-images +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: system:image-puller +subjects: +- kind: ServiceAccount + name: cdi-sa + namespace: openshift-cnv diff --git a/isar-apps/ocp-v/kustomization.yaml b/isar-apps/ocp-v/kustomization.yaml index e496c63..9504369 100644 --- a/isar-apps/ocp-v/kustomization.yaml +++ b/isar-apps/ocp-v/kustomization.yaml @@ -8,3 +8,5 @@ resources: #- OperatorGroup.yaml #- Subscription.yaml - MigrationPolicy/ +- instancetypes/ +- templates/ diff --git a/isar-apps/ocp-v/templates/README.md b/isar-apps/ocp-v/templates/README.md new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/isar-apps/ocp-v/templates/README.md @@ -0,0 +1 @@ + diff --git a/isar-apps/ocp-v/templates/rhel10-broadwell.yaml b/isar-apps/ocp-v/templates/rhel10-broadwell.yaml new file mode 100644 index 0000000..b7ce86c --- /dev/null +++ b/isar-apps/ocp-v/templates/rhel10-broadwell.yaml @@ -0,0 +1,104 @@ +kind: Template +apiVersion: template.openshift.io/v1 +metadata: + name: custom-rhel10-broadwell + namespace: openshift + labels: + app.kubernetes.io/name: custom-templates + flavor.template.kubevirt.io/medium: 'true' + os.template.kubevirt.io/rhel10.0: 'true' + template.kubevirt.io/architecture: amd64 + template.kubevirt.io/type: vm + vm.kubevirt.io/template: custom-rhel10-broadwell + vm.kubevirt.io/template.namespace: openshift + workload.template.kubevirt.io/server: 'true' + annotations: + description: RHEL 10 Template using the existing rhel10 VolumeSnapshot DataSource. + iconClass: icon-rhel + openshift.io/display-name: Red Hat Enterprise Linux 10 (Broadwell-v4) + openshift.io/provider-display-name: '' + tags: 'kubevirt,virtualmachine,rhel,rhel10' + template.kubevirt.io/provider: '' +objects: + - apiVersion: kubevirt.io/v1 + kind: VirtualMachine + metadata: + labels: + app: '${NAME}' + vm.kubevirt.io/template: custom-rhel10-broadwell + vm.kubevirt.io/template.namespace: openshift + name: '${NAME}' + spec: + dataVolumeTemplates: + - apiVersion: cdi.kubevirt.io/v1beta1 + kind: DataVolume + metadata: + name: '${NAME}' + spec: + sourceRef: + kind: DataSource + name: rhel10 + namespace: openshift-virtualization-os-images + storage: + resources: + requests: + storage: 30Gi + runStrategy: Halted + template: + metadata: + labels: + kubevirt.io/domain: '${NAME}' + spec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/hostname + operator: In + values: + - storm5 + - storm6 + matchFields: [] + domain: + cpu: + cores: 1 + sockets: 1 + threads: 1 + model: Broadwell-v4 + devices: + disks: + - disk: + bus: virtio + name: rootdisk + - disk: + bus: virtio + name: cloudinitdisk + interfaces: + - masquerade: {} + model: virtio + name: default + memory: + guest: 4Gi + networks: + - name: default + pod: {} + volumes: + - dataVolume: + name: '${NAME}' + name: rootdisk + - cloudInitNoCloud: + userData: |- + #cloud-config + user: cloud-user + password: ${CLOUD_USER_PASSWORD} + name: cloudinitdisk +parameters: + - name: NAME + description: Name for the new VM + generate: expression + from: 'rhel10-[a-z0-9]{6}' + - name: CLOUD_USER_PASSWORD + description: Password for cloud-user + generate: expression + from: '[a-z0-9]{8}' diff --git a/isar-apps/ocp-v/templates/rhel10-haswell.yaml b/isar-apps/ocp-v/templates/rhel10-haswell.yaml new file mode 100644 index 0000000..5262da7 --- /dev/null +++ b/isar-apps/ocp-v/templates/rhel10-haswell.yaml @@ -0,0 +1,110 @@ +kind: Template +apiVersion: template.openshift.io/v1 +metadata: + name: custom-rhel10-haswell + namespace: openshift + labels: + template.kubevirt.io/architecture: amd64 + os.template.kubevirt.io/rhel10.0: 'true' + template.kubevirt.io/type: vm + vm.kubevirt.io/template: custom-rhel10-haswell + flavor.template.kubevirt.io/medium: 'true' + template.kubevirt.io/default-os-variant: 'true' + app.kubernetes.io/name: custom-templates + vm.kubevirt.io/template.namespace: openshift + workload.template.kubevirt.io/server: 'true' + annotations: + description: RHEL 10 Template using the existing rhel10 VolumeSnapshot DataSource. + iconClass: icon-rhel + openshift.io/display-name: Red Hat Enterprise Linux 10 (Haswell-v4) + openshift.io/provider-display-name: '' + tags: 'kubevirt,virtualmachine,rhel,rhel10' + template.kubevirt.io/provider: '' +objects: + - apiVersion: kubevirt.io/v1 + kind: VirtualMachine + metadata: + labels: + app: '${NAME}' + vm.kubevirt.io/template: custom-rhel10-haswell + vm.kubevirt.io/template.namespace: openshift + name: '${NAME}' + spec: + dataVolumeTemplates: + - apiVersion: cdi.kubevirt.io/v1beta1 + kind: DataVolume + metadata: + name: '${NAME}' + spec: + sourceRef: + kind: DataSource + name: rhel10 + namespace: openshift-virtualization-os-images + storage: + resources: + requests: + storage: 30Gi + runStrategy: Halted + template: + metadata: + labels: + kubevirt.io/domain: '${NAME}' + spec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/hostname + operator: In + values: + - storm5 + - storm6 + - storm2 + - storm3 + matchFields: [] + domain: + cpu: + cores: 1 + sockets: 1 + threads: 1 + features: + - name: vmx-rdseed-exit + policy: disable + model: Haswell-v4 + devices: + disks: + - disk: + bus: virtio + name: rootdisk + - disk: + bus: virtio + name: cloudinitdisk + interfaces: + - masquerade: {} + model: virtio + name: default + memory: + guest: 4Gi + networks: + - name: default + pod: {} + volumes: + - dataVolume: + name: '${NAME}' + name: rootdisk + - cloudInitNoCloud: + userData: | + #cloud-config + user: cloud-user + password: redhat123 + name: cloudinitdisk +parameters: + - name: NAME + description: Name for the new VM + generate: expression + from: 'rhel10-[a-z0-9]{6}' + - name: CLOUD_USER_PASSWORD + description: Password for cloud-user + generate: expression + from: '[a-z0-9]{8}' diff --git a/isar-apps/ocp-v/templates/rhel9-broadwell.yaml b/isar-apps/ocp-v/templates/rhel9-broadwell.yaml new file mode 100644 index 0000000..c367dfb --- /dev/null +++ b/isar-apps/ocp-v/templates/rhel9-broadwell.yaml @@ -0,0 +1,180 @@ +kind: Template +apiVersion: template.openshift.io/v1 +metadata: + name: custom-rhel9-broadwell + namespace: openshift + labels: + app.kubernetes.io/part-of: hyperconverged-cluster + template.kubevirt.io/architecture: amd64 + template.kubevirt.io/version: v0.34.1 + app.kubernetes.io/version: 4.20.3 + template.kubevirt.io/type: vm + vm.kubevirt.io/template: custom-rhel9-broadwell + app.kubernetes.io/component: templating + app.kubernetes.io/managed-by: ssp-operator + flavor.template.kubevirt.io/medium: 'true' + os.template.kubevirt.io/rhel9.0: 'true' + os.template.kubevirt.io/rhel9.1: 'true' + app.kubernetes.io/name: custom-templates + os.template.kubevirt.io/rhel9.2: 'true' + os.template.kubevirt.io/rhel9.3: 'true' + os.template.kubevirt.io/rhel9.4: 'true' + vm.kubevirt.io/template.namespace: openshift + os.template.kubevirt.io/rhel9.5: 'true' + os.template.kubevirt.io/rhel9.6: 'true' + workload.template.kubevirt.io/server: 'true' + os.template.kubevirt.io/rhel9.7: 'true' + annotations: + template.kubevirt.io/provider: '' + template.kubevirt.io/provider-url: 'https://www.redhat.com' + template.kubevirt.io/containerdisks: | + registry.redhat.io/rhel9/rhel-guest-image + template.kubevirt.io/version: v1alpha1 + openshift.io/display-name: Red Hat Enterprise Linux 9 - Broadwell + openshift.io/documentation-url: 'https://github.com/kubevirt/common-templates' + template.kubevirt.io/images: | + https://access.redhat.com/downloads/content/479/ver=/rhel---9/9.0/x86_64/product-software + operator-sdk/primary-resource-type: SSP.ssp.kubevirt.io + defaults.template.kubevirt.io/disk: rootdisk + name.os.template.kubevirt.io/rhel9.0: Red Hat Enterprise Linux 9.0 or higher + name.os.template.kubevirt.io/rhel9.1: Red Hat Enterprise Linux 9.0 or higher + template.kubevirt.io/editable: | + /objects[0].spec.template.spec.domain.cpu.sockets + /objects[0].spec.template.spec.domain.cpu.cores + /objects[0].spec.template.spec.domain.cpu.threads + /objects[0].spec.template.spec.domain.memory.guest + /objects[0].spec.template.spec.domain.devices.disks + /objects[0].spec.template.spec.volumes + /objects[0].spec.template.spec.networks + name.os.template.kubevirt.io/rhel9.2: Red Hat Enterprise Linux 9.0 or higher + template.openshift.io/bindable: 'false' + openshift.kubevirt.io/pronounceable-suffix-for-name-expression: 'true' + operator-sdk/primary-resource: openshift-cnv/ssp-kubevirt-hyperconverged + name.os.template.kubevirt.io/rhel9.3: Red Hat Enterprise Linux 9.0 or higher + name.os.template.kubevirt.io/rhel9.4: Red Hat Enterprise Linux 9.0 or higher + tags: 'hidden,kubevirt,virtualmachine,linux,rhel' + name.os.template.kubevirt.io/rhel9.5: Red Hat Enterprise Linux 9.0 or higher + name.os.template.kubevirt.io/rhel9.6: Red Hat Enterprise Linux 9.0 or higher + template.kubevirt.io/provider-support-level: Full + name.os.template.kubevirt.io/rhel9.7: Red Hat Enterprise Linux 9.0 or higher + description: Template for Red Hat Enterprise Linux 9 VM or newer. A PVC with the RHEL disk image must be available. + openshift.io/support-url: 'https://github.com/kubevirt/common-templates/issues' + iconClass: icon-rhel + openshift.io/provider-display-name: '' +objects: + - apiVersion: kubevirt.io/v1 + kind: VirtualMachine + metadata: + annotations: + vm.kubevirt.io/validations: | + [ + { + "name": "minimal-required-memory", + "path": "jsonpath::.spec.domain.memory.guest", + "rule": "integer", + "message": "This VM requires more memory.", + "min": 1610612736 + } + ] + labels: + app: '${NAME}' + kubevirt.io/dynamic-credentials-support: 'true' + vm.kubevirt.io/template: custom-rhel9-broadwell + vm.kubevirt.io/template.revision: '1' + vm.kubevirt.io/template.namespace: openshift + name: '${NAME}' + spec: + dataVolumeTemplates: + - apiVersion: cdi.kubevirt.io/v1beta1 + kind: DataVolume + metadata: + name: '${NAME}' + spec: + sourceRef: + kind: DataSource + name: '${DATA_SOURCE_NAME}' + namespace: '${DATA_SOURCE_NAMESPACE}' + storage: + resources: + requests: + storage: 30Gi + runStrategy: Halted + template: + metadata: + annotations: + vm.kubevirt.io/flavor: medium + vm.kubevirt.io/os: rhel9 + vm.kubevirt.io/workload: server + labels: + kubevirt.io/domain: '${NAME}' + kubevirt.io/size: medium + spec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/hostname + operator: In + values: + - storm5 + - storm6 + matchFields: [] + architecture: amd64 + domain: + cpu: + cores: 1 + sockets: 1 + threads: 1 + model: Broadwell-v4 + devices: + disks: + - disk: + bus: virtio + name: rootdisk + - disk: + bus: virtio + name: cloudinitdisk + interfaces: + - masquerade: {} + model: virtio + name: default + rng: {} + features: + smm: + enabled: true + firmware: + bootloader: + efi: {} + memory: + guest: 4Gi + networks: + - name: default + pod: {} + terminationGracePeriodSeconds: 180 + volumes: + - dataVolume: + name: '${NAME}' + name: rootdisk + - cloudInitNoCloud: + userData: |- + #cloud-config + user: cloud-user + password: ${CLOUD_USER_PASSWORD} + chpasswd: { expire: False } + name: cloudinitdisk +parameters: + - name: NAME + description: VM name + generate: expression + from: 'rhel9-[a-z0-9]{16}' + - name: DATA_SOURCE_NAME + description: Name of the DataSource to clone + value: rhel9 + - name: DATA_SOURCE_NAMESPACE + description: Namespace of the DataSource + value: openshift-virtualization-os-images + - name: CLOUD_USER_PASSWORD + description: Randomized password for the cloud-init user cloud-user + generate: expression + from: '[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}' diff --git a/isar-apps/ocp-v/templates/rhel9-haswell.yaml b/isar-apps/ocp-v/templates/rhel9-haswell.yaml new file mode 100644 index 0000000..fe1733e --- /dev/null +++ b/isar-apps/ocp-v/templates/rhel9-haswell.yaml @@ -0,0 +1,188 @@ +kind: Template +apiVersion: template.openshift.io/v1 +metadata: + name: custom-rhel9-haswell + namespace: openshift + labels: + app.kubernetes.io/part-of: hyperconverged-cluster + template.kubevirt.io/architecture: amd64 + template.kubevirt.io/version: v0.34.1 + app.kubernetes.io/version: 4.20.3 + template.kubevirt.io/type: vm + vm.kubevirt.io/template: custom-rhel9-haswell + app.kubernetes.io/component: templating + app.kubernetes.io/managed-by: ssp-operator + flavor.template.kubevirt.io/medium: 'true' + os.template.kubevirt.io/rhel9.0: 'true' + os.template.kubevirt.io/rhel9.1: 'true' + template.kubevirt.io/default-os-variant: 'true' + app.kubernetes.io/name: custom-templates + os.template.kubevirt.io/rhel10.2: 'true' + os.template.kubevirt.io/rhel9.3: 'true' + os.template.kubevirt.io/rhel9.4: 'true' + vm.kubevirt.io/template.namespace: openshift + os.template.kubevirt.io/rhel9.5: 'true' + os.template.kubevirt.io/rhel9.6: 'true' + workload.template.kubevirt.io/server: 'true' + os.template.kubevirt.io/rhel9.7: 'true' + annotations: + template.kubevirt.io/provider: '' + template.kubevirt.io/provider-url: 'https://www.redhat.com' + template.kubevirt.io/containerdisks: | + registry.redhat.io/rhel9/rhel-guest-image + template.kubevirt.io/version: v1alpha1 + openshift.io/display-name: Red Hat Enterprise Linux 9 (Haswell-v4) + openshift.io/documentation-url: 'https://github.com/kubevirt/common-templates' + template.kubevirt.io/images: | + https://access.redhat.com/downloads/content/479/ver=/rhel---9/9.0/x86_64/product-software + operator-sdk/primary-resource-type: SSP.ssp.kubevirt.io + defaults.template.kubevirt.io/disk: rootdisk + name.os.template.kubevirt.io/rhel9.0: Red Hat Enterprise Linux 9.0 or higher + name.os.template.kubevirt.io/rhel9.1: Red Hat Enterprise Linux 9.0 or higher + template.kubevirt.io/editable: | + /objects[0].spec.template.spec.domain.cpu.sockets + /objects[0].spec.template.spec.domain.cpu.cores + /objects[0].spec.template.spec.domain.cpu.threads + /objects[0].spec.template.spec.domain.memory.guest + /objects[0].spec.template.spec.domain.devices.disks + /objects[0].spec.template.spec.volumes + /objects[0].spec.template.spec.networks + name.os.template.kubevirt.io/rhel9.2: Red Hat Enterprise Linux 9.0 or higher + template.openshift.io/bindable: 'false' + openshift.kubevirt.io/pronounceable-suffix-for-name-expression: 'true' + operator-sdk/primary-resource: openshift-cnv/ssp-kubevirt-hyperconverged + name.os.template.kubevirt.io/rhel9.3: Red Hat Enterprise Linux 9.0 or higher + name.os.template.kubevirt.io/rhel9.4: Red Hat Enterprise Linux 9.0 or higher + tags: 'hidden,kubevirt,virtualmachine,linux,rhel' + name.os.template.kubevirt.io/rhel9.5: Red Hat Enterprise Linux 9.0 or higher + name.os.template.kubevirt.io/rhel9.6: Red Hat Enterprise Linux 9.0 or higher + template.kubevirt.io/provider-support-level: Full + name.os.template.kubevirt.io/rhel9.7: Red Hat Enterprise Linux 9.0 or higher + description: Template for Red Hat Enterprise Linux 9 VM or newer. A PVC with the RHEL disk image must be available. + openshift.io/support-url: 'https://github.com/kubevirt/common-templates/issues' + iconClass: icon-rhel + openshift.io/provider-display-name: '' +objects: + - apiVersion: kubevirt.io/v1 + kind: VirtualMachine + metadata: + annotations: + vm.kubevirt.io/validations: | + [ + { + "name": "minimal-required-memory", + "path": "jsonpath::.spec.domain.memory.guest", + "rule": "integer", + "message": "This VM requires more memory.", + "min": 1610612736 + } + ] + labels: + app: '${NAME}' + kubevirt.io/dynamic-credentials-support: 'true' + vm.kubevirt.io/template: custom-rhel9-haswell + vm.kubevirt.io/template.revision: '1' + vm.kubevirt.io/template.namespace: openshift + template.kubevirt.io/default-os-variant: 'true' + name: '${NAME}' + spec: + dataVolumeTemplates: + - apiVersion: cdi.kubevirt.io/v1beta1 + kind: DataVolume + metadata: + name: '${NAME}' + spec: + sourceRef: + kind: DataSource + name: '${DATA_SOURCE_NAME}' + namespace: '${DATA_SOURCE_NAMESPACE}' + storage: + resources: + requests: + storage: 30Gi + runStrategy: Halted + template: + metadata: + annotations: + vm.kubevirt.io/flavor: medium + vm.kubevirt.io/os: rhel9 + vm.kubevirt.io/workload: server + labels: + kubevirt.io/domain: '${NAME}' + kubevirt.io/size: medium + spec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/hostname + operator: In + values: + - storm5 + - storm6 + - storm2 + - storm3 + matchFields: [] + architecture: amd64 + domain: + cpu: + cores: 1 + sockets: 1 + threads: 1 + features: + - name: vmx-rdseed-exit + policy: disable + model: Haswell-v4 + devices: + disks: + - disk: + bus: virtio + name: rootdisk + - disk: + bus: virtio + name: cloudinitdisk + interfaces: + - masquerade: {} + model: virtio + name: default + rng: {} + features: + smm: + enabled: true + firmware: + bootloader: + efi: {} + memory: + guest: 4Gi + networks: + - name: default + pod: {} + terminationGracePeriodSeconds: 180 + volumes: + - dataVolume: + name: '${NAME}' + name: rootdisk + - cloudInitNoCloud: + userData: | + #cloud-config + user: cloud-user + password: redhat123 + chpasswd: + expire: false + name: cloudinitdisk +parameters: + - name: NAME + description: VM name + generate: expression + from: 'rhel9-[a-z0-9]{16}' + - name: DATA_SOURCE_NAME + description: Name of the DataSource to clone + value: rhel9 + - name: DATA_SOURCE_NAMESPACE + description: Namespace of the DataSource + value: openshift-virtualization-os-images + - name: CLOUD_USER_PASSWORD + description: Randomized password for the cloud-init user cloud-user + generate: expression + from: '[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}'