Bug 1478283 - [JNPE] Cannot import VM from previously used SD / ImportVmFromConfigurationCommand' failed: null
Summary: [JNPE] Cannot import VM from previously used SD / ImportVmFromConfigurationCo...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Storage
Version: 4.1.4.2
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ovirt-4.1.6
: 4.1.6.2
Assignee: Maor
QA Contact: Kevin Alon Goldblatt
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-04 08:12 UTC by Jiri Belka
Modified: 2017-09-19 10:02 UTC (History)
5 users (show)

Fixed In Version: ovirt-engine-4.1.6.2
Doc Type: Bug Fix
Doc Text:
Cause: Try to import VM with memory disks which reside on storage domains which were not imported to the DC Consequence: The VM failed to be imported Fix: Add validation if all storage domains exists or not for memory disks. In case the storage domain does not exists the engine will fail the operation unless the flag of 'partial_import' will be true, in that case the VM will be imported without the memory disks on the missing storage domains. Result: Import VM failed with a proper message. Using 'partial_import' as true will make the operation succeed
Clone Of:
Environment:
Last Closed: 2017-09-19 10:02:09 UTC
oVirt Team: Storage
Embargoed:
rule-engine: ovirt-4.1+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 80828 0 master MERGED core: Add validation for memory volumes' storage domains. 2020-06-22 14:53:50 UTC
oVirt gerrit 80829 0 master MERGED core: Don't add memory disk if storage does not exist. 2020-06-22 14:53:50 UTC
oVirt gerrit 81377 0 ovirt-engine-4.1 MERGED core: Don't add memory disk if storage does not exist. 2020-06-22 14:53:51 UTC
oVirt gerrit 81378 0 ovirt-engine-4.1 MERGED core: Add validation for memory volumes' storage domains. 2020-06-22 14:53:50 UTC

Description Jiri Belka 2017-08-04 08:12:01 UTC
Description of problem:

When trying to import a VM from previously used SD in other engine (3.6), Import VM dialog closes but no action was occuring.

Observing log, there's JNPE with:

~~~
2017-08-04 10:01:11,730+02 INFO  [org.ovirt.engine.core.bll.exportimport.ImportVmFromConfigurationCommand] (org.ovirt.thread.pool-6-thread-38) [e77253c4-39cd-4669-9886-b7d451cb615b] Running command: ImportVmFromConfigurationCommand(Vm = VM [jbelka-vhost1], ClusterId = 4031fc6b-eafb-4b84-87d2-301d0ea1d085, StorageDomainId = 37869d55-f792-42e3-89f3-e0022c559eb9, StoragePoolId = 5183b13e-02e4-4659-88d2-fd0aee9433ea, SourceDomainId = 37869d55-f792-42e3-89f3-e0022c559eb9, DestDomainId = 37869d55-f792-42e3-89f3-e0022c559eb9, ImageToDestinationDomainMap = null, CopyCollapse = false, ForceOverride = false, AllowPartialImport = false, ExternalVnicProfileMappings = [], ReassignBadMacs = false, ImagesExistOnTargetStorageDomain = true, DiskMap = null, CpuProfileId = null, ContainerId = 8f8fc16a-23ee-4621-a971-fd4b5e5fe3bd, ImportAsNewEntity = false, VmId = 8f8fc16a-23ee-4621-a971-fd4b5e5fe3bd, QuotaId = null) internal: false. Entities affected :  ID: 37869d55-f792-42e3-89f3-e0022c559eb9 Type: StorageAction group IMPORT_EXPORT_VM with role type ADMIN,  ID: 37869d55-f792-42e3-89f3-e0022c559eb9 Type: StorageAction group IMPORT_EXPORT_VM with role type ADMIN
...
2017-08-04 10:01:11,913+02 ERROR [org.ovirt.engine.core.bll.exportimport.ImportVmFromConfigurationCommand] (org.ovirt.thread.pool-6-thread-38) [e77253c4-39cd-4669-9886-b7d451cb615b] Command '
org.ovirt.engine.core.bll.exportimport.ImportVmFromConfigurationCommand' failed: null
2017-08-04 10:01:11,913+02 ERROR [org.ovirt.engine.core.bll.exportimport.ImportVmFromConfigurationCommand] (org.ovirt.thread.pool-6-thread-38) [e77253c4-39cd-4669-9886-b7d451cb615b] Exception: java.lang.NullPointerException
        at org.ovirt.engine.core.bll.exportimport.ImportVmCommand.createMemoryDisk(ImportVmCommand.java:1006) [bll.jar:]
        at org.ovirt.engine.core.bll.exportimport.ImportVmCommand.lambda$addMemoryImages$2(ImportVmCommand.java:994) [bll.jar:]
        at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) [rt.jar:1.8.0_131]
        at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) [rt.jar:1.8.0_131]
        at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374) [rt.jar:1.8.0_131]
        at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481) [rt.jar:1.8.0_131]
        at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) [rt.jar:1.8.0_131]
        at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) [rt.jar:1.8.0_131]
        at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) [rt.jar:1.8.0_131]
        at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) [rt.jar:1.8.0_131]
        at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) [rt.jar:1.8.0_131]
        at org.ovirt.engine.core.bll.exportimport.ImportVmCommand.addMemoryImages(ImportVmCommand.java:993) [bll.jar:]
        at org.ovirt.engine.core.bll.exportimport.ImportVmCommand.lambda$processImages$0(ImportVmCommand.java:678) [bll.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction(TransactionSupport.java:202) [utils.jar:]
        at org.ovirt.engine.core.bll.exportimport.ImportVmCommand.processImages(ImportVmCommand.java:676) [bll.jar:]
        at org.ovirt.engine.core.bll.exportimport.ImportVmCommand.processImages(ImportVmCommand.java:668) [bll.jar:]
        at org.ovirt.engine.core.bll.exportimport.ImportVmCommandBase.executeVmCommand(ImportVmCommandBase.java:406) [bll.jar:]
        at org.ovirt.engine.core.bll.exportimport.ImportVmCommand.executeVmCommand(ImportVmCommand.java:282) [bll.jar:]
        at org.ovirt.engine.core.bll.exportimport.ImportVmFromConfigurationCommand.executeVmCommand(ImportVmFromConfigurationCommand.java:216) [bll.jar:]
        at org.ovirt.engine.core.bll.VmCommand.executeCommand(VmCommand.java:120) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeWithoutTransaction(CommandBase.java:1251) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeActionInTransactionScope(CommandBase.java:1391) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.runInTransaction(CommandBase.java:2055) [bll.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInSuppressed(TransactionSupport.java:164) [utils.jar:]
        at org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope(TransactionSupport.java:103) [utils.jar:]
        at org.ovirt.engine.core.bll.CommandBase.execute(CommandBase.java:1451) [bll.jar:]
        at org.ovirt.engine.core.bll.CommandBase.executeAction(CommandBase.java:397) [bll.jar:]
        at org.ovirt.engine.core.bll.PrevalidatingMultipleActionsRunner.executeValidatedCommand(PrevalidatingMultipleActionsRunner.java:204) [bll.jar:]
        at org.ovirt.engine.core.bll.PrevalidatingMultipleActionsRunner.runCommands(PrevalidatingMultipleActionsRunner.java:176) [bll.jar:]
        at org.ovirt.engine.core.bll.PrevalidatingMultipleActionsRunner.lambda$invokeCommands$3(PrevalidatingMultipleActionsRunner.java:182) [bll.jar:]
        at org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil$InternalWrapperRunnable.run(ThreadPoolUtil.java:84) [utils.jar:]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_131]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_131]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_131]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_131]
        at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_131]
~~~


Version-Release number of selected component (if applicable):
ovirt-engine-4.1.4.2-0.1.el7.noarch

How reproducible:
once

Steps to Reproduce:
1. have old 3.6 env, add a temp NFS share for test
2. move a vm image to this temp NFS and detach/remove the temp NFS share from
   3.6 engine
3. have 4.1 env, attach the temp NFS share
4. import VM from the temp NFS
 
Actual results:
no task submitted although the UI dialog closes. there's JNPE in the log with ERROR level

Expected results:
should work

Additional info:

Comment 2 Jiri Belka 2017-08-04 08:33:33 UTC
I was not correct about 'no action was occuring' and 'no task submitted'. I was expecting to see > 0 in Tasks bar but it was so quickly failed that the number was '0'...

Anyway, I'd love to see a way to import VMs from data SDs.

~~~
engine=# select * from job;
                job_id                |        action_type        |                           description                           | status |               owner_id               | visible |
         start_time         |          end_time          |      last_update_time      |            correlation_id            | is_external | is_auto_cleared | engine_session_seq_id 
--------------------------------------+---------------------------+-----------------------------------------------------------------+--------+--------------------------------------+---------+
----------------------------+----------------------------+----------------------------+--------------------------------------+-------------+-----------------+-----------------------
 b7001909-3990-4af9-818f-45cfa347b761 | ImportVmFromConfiguration | Importing VM jbelka-vhost1 from configuration to Cluster test01 | FAILED | 03656fe1-8a08-4926-b874-168bcec474af | t       |
 2017-08-04 03:45:47.033-04 | 2017-08-04 03:45:47.379-04 | 2017-08-04 03:45:47.379-04 | 0560a140-d6cd-42fb-99de-0a7fd96afd69 | f           | t               |                 45570
 f6657a5f-7b62-4ace-a4e0-edd466550082 | ImportVmFromConfiguration | Importing VM jbelka-vhost1 from configuration to Cluster test01 | FAILED | 03656fe1-8a08-4926-b874-168bcec474af | t       |
 2017-08-04 03:47:32.311-04 | 2017-08-04 03:47:32.613-04 | 2017-08-04 03:47:32.613-04 | 91023f53-a013-445b-be48-7bb073557aa8 | f           | t               |                 45570
 cf54692d-55c7-4561-bbdf-9dfcefd00133 | ImportVmFromConfiguration | Importing VM jbelka-vhost1 from configuration to Cluster test01 | FAILED | 03656fe1-8a08-4926-b874-168bcec474af | t       |
 2017-08-04 03:56:18.801-04 | 2017-08-04 03:56:19.034-04 | 2017-08-04 03:56:19.034-04 | 08e1a9e7-682f-4401-84e0-145c86df0d3e | f           | t               |                 45570
 25d2025d-ae83-4d3a-85b2-2845b6015373 | ImportVmFromConfiguration | Importing VM jbelka-vhost1 from configuration to Cluster test01 | FAILED | 03656fe1-8a08-4926-b874-168bcec474af | t       |
 2017-08-04 04:01:11.717-04 | 2017-08-04 04:01:11.923-04 | 2017-08-04 04:01:11.923-04 | e77253c4-39cd-4669-9886-b7d451cb615b | f           | t               |                 45570
(4 rows)
~~~

Comment 3 Allon Mureinik 2017-08-08 12:10:47 UTC
Possibly related to bug 1461387

Comment 4 Maor 2017-08-10 08:33:31 UTC
Hi Jiri,

Can you please share the OVF of the VM:
SELECT ovf_data FROM unregistered_ovf_of_entities where entity_guid = '8f8fc16a-23ee-4621-a971-fd4b5e5fe3bd'

It looks like the storage domain which the memory snapshot is reside on is not exists (could be that it was not imported) we can verify that with the OVF that you will provide

Comment 5 Allon Mureinik 2017-08-10 12:08:14 UTC
If there's another build for 4.1.5 I'd like to get this in, but we shouldn't block on it.

Comment 6 Jiri Belka 2017-08-11 05:54:34 UTC
(In reply to Maor from comment #4)
> Hi Jiri,
> 
> Can you please share the OVF of the VM:
> SELECT ovf_data FROM unregistered_ovf_of_entities where entity_guid =
> '8f8fc16a-23ee-4621-a971-fd4b5e5fe3bd'
> 
> It looks like the storage domain which the memory snapshot is reside on is
> not exists (could be that it was not imported) we can verify that with the
> OVF that you will provide

engine=# SELECT ovf_data FROM unregistered_ovf_of_entities where entity_guid = '8f8fc16a-23ee-4621-a971-fd4b5e5fe3bd';
 ovf_data 
----------
(0 rows)

Comment 7 Maor 2017-08-11 07:25:27 UTC
Thanks for the output Jiri.

Can you please upload the engine log again, the character set doesn't seems to be readable.
Also, can you please share the output of the unregistered_ovf_of_entities table:
  SELECT * FROM unregistered_ovf_of_entities;

Comment 9 Maor 2017-08-20 23:05:13 UTC
Hi Jiri,

Besides the null exception, I could not find anything in the log which could help me to find the root cause of your issue.
I assumed that this is because your memory volume's storage domain does not exists in your setup.
In that case the import should fail with a proper error message instead of null.
I uploaded two patches that should fix that issue.

If you still have the storage domain with this VM which I can use to reproduce your exception that could be great, if not I assume I will continue with the fix which I prepared.

Comment 10 Kevin Alon Goldblatt 2017-09-14 12:46:10 UTC
Verified with the following code:
---------------------------------------
ovirt-engine-4.1.6.2-0.1.el7.noarch
vdsm-4.19.31-1.el7ev.x86_64


Verified with the following scenario:
--------------------------------------
Steps to Reproduce:
1. have old 3.6 env, add a temp NFS share for test
2. move a vm image to this temp NFS and detach/remove the temp NFS share from
   3.6 engine
3. have 4.1 env, attach the temp NFS share
4. import VM from the temp NFS - Now an error is reported indicating the the VM cannot be imported


Moving to VERIFIED


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