-
Bug
-
Resolution: Done-Errata
-
None
-
False
-
-
False
-
CLOSED
-
---
-
---
-
-
-
High
-
None
Description of problem:
If the spec/template/metadata/label is not defined in a VM definition and if we try to clone this virtual machine, the console goes blank white with the below error in the browser console:
~~~
vendors~main-chunk-c0c15fae48996264a3e4.min.js:172232 TypeError: Cannot set properties of undefined (setting 'vm.kubevirt.io/name')
at CloneVMModal.tsx:76:68
at helpers.tsx:77:5
at produce (immer.esm.mjs:1:16170)
at produceCleanClonedVM (helpers.tsx:55:17)
at CloneVMModal.tsx:63:42
at Object.useMemo (vendors~main-chunk-c0c15fae48996264a3e4.min.js:172232:1)
at t.useMemo (vendors~main-chunk-c0c15fae48996264a3e4.min.js:172199:1)
at CloneVMModal (CloneVMModal.tsx:62:32)
at na (vendors~main-chunk-c0c15fae48996264a3e4.min.js:172232:1)
at Hs (vendors~main-chunk-c0c15fae48996264a3e4.min.js:172232:1)
~~~
The issue is VM definition doesn't have the field spec.template.metadata.labels.
~~~
oc get vm formtv -o yaml|yq '.spec.template.metadata'
{
"creationTimestamp": null
}
~~~
The workaround is to add the label:
~~~
- oc patch vm formtv --type=merge -p '{"spec":{"template":{"metadata":{"labels":
{"kubevirt.io/domains":"formtv"}
}}}}'
~~~
Note that the issue is affecting all the VMs migrated from MTV using both RHV and VMware provider since it creates VMs without labels. So the workaround may not be feasible for all customers.
Version-Release number of selected component (if applicable):
OpenShift Virtualization 4.12.0
How reproducible:
100%
Steps to Reproduce:
1. Migrate a VM using MTV from RHV/VMware to OpenShift Virtualization (or just create a VM without spec.template.metadata.labels).
2. Try cloning this VM from UI:
Virtual machines => Actions => Clone
3. The UI goes blank white screen.
Actual results:
The console goes blank after trying to clone a virtual machine
Expected results:
Cloning should work.
Additional info: