Bug 2180853 - The console goes blank after trying to clone a virtual machine
Summary: The console goes blank after trying to clone a virtual machine
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: User Experience
Version: 4.12.0
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
: 4.13.0
Assignee: Matan Schatzman
QA Contact: Guohua Ouyang
URL:
Whiteboard:
: 2180683 (view as bug list)
Depends On:
Blocks: 2181042 2181992
TreeView+ depends on / blocked
 
Reported: 2023-03-22 12:20 UTC by nijin ashok
Modified: 2023-05-18 02:58 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2181042 2181992 (view as bug list)
Environment:
Last Closed: 2023-05-18 02:58:32 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker CNV-27207 0 None None None 2023-03-22 12:20:42 UTC
Red Hat Product Errata RHSA-2023:3205 0 None None None 2023-05-18 02:58:40 UTC

Description nijin ashok 2023-03-22 12:20:07 UTC
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:

Comment 1 Guohua Ouyang 2023-03-22 12:56:10 UTC
*** Bug 2180683 has been marked as a duplicate of this bug. ***

Comment 2 Guohua Ouyang 2023-03-23 00:28:53 UTC
Verified on v4.13.0-2248, clone a VM which has no kubevirt.io/domains in spec.template.metadata.labels is okay.

Comment 4 errata-xmlrpc 2023-05-18 02:58:32 UTC
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 (Moderate: OpenShift Virtualization 4.13.0 Images security, bug fix, and enhancement update), 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-2023:3205


Note You need to log in before you can comment on or make changes to this bug.