Bug 1623379

Summary: 'Clone' VM from snapshot via the UI is broken
Product: [oVirt] ovirt-engine Reporter: Eyal Shenitzky <eshenitz>
Component: BLL.VirtAssignee: Sharon Gratch <sgratch>
Status: CLOSED CURRENTRELEASE QA Contact: Polina <pagranat>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.2.6.2CC: bugs, eshenitz, frolland, lveyde, pagranat, sgratch, sleviim, tnisan
Target Milestone: ovirt-4.2.7Keywords: Regression
Target Release: ---Flags: rule-engine: ovirt-4.2+
rule-engine: blocker+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: verified_upstream
Fixed In Version: ovirt-engine-4.2.7.3 Doc Type: Bug Fix
Doc Text:
Cause: Cloning a vm from snapshot of a High Performance or Desktop vm types caused a NPE in ui. In addition, when trying to clone from snapshot a headless VM, it was failed in validation and a pop-up message appeared although it is a valid operation. Consequence: Cloning avm from snapshot failed for those cases. Result: Now both mentioned scenarios work as expected.
Story Points: ---
Clone Of:
: 1635770 (view as bug list) Environment:
Last Closed: 2018-11-02 14:30:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1635770    
Attachments:
Description Flags
ui.log none

Description Eyal Shenitzky 2018-08-29 08:58:31 UTC
Description of problem:

When trying to clone a VM from a snapshot via the UI, an exception (UI) is thrown.

2018-08-29 11:44:38,786+03 ERROR [org.ovirt.engine.ui.frontend.server.gwt.OvirtRemoteLoggingService] (default task-61) [] Uncaught exception: com.google.gwt.event.shared.Um
brellaException: Exception caught: (TypeError) : Cannot read property 'K' of null
        at java.lang.Throwable.Throwable(Throwable.java:70) [rt.jar:1.8.0_172]
        at java.lang.RuntimeException.RuntimeException(RuntimeException.java:32) [rt.jar:1.8.0_172]
        at com.google.web.bindery.event.shared.UmbrellaException.UmbrellaException(UmbrellaException.java:64) [gwt-servlet.jar:]
        at Unknown.new G0(webadmin-0.js)
        at com.google.gwt.event.shared.HandlerManager.$fireEvent(HandlerManager.java:117) [gwt-servlet.jar:]
        at com.google.gwt.user.client.ui.Widget.$fireEvent(Widget.java:127) [gwt-servlet.jar:]
        at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:127) [gwt-servlet.jar:]
        at com.google.gwt.event.dom.client.DomEvent.fireNativeEvent(DomEvent.java:110) [gwt-servlet.jar:]
        at com.google.gwt.user.client.ui.Widget.$onBrowserEvent(Widget.java:163) [gwt-servlet.jar:]
        at com.google.gwt.user.client.ui.Widget.onBrowserEvent(Widget.java:163) [gwt-servlet.jar:]
        at com.google.gwt.user.client.DOM.dispatchEvent(DOM.java:1415) [gwt-servlet.jar:]
        at com.google.gwt.user.client.impl.DOMImplStandard.dispatchEvent(DOMImplStandard.java:312) [gwt-servlet.jar:]
        at com.google.gwt.core.client.impl.Impl.apply(Impl.java:236) [gwt-servlet.jar:]
        at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:275) [gwt-servlet.jar:]
        at Unknown.eval(webadmin-0.js)
Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError) : Cannot read property 'K' of null
        at org.ovirt.engine.ui.uicommonweb.models.vms.ExistingVmModelBehavior.updateHaAvailability(ExistingVmModelBehavior.java:481)
at org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.eventRaised(UnitVmModel.java:1949)
        at org.ovirt.engine.ui.uicompat.Event.$raise(Event.java:99)
        at org.ovirt.engine.ui.uicommonweb.models.ListModel.$setSelectedItem(ListModel.java:82)
        at org.ovirt.engine.ui.uicommonweb.models.ListModel.setSelectedItem(ListModel.java:78)
        at org.ovirt.engine.ui.common.editor.UiCommonEditorVisitor.$updateListEditor(UiCommonEditorVisitor.java:184)
        at org.ovirt.engine.ui.common.editor.UiCommonEditorVisitor.visit(UiCommonEditorVisitor.java:47)
        at com.google.gwt.editor.client.impl.AbstractEditorContext.$traverse(AbstractEditorContext.java:127) [gwt-servlet.jar:]
        at org.ovirt.engine.ui.common.widget.uicommon.popup.AbstractVmPopupWidget_UiCommonModelEditorDelegate.accept(AbstractVmPopupWidget_UiCommonModelEditorDelegate.java:507)
        at com.google.gwt.editor.client.impl.AbstractEditorContext.$traverse(AbstractEditorContext.java:127) [gwt-servlet.jar:]
        at org.ovirt.engine.ui.common.widget.uicommon.popup.AbstractVmPopupWidget_DriverImpl.accept(AbstractVmPopupWidget_DriverImpl.java:4)
        at org.ovirt.engine.ui.common.editor.AbstractUiCommonModelEditorDriver.$edit(AbstractUiCommonModelEditorDriver.java:33)
        at org.ovirt.engine.ui.common.widget.uicommon.popup.AbstractVmPopupWidget.$edit(AbstractVmPopupWidget.java:1530)
        at org.ovirt.engine.ui.common.widget.uicommon.popup.AbstractVmPopupWidget.edit(AbstractVmPopupWidget.java:1530)
        at org.ovirt.engine.ui.common.widget.uicommon.popup.AbstractVmPopupWidget.edit(AbstractVmPopupWidget.java:1530)
        at org.ovirt.engine.ui.common.widget.uicommon.popup.AbstractModeSwitchingPopupWidget.edit(AbstractModeSwitchingPopupWidget.java:80)
        at org.ovirt.engine.ui.common.view.popup.AbstractModelBoundWidgetPopupView.edit(AbstractModelBoundWidgetPopupView.java:37)
        at org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget.$init(AbstractModelBoundPopupPresenterWidget.java:105)
        at org.ovirt.engine.ui.common.widget.popup.AbstractVmBasedPopupPresenterWidget.$init(AbstractVmBasedPopupPresenterWidget.java:63)
        at org.ovirt.engine.ui.common.widget.popup.AbstractVmBasedPopupPresenterWidget.init(AbstractVmBasedPopupPresenterWidget.java:63)
        at org.ovirt.engine.ui.common.widget.popup.AbstractVmBasedPopupPresenterWidget.init(AbstractVmBasedPopupPresenterWidget.java:63)

Version-Release number of selected component (if applicable):
....

How reproducible:
100%

Steps to Reproduce:
1. Create a VM with disk
2. Create a snapshot to the VM
3. Try to clone VM from the created snapshot

Actual results:
UI exception is thrown when pressing 'clone' button

Expected results:
Clone VM should work and a new VM should be created

Additional info:

Comment 1 Eyal Shenitzky 2018-08-29 08:59:26 UTC
Version-Release number of selected component:
4.3.0 - master b081fb69031dad91a04fd258832be66126c27e0d

Comment 2 Red Hat Bugzilla Rules Engine 2018-09-16 06:55:52 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 3 Eyal Shenitzky 2018-09-16 08:13:17 UTC
This bug is already fixed by patch on master - 
https://gerrit.ovirt.org/#/c/94171/

Sharon, is this patch should be backported?

Comment 5 shani 2018-10-04 09:23:02 UTC
Sharon,
I think that some of the changes you add in patch [1] were later removed in patch [2].
Since patch [1] was backported and patch [2] weren't, I strongly believe that something there causes the bug on 4.2.
Can you please have a look?

[1] https://gerrit.ovirt.org/#/c/92788/ 
[2] https://gerrit.ovirt.org/#/c/94171/

Comment 6 Sharon Gratch 2018-10-07 14:00:13 UTC
Eyal / Shani,

1. Can you please attach the VM configuration for reproducing this bug? I tried to reproduce it on 4.2.7 and it didn't reproduced. Please attach the specific vm configuration and status of the VM that caused this failure. It seems that HA should be enabled for that VM but it didn't reproduced for me also with that.

2. Regarding patches [1], [2]:
patch [1] should been backported since it enables manual migration for high performance vms - which is supported only in 4.2.6.

patch [2] presents an automatic (and manual) migration support for high performance vms which should be supported only in 4.3 and therefore shouldn't be backported. It definitely overrides part of the code of [1] but both patches are aimed for different versions.


Let's understand how to reproduce and what is the bug and then merge a specific solution for 4.2 if required.


[1] https://gerrit.ovirt.org/#/c/92788/ 
[2] https://gerrit.ovirt.org/#/c/94171/

Comment 7 Sharon Gratch 2018-10-08 10:48:02 UTC
(In reply to Sharon Gratch from comment #6)
The issue is reproduced on a Desktop VM type only.

Comment 8 Polina 2018-10-14 15:01:01 UTC
Created attachment 1493730 [details]
ui.log

Bug still happens on ovirt-release42-snapshot-4.2.7-0.2.rc2.20181013014954.gitfb30674.el7.noarch

Steps for verification - 
1. Create Desktop VM with disk
2. Create snapshot from the VM
3. click VM/Snapshots. Choose the snapshot and try to clone the VM from the snapshot
Exception is brought .
ui log attached.

Caused by: com.google.gwt.core.client.JavaScriptException: (TypeError) : Cannot read property 'K' of null
        at org.ovirt.engine.ui.uicommonweb.models.vms.ExistingVmModelBehavior.updateHaAvailability(ExistingVmModelBehavior.java:481)

Comment 9 Sharon Gratch 2018-10-15 07:43:04 UTC
(In reply to Polina from comment #8)
> Created attachment 1493730 [details]
> ui.log
> 
> Bug still happens on
> ovirt-release42-snapshot-4.2.7-0.2.rc2.20181013014954.gitfb30674.el7.noarch

Hi Polina,

I re-verified this on 4.2.7.3_master and issue is not reproduced for me.
Are you sure that you verified it on a build that contains this fix?

Comment 10 Sharon Gratch 2018-10-15 09:06:22 UTC
It seems that QE needs to wait for tommorow's build for verifying this bug.

Comment 11 Polina 2018-10-15 11:47:07 UTC
Hi Sharon,

it was tested on ovirt-engine-4.2.7.3-0.0.master.20181008113103.git4718e0f.el7.noarch

I'll re-test it in tomorrow build

Comment 12 Polina 2018-10-16 08:07:58 UTC
The verification on ovirt-engine-4.2.7.3-0.0.master.20181015151121.gitd6e9af9.el7.noarch has succeeded.

The VMs are cloned from snapshots successfully with no exception.

Comment 13 Polina 2018-10-21 07:13:42 UTC
re-tested on rhv-release-4.2.7-5-001.noarch successfully

Comment 14 Sandro Bonazzola 2018-11-02 14:30:56 UTC
This bugzilla is included in oVirt 4.2.7 release, published on November 2nd 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.7 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.