Description of problem: Windows templates have windows-cd-bus validation, however cdrom elemnt was not added to the template. Windows VM creation from template fail on: "reason":"FieldValueInvalid","message":"cd bus has to be sata: not in [sata]","field":".spec.domain.devices.disks[*].cdrom.bus"}]} (Creation from UI succeeds as by default cdrom is added to the VM; if reoved, creation would fail there as well.) Version-Release number of selected component (if applicable): CNV 2.4, operatorVersion: v0.29.2 OCP 4.5 How reproducible: 100% Steps to Reproduce: 1. Create a VM using Windows templates Actual results: VM creation fails. Expected results: Template validations should be met in the templates themselves. Additional info: HTTP response body: b'{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"admission webhook \\"virt-template-admission.kubevirt.io\\" denied the request: virto disk bus type has better performance, install virtio drivers in VM and change bus type: sata not in [virtio], cd bus has to be sata: not in [sata]","reason":"Invalid","details":{"causes":[{"reason":"FieldValueInvalid","message":"virto disk bus type has better performance, install virtio drivers in VM and change bus type: sata not in [virtio]","field":".spec.domain.devices.disks[*].disk.bus"},{"reason":"FieldValueInvalid","message":"cd bus has to be sata: not in [sata]","field":".spec.domain.devices.disks[*].cdrom.bus"}]},"code":422}\n'
Hey Ruth I just tried running the following command and it succeeded oc process -f common-templates/dist/templates/windows10-desktop-large.yaml \ -p NAME=test-win-vm \ -p PVCNAME=mynewclaim \ | oc create -f - Can you share what command failed for you? thanks.
Template validator will not be used in CLI because template namespace is missing inside the template (bug 1753554). You need to add "vm.kubevirt.io/template-namespace: openshift" to the template annotations.
Just tackled this again: Steps to reproduce: 1) oc process -n openshift windows-server-medium-v0.7.0 -p NAME="win16" -p PVCNAME="win-16-2" -oyaml > win16_vm.yaml 2) edit the yaml: add "vm.kubevirt.io/template-namespace: openshift" under metadata->labels 3) oc create -f win16_vm.yaml Actual results: VM creation fails. Output: The request is invalid: * .spec.domain.devices.disks[*].disk.bus: virto disk bus type has better performance, install virtio drivers in VM and change bus type: sata not in [virtio] * .spec.domain.devices.disks[*].cdrom.bus: cd bus has to be sata: not in [sata] Expected results: Template validations should be met in the templates themselves. Additional info: Template output: http://pastebin.test.redhat.com/876516 SSP operator version - v2.4.0-50 Log from template-validator: {"component":"kubevirt-template-validator","level":"warning","msg":"VM windows-jpj6cl has old-style template namespace labels 'vm.kubevirt.io/template-namespace', should be updated to 'vm.kubevirt.io/template.namespace'","pos":"uplink.go:50","timestamp":"2020-06-18T11:06:21.077564Z"} {"component":"kubevirt-template-validator","level":"warning","msg":"virto disk bus type has better performance, install virtio drivers in VM and change bus type: rule is not satisfied","pos":"eval.go:68","timestamp":"2020-06-18T11:06:21.079999Z"} {"component":"kubevirt-template-validator","level":"info","msg":"evalution summary for windows-jpj6cl:\nminimal-required-memory applied: OK, 4294967296 in [536870912, N/A]\nwindows-virtio-bus applied: FAIL, sata not in [virtio]\nwindows-disk-bus applied: OK, sata in [virtio, sata]\nwindows-cd-bus applied: FAIL, not in [sata]\n\nsucceeded=false","pos":"admission.go:42","timestamp":"2020-06-18T11:06:21.080566Z"}
Verified on CNV-2.4.0, OCP: 4.5.0-rc.2, SSP build 58: 1. Create Windows VM without cd-rom - PASSED (VM is created) 2. Create Windows VM with sata cd-rom - PASSED (VM is created) 3. Create Widnows VMw with virtio cd-rom - PASSED (VM creation fails on cd-rom validation) From the UI - create a VM with cd-rom - verify that the only option is "sata"
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2020:3194