forked from kubevirt/common-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
win2k12r2.tpl.yaml
140 lines (134 loc) · 4.66 KB
/
win2k12r2.tpl.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: win2k12r2-{{ item.workload }}-{{ item.flavor }}-{{ lookup('env', 'VERSION') | default('devel', true) }}
annotations:
openshift.io/display-name: "Microsoft Windows Server 2012 R2 VM"
description: >-
This template can be used to create a VM suitable for
Microsoft Windows Server 2012 R2.
The template assumes that a PVC is available which is providing the
necessary Windows disk image.
tags: "kubevirt,virtualmachine,windows"
iconClass: "icon-windows"
openshift.io/provider-display-name: "KubeVirt"
openshift.io/documentation-url: "https://github.com/kubevirt/common-templates"
openshift.io/support-url: "https://github.com/kubevirt/common-templates/issues"
template.openshift.io/bindable: "false"
template.kubevirt.io/version: v1alpha1
defaults.template.kubevirt.io/disk: rootdisk
defaults.template.kubevirt.io/network: default
template.kubevirt.io/editable: |
/objects[0].spec.template.spec.domain.cpu.cores
/objects[0].spec.template.spec.domain.resources.requests.memory
/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/win2k12r2: {{ lookup('osinfo', 'win2k12r2').name }}
name.os.template.kubevirt.io/win2k8r2: {{ lookup('osinfo', 'win2k8r2').name }}
name.os.template.kubevirt.io/win2k8: {{ lookup('osinfo', 'win2k8').name }}
name.os.template.kubevirt.io/win10: {{ lookup('osinfo', 'win10').name }}
validations: |
[
{
"name": "minimal-required-memory",
"path": "jsonpath::.spec.domain.resources.requests.memory",
"rule": "integer",
"message": "This VM requires more memory.",
"min": {{ lookup('osinfo', osinfoname)["minimum_resources.0.ram"] }}
}, {
"name": "windows-virtio-bus",
"path": "jsonpath::.spec.domain.devices.disks[*].disk.bus",
"rule": "enum",
"message": "virto disk bus type has better performance, install virtio drivers in VM and change bus type",
"values": ["virtio"],
"justWarning": true
}, {
"name": "windows-disk-bus",
"path": "jsonpath::.spec.domain.devices.disks[*].disk.bus",
"rule": "enum",
"message": "disk bus has to be either virtio or sata",
"values": ["virtio", "sata"]
}
]
labels:
os.template.kubevirt.io/win2k19: "true"
os.template.kubevirt.io/win2k16: "true"
os.template.kubevirt.io/win2k12r2: "true"
os.template.kubevirt.io/win2k8r2: "true"
os.template.kubevirt.io/win2k8: "true"
os.template.kubevirt.io/win10: "true"
workload.template.kubevirt.io/{{ item.workload }}: "true"
flavor.template.kubevirt.io/{{ item.flavor }}: "true"
template.kubevirt.io/type: "base"
objects:
- apiVersion: kubevirt.io/v1alpha3
kind: VirtualMachine
metadata:
name: ${NAME}
labels:
vm.kubevirt.io/template: win2k12r2-{{ item.workload }}-{{ item.flavor }}
vm.kubevirt.io/template.version: "{{ lookup('env', 'VERSION') | default('devel', true) }}"
vm.kubevirt.io/template.revision: "{{ lookup('env', 'REVISION') | default(1, true) }}"
app: ${NAME}
spec:
running: false
template:
spec:
domain:
clock:
utc: {}
timer:
hpet:
present: false
pit:
tickPolicy: delay
rtc:
tickPolicy: catchup
hyperv: {}
cpu:
sockets: {{ item.cpus }}
cores: 1
threads: 1
resources:
requests:
memory: {{ item.memsize }}
features:
acpi: {}
apic: {}
hyperv:
relaxed: {}
vapic: {}
spinlocks:
spinlocks: 8191
devices:
disks:
- disk:
bus: sata
name: rootdisk
interfaces:
- bridge: {}
model: e1000e
name: default
{% if item.tablet %}
inputs:
- type: tablet
bus: usb
name: tablet
{% endif %}
terminationGracePeriodSeconds: 0
volumes:
- name: rootdisk
persistentVolumeClaim:
claimName: ${PVCNAME}
networks:
- name: default
pod: {}
parameters:
- name: NAME
description: VM name
generate: expression
from: "win2k12-[a-z0-9]{6}"
- name: PVCNAME
description: Name of the PVC with the disk image
required: true