Description of problem: When creating a VM using the wizard and selecting "URL" as boot source, VM creation fails on: "spec.dataVolumeTemplates.apiVersion in body is a forbidden property" for field "undefined". Version-Release number of selected component (if applicable): OCP 4.6.0-fc.9, CNV 2.5.0 How reproducible: 100% Steps to Reproduce: 1. From the UI, select to create a VM from Wizard 2. Select "URL (adds disk) from "Boot Source" dropdown menu 3. Create the VM Actual results: VM creation fails on Error "spec.dataVolumeTemplates.apiVersion in body is a forbidden property" for field "undefined". Expected results: VM creation should succeed Additional info: VM yaml generated by the UI: apiVersion: kubevirt.io/v1alpha3 kind: VirtualMachine metadata: labels: app: rhel vm.kubevirt.io/template: rhel8-desktop-small-v0.11.3 vm.kubevirt.io/template.revision: '1' vm.kubevirt.io/template.version: v0.12.2 os.template.kubevirt.io/rhel8.3: 'true' flavor.template.kubevirt.io/small: 'true' workload.template.kubevirt.io/desktop: 'true' vm.kubevirt.io/template.namespace: openshift name: rhel namespace: default annotations: name.os.template.kubevirt.io/rhel8.3: Red Hat Enterprise Linux 8.0 or higher spec: dataVolumeTemplates: - apiVersion: cdi.kubevirt.io/v1alpha1 kind: DataVolume metadata: name: rhel-rootdisk-3g30k spec: pvc: accessModes: - ReadWriteOnce resources: requests: storage: 15Gi volumeMode: Filesystem source: http: url: >- http://x.x.x.x/files/cnv-tests/rhel-images/rhel-82.qcow2 running: false template: metadata: labels: kubevirt.io/domain: rhel kubevirt.io/size: small vm.kubevirt.io/name: rhel os.template.kubevirt.io/rhel8.3: 'true' flavor.template.kubevirt.io/small: 'true' workload.template.kubevirt.io/desktop: 'true' spec: domain: cpu: cores: 1 sockets: 1 threads: 1 devices: disks: - disk: bus: virtio name: cloudinitdisk - bootOrder: 1 disk: bus: virtio name: rootdisk inputs: - bus: virtio name: tablet type: tablet interfaces: - masquerade: {} model: virtio name: nic-0 networkInterfaceMultiqueue: true rng: {} machine: type: pc-q35-rhel8.2.0 resources: requests: memory: 2Gi evictionStrategy: LiveMigrate hostname: rhel networks: - name: nic-0 pod: {} terminationGracePeriodSeconds: 180 volumes: - cloudInitNoCloud: userData: | #cloud-config user: cloud-user password: i01v-t3si-rox9 chpasswd: expire: false name: cloudinitdisk - dataVolume: name: rhel-rootdisk-3g30k name: rootdisk
VMs, cloned from golden images (which also use dataVolumeTemplates) also fail creation.
VM from golden images: apiVersion: kubevirt.io/v1alpha3 kind: VirtualMachine metadata: labels: app: eeeee vm.kubevirt.io/template: rhel8-desktop-tiny-v0.11.3 vm.kubevirt.io/template.revision: '1' vm.kubevirt.io/template.version: v0.12.2 os.template.kubevirt.io/rhel8.3: 'true' flavor.template.kubevirt.io/tiny: 'true' workload.template.kubevirt.io/desktop: 'true' vm.kubevirt.io/template.namespace: openshift name: eeeee namespace: openshift-virtualization-os-images annotations: name.os.template.kubevirt.io/rhel8.3: Red Hat Enterprise Linux 8.0 or higher spec: dataVolumeTemplates: - apiVersion: cdi.kubevirt.io/v1alpha1 kind: DataVolume metadata: name: eeeee-rootdisk-cj2nh spec: pvc: accessModes: - ReadWriteOnce resources: requests: storage: 20Gi volumeMode: Filesystem source: pvc: name: rhel8 namespace: openshift-virtualization-os-images running: false template: metadata: labels: kubevirt.io/domain: eeeee kubevirt.io/size: tiny vm.kubevirt.io/name: eeeee os.template.kubevirt.io/rhel8.3: 'true' flavor.template.kubevirt.io/tiny: 'true' workload.template.kubevirt.io/desktop: 'true' spec: domain: cpu: cores: 1 sockets: 1 threads: 1 devices: disks: - disk: bus: virtio name: cloudinitdisk - bootOrder: 1 disk: bus: virtio name: rootdisk inputs: - bus: virtio name: tablet type: tablet interfaces: - masquerade: {} model: virtio name: nic-0 networkInterfaceMultiqueue: true rng: {} machine: type: pc-q35-rhel8.2.0 resources: requests: memory: 1.5Gi evictionStrategy: LiveMigrate hostname: eeeee networks: - name: nic-0 pod: {} terminationGracePeriodSeconds: 180 volumes: - cloudInitNoCloud: userData: | #cloud-config user: cloud-user password: gbjz-9420-yqkb chpasswd: expire: false name: cloudinitdisk - dataVolume: name: eeeee-rootdisk-cj2nh name: rootdisk
This regression has been caused by https://github.com/kubevirt/kubevirt/pull/4261 I understand it was an API clean-up and we were not supposed to be using it, it was part of the api nonetheless and we were using it. Now we have passed code freeze and we can not do this cleanup on the UI side easily (maybe we could get an exception but I would love to avoid risking regressions by doing this type of changes now). I would say the https://github.com/kubevirt/kubevirt/pull/4261 should be reverted and re-introduced for 2.6 so we can properly adapt in 4.7.
> I understand it was an API clean-up and we were not supposed to be using it, it was part of the api nonetheless and we were using it. Now we have passed code freeze and we can not do this cleanup on the UI side easily (maybe we could get an exception but I would love to avoid risking regressions by doing this type of changes now). I would say the https://github.com/kubevirt/kubevirt/pull/4261 should be reverted and re-introduced for 2.6 so we can properly adapt in 4.7. here's the background. The DataVolumeTemplates section exposed two structs that should never have been captured by our api to begin with, the api group/version and status structs. If a user attempts to set either of these structs, they do nothing. They are essentially no-ops, which means we're exposing parts of our API that we don't actually support. That's what PR 4261 addressed by removing the unused fields. That PR obvious causes issues, beyond the one that's captured in this BZ even. We already had to re-introduce a dummy status struct to maintain compatibility. We can do the same with the api group/version. We'll just need to clearly state that the DataVolumeTemplate group/version fields are no-ops that exist to maintain compatibility. So I wouldn't revert pr4261, instead i'd add the group/version field back. There are still changes with pr 4261 around how dataVolume status is documented/supported that we'd like to keep.
https://github.com/kubevirt/kubevirt/pull/4319
(In reply to David Vossel from comment #7) > https://github.com/kubevirt/kubevirt/pull/4319 Thank you! I have opened a followup (https://bugzilla.redhat.com/show_bug.cgi?id=1885319) to remove the use of it from the ui code.
*** Bug 1886927 has been marked as a duplicate of this bug. ***
Created attachment 1721038 [details] review_and_confirm_details
Created attachment 1721039 [details] successfully created virtual machine
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 (OpenShift Virtualization 2.5.0 Images), 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/RHEA-2020:5127