Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1371304

Summary: Uncaught exception occured when try to import Virtual Machine from Export domain
Product: [oVirt] ovirt-engine Reporter: saeedi <mohsen.saeedi>
Component: BLL.StorageAssignee: Idan Shaby <ishaby>
Status: CLOSED CURRENTRELEASE QA Contact: Kevin Alon Goldblatt <kgoldbla>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.0.3CC: amureini, bugs, ishaby, mohsen.saeedi, tnisan
Target Milestone: ovirt-4.0.4Flags: ykaul: ovirt-4.0.z+
ykaul: planning_ack+
amureini: devel_ack+
ykaul: testing_ack+
Target Release: 4.0.4.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Previously, when trying to import a vm that is based on a template from an export domain via the webadmin, if the template did not exist then a UI error was shown and the new popup window got stuck. Now the popup window is loaded and a red warning is shown - "Some imported VMs depend on one or more templates which are not available in the system. Therefore you must Import those VMs with 'collapse snapshots', another option is to Import missing templates first and then try import the VMs again". This is a UI issue, so it does not occur in REST API and SDKs.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-26 12:33:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Storage RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Screenshot
none
Ovirt ui log requested none

Description saeedi 2016-08-29 20:40:53 UTC
Created attachment 1195519 [details]
Screenshot

Description of problem:
I have two server that ovirt has been installed on both of them. First server has ovirt 3.5 and the second has ovirt 4.0.3 (The bug is exist on 4.0.2.x too. I updated it to 4.0.3 today but problem exist).
I export two machine from first server to Export domain (with NFS fs) and then detach Export domain from first server and Attach it to second server. I try to import one of them and import successfully without any error. 
Then try to import second virtual machine and proccess failed immediately after click on import button. I try it more and more after restart ovirt-engine and vdsmd services but with no success.

Difference between this two machines are  the following list:
1. second Virtual Machine created based on template (I know about that and i export template first and then export the Virtual Machine)
2. we assigned 2 disks to second virtual machine but first machine has one disk. 

Version-Release number of selected component (if applicable):
4.0.2.x and 4.0.3

How reproducible:


Steps to Reproduce:
1. I try to import VM again and error occurred like before.

Actual results:
Uncaught exception occured and nothing happens after that. 

Expected results:
I except that show the import window to do next steps

Additional info:
I check http

Comment 1 Tal Nisan 2016-08-30 07:48:49 UTC
Hi Saeedi, can you please attach the Engine logs?

Comment 2 saeedi 2016-08-30 08:11:41 UTC
Hi Nisan,

I checked engine log and not corresponded log appear on engine.log. Below log is for when i select Export domain till error occurred

2016-08-30 12:37:57,929 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.GetVmsInfoVDSCommand] (default task-67) [] START, GetVmsInfoVDSCommand( GetVmsInfoVDSCommandParameters:{runAsync='true', storagePoolId='00000001-0001-0001-0001-0000000000b8', ignoreFailoverLimit='false', storageDomainId='5aa9815c-dec9-4f03-a253-c8d86ccbeb73', vmIdList='null'}), log id: 4593d1f
2016-08-30 12:37:58,348 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.GetVmsInfoVDSCommand] (default task-67) [] FINISH, GetVmsInfoVDSCommand, log id: 4593d1f
2016-08-30 12:37:58,385 INFO  [org.ovirt.engine.core.vdsbroker.monitoring.VmsStatisticsFetcher] (DefaultQuartzScheduler1) [9fd9506] Fetched 5 VMs from VDS 'c0725b70-a093-4f05-8703-e0c6ba0bb47c'
2016-08-30 12:38:14,514 INFO  [org.ovirt.engine.core.vdsbroker.monitoring.VmsStatisticsFetcher] (DefaultQuartzScheduler9) [] Fetched 5 VMs from VDS 'c0725b70-a093-4f05-8703-e0c6ba0bb47c'

As you see no Error message reported.

Comment 3 saeedi 2016-08-30 08:29:20 UTC
Is there any solution to import the VM from ovirt-shell CLI? I wasn't able to find it on ovirt document. if you can send any recipe about it, i can test too.

Comment 4 Idan Shaby 2016-08-30 14:37:09 UTC
The engine's log doesn't tell us about the problem since it's a ui problem.
Can you please attach the ui log?

Comment 5 saeedi 2016-08-30 19:58:21 UTC
I do the operation for several times and nothing printed in /var/log/ovirt-engine/ui.log. 
I think we need to install debuginfo packge for ovirt webadmin portal.My point is correct?

I'm going to install it before your answer.

Comment 6 saeedi 2016-08-30 20:36:46 UTC
Created attachment 1196076 [details]
Ovirt ui log requested

I installed ovirt-engine-webadmin-portal-debuginfo with yum. After that restart ovirt-engine and then navigate to ui.log and see ui Error message and attached it with ovirt-ui.log name.

Comment 7 saeedi 2016-08-31 18:50:55 UTC
How can i import the VM befor bug fixing? I want to know if it is possible to import VM with ovirt-shell. I can't wait for ovirt next release to do that.

Comment 8 Idan Shaby 2016-09-01 05:46:50 UTC
Try to import the template from the export domain before you import the vm that relies on the template. That should workaround the problem in the meanwhile.

Comment 10 Tal Nisan 2016-09-04 11:14:51 UTC
Idan, please provide clear steps to reproduce to  ease up QE's work

Comment 11 Idan Shaby 2016-09-04 11:28:23 UTC
Sure:

1. Create a vm (let's call it "vm1").
2. Create a template from "vm1" (let's call it "vm1_template").
3. Create a vm from "vm1_template" (let's call it "vm1_from_template").
4. Export "vm1_from_template" to the export domain.
5. Try to import "vm1_from_template" (before the fix a UI error was shown).
6. Check that there's no UI error.

Comment 12 Allon Mureinik 2016-09-05 10:44:32 UTC
This seems to have been broken for quite a while, so let's document what was fixed here. Idan?

Comment 13 Idan Shaby 2016-09-06 06:18:15 UTC
First, I want to add a few things that I forgot to mention in comment 11:
1. Between stages 1 and 2, you need to create a disk for vm1 (pretty obvious, but should be written).
2. In stage 4, "vm1_template" should also be exported.
3. Between stages 4 and 5, "vm1_from_template" and "vm1_template" should be removed, or else the bug won't be reproduced.

Also, added a doc text.

Comment 14 Kevin Alon Goldblatt 2016-09-13 13:53:21 UTC
Tested with the following code:
----------------------------------------
rhevm-4.0.4.2-0.1.el7ev.noarch
vdsm-4.18.13-1.el7ev.x86_64

Tested with the following scenario:

Steps to Reproduce:
1. Create a vm (let's call it "vm1") with a disk.
2. Create a template from "vm1" (let's call it "vm1_template").
3. Create a vm from "vm1_template" (let's call it "vm1_from_template").
4. Export "vm1_from_template" and "vm1_template" to the export domain.
5. Remove both "vm1_from_template" and "vm1_template
5. Try to import "vm1_from_template" >>>>> Works fine and there's NO UI error.




Actual results:
The Import VM from export domain based on a template from an export domain via the webadmin works fine

Expected results:



Moving to VERIFIED!