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

Bug 1352422

Summary: Import a VM created on a storage pool that doesn't exist in the current deployment fails with NullPointerException
Product: [oVirt] ovirt-engine Reporter: Nisim Simsolo <nsimsolo>
Component: BLL.StorageAssignee: Tal Nisan <tnisan>
Status: CLOSED CURRENTRELEASE QA Contact: Kevin Alon Goldblatt <kgoldbla>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 4.0.1CC: acanan, amureini, bugs, gklein, mavital, nsimsolo, sbonazzo, ylavi
Target Milestone: ovirt-4.0.1Keywords: Regression, ZStream
Target Release: 4.0.1.1Flags: rule-engine: ovirt-4.0.z+
rule-engine: blocker+
rule-engine: planning_ack+
tnisan: devel_ack+
mavital: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-22 12:29:14 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
engine log none

Description Nisim Simsolo 2016-07-04 06:54:25 UTC
Description of problem:
Trying to import VM from export domain failed with the next engine.log error: 
2016-07-04 09:46:38,839 ERROR [org.ovirt.engine.core.bll.exportimport.ImportVmCommand] (default task-11) [64bb86aa] Error during ValidateFailure.: org.ovirt.engine.core.common.errors.Eng
ineException: EngineException: java.lang.NullPointerException (Failed with error ENGINE and code 5001)

Version-Release number of selected component (if applicable):
rhevm-4.0.2-0.2.rc1.el7ev
vdsm-4.18.999-170.git0a993e4.el7.centos.x86_64
libvirt-client-1.2.17-13.el7_2.5.x86_64
qemu-kvm-rhev-2.3.0-31.el7_2.17.x86_64
sanlock-3.2.4-2.el7_2.x86_64

How reproducible:
100%

Steps to Reproduce:
1. import VM from export domain
2.
3.

Actual results:
The next "operation canceled" message poped up in webadmin: 
    Error while executing action: 
    VM:
    General command validation failure.

in engine.log the next ERROR is listed: NullPointerException (Failed with error ENGINE and code 5001)

Expected results:
Import VM should succeed without errors.

Additional info:
engine.log attached. 
issue occured at 2016-07-04 09:46:38,803

Comment 1 Allon Mureinik 2016-07-04 08:15:16 UTC
Logs?

Comment 2 Nisim Simsolo 2016-07-04 08:33:41 UTC
Created attachment 1175858 [details]
engine log

Comment 3 Tal Nisan 2016-07-04 12:10:38 UTC
Some clarification on the exact steps to reproduce as this bug will not be reproduced otherwise:

- Create an export domain on a specific storage pool and export a VM with disks to it
- Detach the export domain from the storage pool and attach it to another storage pool
- Remove the original storage pool from the system
- Try to import the VM in the new storage pool


This is caused since the storage pool ID is taken from the images themselves in the export domain, since the storage pool does not exist the operation fails, if we'd try to import the images in the original storage pool they were exported from it will work correctly.

Comment 4 Kevin Alon Goldblatt 2016-08-17 20:27:33 UTC
Tested with the following code:
----------------------------------------
rhevm-4.0.2.4-0.1.el7ev.noarch
vdsm-4.18.10-1.el7ev.x86_64

Tested with the following scenario:


Steps to Reproduce:
- Create an export domain on a specific storage pool and export a VM with disks to it
- Detach the export domain from the storage pool and attach it to another storage pool
- Remove the original storage pool from the system
- Try to import the VM in the new storage pool - Select the Domain  - Import VMs - Select the VM and import it successfully


Actual results:
The vm is successfully imported


Moving to VERIFIED!