Created attachment 1518158 [details] Web UI Error Description of problem: When I try to create a new VM with blank disk this error comes up: From WebUI: ``` Error "spec.dataVolumeTemplates.spec.source.blank in body is a forbidden property" for field "undefined". ``` From Kubelet log: ``` E0103 14:07:30.791377 1 watcher.go:208] watch chan error: etcdserver: mvcc: required revision has been compacted W0103 14:07:30.792253 1 reflector.go:272] github.com/openshift/client-go/user/informers/externalversions/factory.go:101: watch of *v1.Group ended with: The resourceVersion for the provided watch is too old. E0103 14:07:35.265820 1 memcache.go:147] couldn't get resource list for subresources.kubevirt.io/v1alpha2: <nil> E0103 14:07:39.753128 1 watcher.go:208] watch chan error: etcdserver: mvcc: required revision has been compacted I0103 14:07:40.166575 1 controller.go:105] OpenAPI AggregationController: Processing item v1alpha2.subresources.kubevirt.io W0103 14:07:43.754608 1 dispatcher.go:76] rejected by webhook "virtualmachine-validator.kubevirt.io": &errors.StatusError{ErrStatus:v1.Status{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ListMeta:v1.ListMeta{SelfLink:"", ResourceVersion:"", Continue:""}, Status:"", Message:"admission webhook \"virtualmachine-validator.kubevirt.io\" denied the request: spec.dataVolumeTemplates.spec.source.blank in body is a forbidden property, spec.dataVolumeTemplates.status in body is required", Reason:"Invalid", Details:(*v1.StatusDetails)(0xc43b98e600), Code:422}} E0103 14:07:43.808756 1 watcher.go:208] watch chan error: etcdserver: mvcc: required revision has been compacted E0103 14:07:45.623955 1 controller.go:111] loading OpenAPI spec for "v1alpha2.subresources.kubevirt.io" failed with: OpenAPI spec does not exists I0103 14:07:45.624152 1 controller.go:119] OpenAPI AggregationController: action for item v1alpha2.subresources.kubevirt.io: Rate Limited Requeue. E0103 14:07:45.653850 1 memcache.go:147] couldn't get resource list for subresources.kubevirt.io/v1alpha2: <nil> I0103 14:07:46.604620 1 controller.go:105] OpenAPI AggregationController: Processing item v1alpha1.upload.cdi.kubevirt.io ``` Version-Release number of selected component (if applicable): - CNV kubevirt-manifests-0.12.0-alpha.2.2.gee3e763.cd09f01.noarch kubevirt-virtctl-0.12.0-alpha.2.2.gee3e763.cd09f01.x86_64 kubevirt-cdi-manifests-1.4.0-1.211c0a0.noarch ovs-cni-manifests-0.2.0-10.noarch - OCP atomic-openshift-node-3.11.65-1.git.0.9936f78.el7.x86_64 atomic-openshift-3.11.65-1.git.0.9936f78.el7.x86_64 cri-o-1.11.10-1.rhaos3.11.git42c86f0.el7.x86_64 runc-1.0.0-57.dev.git2abd837.el7.x86_64 How reproducible: Steps to Reproduce: 1. Try to create a VM from kubevirt WebUI 2. Add new blank disk 3. Create VM Actual results: Error "spec.dataVolumeTemplates.spec.source.blank in body is a forbidden property" for field "undefined". Expected results: VM Created with additional disk Additional info:
VM that is being created and fails looks like apiVersion: kubevirt.io/v1alpha2 kind: VirtualMachine metadata: name: myvm spec: dataVolumeTemplates: - metadata: name: emptydisk-myvm spec: pvc: accessModes: - ReadWriteOnce resources: requests: storage: 20Gi source: blank: {} running: false template: spec: domain: cpu: cores: 2 devices: disks: - bootOrder: 1 disk: bus: virtio name: rootdisk volumeName: rootdisk - disk: bus: virtio name: emptydisk volumeName: emptydisk interfaces: - bridge: {} name: eth0 rng: {} resources: requests: memory: 2G networks: - name: eth0 pod: {} terminationGracePeriodSeconds: 0 volumes: - containerDisk: image: kubevirt/fedora-cloud-container-disk-demo name: rootdisk - dataVolume: name: emptydisk-myvm name: emptydisk VM creation fails also for apiVersion: kubevirt.io/v1alpha2 kind: VirtualMachine metadata: labels: kubevirt.io/vm: vm-alpine-datavolume name: vm-alpine-datavolume spec: running: false template: metadata: labels: kubevirt.io/vm: vm-alpine-datavolume spec: domain: devices: disks: - disk: bus: virtio name: datavolumedisk1 volumeName: datavolumevolume1 resources: requests: memory: 64M volumes: - dataVolume: name: alpine-dv name: datavolumevolume1 dataVolumeTemplates: - metadata: name: alpine-dv spec: pvc: accessModes: - ReadWriteOnce resources: requests: storage: 2Gi source: http: url: http://cdi-http-import-server.kubevirt/images/alpine.iso with 'Error "spec.dataVolumeTemplates.status in body is required" for field "undefined".' note that the above VM definition is taken from kubevirt user-guide
*** Bug 1660850 has been marked as a duplicate of this bug. ***
This happens because kubevirt has vendored a version of CDI that does not yet have support for the 'blank' source type. It can be fixed by updating kubevirt to vendor in cdi-1.4.1 or newer.
Should be solved by this merged PR: https://github.com/kubevirt/kubevirt/pull/1819
Fixed in CDI but also need 1667438 to vendor this build into the kubevirt deployment.
Tested with openshift v3.11.59, CNV v1.4.0, CDI v1.4.0-6, The bug has been fixed. Move it to VERIFIED, thanks. Here are verification results. [root@cnv-executor-qwang-master1 ~]# oc get dv NAME AGE qwang-bug-blank-disk-qwang-bug-vm 1m rootdisk-qwang-bug-vm 1m [root@cnv-executor-qwang-master1 ~]# oc get pvc NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE qwang-bug-blank-disk-qwang-bug-vm Bound pvc-374e01af-2510-11e9-878f-fa163e29a0b5 1Gi RWO glusterfs-storage 1m rootdisk-qwang-bug-vm Bound pvc-374d66d1-2510-11e9-878f-fa163e29a0b5 10Gi RWO glusterfs-storage 1m [root@cnv-executor-qwang-master1 ~]# oc get all NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/glusterfs-dynamic-374d66d1-2510-11e9-878f-fa163e29a0b5 ClusterIP 172.30.122.195 <none> 1/TCP 1m service/glusterfs-dynamic-374e01af-2510-11e9-878f-fa163e29a0b5 ClusterIP 172.30.49.172 <none> 1/TCP 1m [root@cnv-executor-qwang-master1 ~]# oc get vm NAME AGE RUNNING VOLUME qwang-bug-vm 2m false
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/RHEA-2019:0417