Bug 1376751 - NPE importing the hosted-engine VM
Summary: NPE importing the hosted-engine VM
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.HostedEngine
Version: 4.0.4.2
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ovirt-4.0.4
: 4.0.4
Assignee: Roy Golan
QA Contact: Artyom
URL:
Whiteboard:
: 1376768 (view as bug list)
Depends On: 1361838
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-16 09:55 UTC by Simone Tiraboschi
Modified: 2017-05-11 09:31 UTC (History)
9 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-09-26 12:40:07 UTC
oVirt Team: SLA
Embargoed:
rule-engine: ovirt-4.0.z+
rule-engine: blocker+
mgoldboi: planning_ack+
dfediuck: devel_ack+
mavital: testing_ack+


Attachments (Terms of Use)
engine.log (106.09 KB, application/x-gzip)
2016-09-16 10:02 UTC, Simone Tiraboschi
no flags Details


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 63530 0 None MERGED core: Fix disk profile matching by storage domain 2020-02-03 19:23:10 UTC

Description Simone Tiraboschi 2016-09-16 09:55:41 UTC
Description of problem:
The auto-import of the engine VM now fails with a NPE:

2016-09-16 09:47:31,615 INFO  [org.ovirt.engine.core.bll.HostedEngineImporter] (org.ovirt.thread.pool-8-thread-4) [42078f97] Try to import the Hosted Engine VM 'VM [HostedEngine]'
2016-09-16 09:47:31,622 INFO  [org.ovirt.engine.core.bll.exportimport.ImportVmCommand] (org.ovirt.thread.pool-8-thread-4) [2dc04f12] Lock Acquired to object 'EngineLock:{exclusiveLocks='[788f89d7-892b-43b9-97a7-de5fb5f98092=<VM, ACTION_TYPE_FAILED_VM_IS_BEING_IMPORTED$VmName HostedEngine>, HostedEngine=<VM_NAME, ACTION_TYPE_FAILED_NAME_ALREADY_USED>]', sharedLocks='[788f89d7-892b-43b9-97a7-de5fb5f98092=<REMOTE_VM, ACTION_TYPE_FAILED_VM_IS_BEING_IMPORTED$VmName HostedEngine>]'}'
2016-09-16 09:47:31,631 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.DoesImageExistVDSCommand] (org.ovirt.thread.pool-8-thread-4) [2dc04f12] START, DoesImageExistVDSCommand( GetImageInfoVDSCommandParameters:{runAsync='true', storagePoolId='57dbb996-0308-02dc-0384-000000000335', ignoreFailoverLimit='false', storageDomainId='0e840922-6445-4469-89c8-4fc590f736ca', imageGroupId='07f29d09-3e71-45ed-a8cc-097bb51e283d', imageId='8e5af8fd-13ca-411d-828f-f101072ceef6'}), log id: bbca872
2016-09-16 09:47:32,645 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.DoesImageExistVDSCommand] (org.ovirt.thread.pool-8-thread-4) [2dc04f12] FINISH, DoesImageExistVDSCommand, return: true, log id: bbca872
2016-09-16 09:47:32,652 ERROR [org.ovirt.engine.core.bll.exportimport.ImportVmCommand] (org.ovirt.thread.pool-8-thread-4) [] Error during ValidateFailure.: java.lang.NullPointerException
        at org.ovirt.engine.core.bll.profiles.DiskProfileHelper.updateDiskImageProfilesList(DiskProfileHelper.java:115) [bll.jar:]
        at org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles(DiskProfileHelper.java:79) [bll.jar:]
        at org.ovirt.engine.core.bll.exportimport.ImportVmCommand.setAndValidateDiskProfiles(ImportVmCommand.java:1105) [bll.jar:]
        at org.ovirt.engine.core.bll.exportimport.ImportVmCommand.validateAfterCloneVm(ImportVmCommand.java:435) [bll.jar:]
        at org.ovirt.engine.core.bll.exportimport.ImportVmCommand.validate(ImportVmCommand.java:168) [bll.jar:]



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


How reproducible:
100% (4 on 4)

Steps to Reproduce:
1. deploy hosted-engine (I used NFS, not sure about other storage kind)
2. engine-config -s  OvfUpdateIntervalInMinutes=1 && systemctl restart ovirt-engine # on the engine VM to reduce the timeout befor generating the OVF_STORE disks
3. add the first storage domain for regular VMs
4. wait for the engine VM to be auto-imported

Actual results:
It fails with a Null Pointer Exception

Expected results:
It sucessfully imports the hosted-engine VM

Additional info:

Comment 1 Simone Tiraboschi 2016-09-16 09:57:22 UTC
(In reply to Simone Tiraboschi from comment #0)
> Version-Release number of selected component (if applicable):
ovirt-engine.noarch                 4.0.4.3-1.el7.centos         @ovirt-4.0-pre

Comment 2 Simone Tiraboschi 2016-09-16 10:02:48 UTC
Created attachment 1201582 [details]
engine.log

Comment 3 Simone Tiraboschi 2016-09-16 10:20:35 UTC
Lev, can you please ensure that this is explicitly covered by our CI tests?

We need to:
- add (via REST API) an additional storage domain
- wait for the hosted-engine storage domain to be auto-imported and check it via REST API
- wait for the hosted-engine VM to be auto-imported and check it via REST API
- wait for the OVF_STORE disks to be generated on the hosted-engine storage domain

The latest step will by normally performed only after one hour; if we don't want to block the test for one hour just for that we can reduce that timing to one minute with:

engine-config -s  OvfUpdateIntervalInMinutes=1 && systemctl restart ovirt-engine

Comment 4 Simone Tiraboschi 2016-09-16 12:06:21 UTC
*** Bug 1376768 has been marked as a duplicate of this bug. ***

Comment 5 SATHEESARAN 2016-09-16 12:17:41 UTC
I too faced the same scenario with glusterfs storage domain with HC ( Grafton LA ) setup.

Comment 6 Yaniv Kaul 2016-09-18 08:53:59 UTC
(In reply to Simone Tiraboschi from comment #3)
> Lev, can you please ensure that this is explicitly covered by our CI tests?
> 
> We need to:
> - add (via REST API) an additional storage domain

This is already done today, I believe.

> - wait for the hosted-engine storage domain to be auto-imported and check it
> via REST API

This isn't.

> - wait for the hosted-engine VM to be auto-imported and check it via REST API

This isn't.

> - wait for the OVF_STORE disks to be generated on the hosted-engine storage
> domain

This isn't.

> 
> The latest step will by normally performed only after one hour; if we don't
> want to block the test for one hour just for that we can reduce that timing
> to one minute with:
> 
> engine-config -s  OvfUpdateIntervalInMinutes=1 && systemctl restart
> ovirt-engine

I thought there was a way to explicitly refresh the OVF store and the HE is supposed to use it?

Comment 7 Yanir Quinn 2016-09-18 10:02:33 UTC
A fix for this issues is already merged on 4.0 :
https://bugzilla.redhat.com/show_bug.cgi?id=1361838
https://gerrit.ovirt.org/#/c/63531/1

Comment 8 Simone Tiraboschi 2016-09-19 09:42:52 UTC
(In reply to Yaniv Kaul from comment #6)
> > engine-config -s  OvfUpdateIntervalInMinutes=1 && systemctl restart
> > ovirt-engine
> 
> I thought there was a way to explicitly refresh the OVF store and the HE is
> supposed to use it?

Roy, is the auto-import procedure forcefully triggering the OVF_STORE creation or have we still to wait for the whole OvfUpdateIntervalInMinutes ?

Comment 9 Artyom 2016-09-21 09:01:18 UTC
Verified on rhevm-4.0.4.4-0.1.el7ev.noarch

Auto-import succeeds without any errors:
2016-09-21 04:56:24,125 INFO  [org.ovirt.engine.core.bll.HostedEngineImporter] (org.ovirt.thread.pool-6-thread-46) [79fd311c] Try to import the Hosted Engine VM 'VM [HostedEngine]'
2016-09-21 04:56:24,405 INFO  [org.ovirt.engine.core.bll.exportimport.ImportVmCommand] (org.ovirt.thread.pool-6-thread-46) [7d5ecb51] Lock Acquired to object 'EngineLock:{exclusiveLocks='[89b8402f-f042-4649-822b-3ebd6fc60ef2=<VM, ACTION_TYPE_FAILED_VM_IS_BEING_IMPORTED$VmName HostedEngine>, HostedEngine=<VM_NAME, ACTION_TYPE_FAILED_NAME_ALREADY_USED>]', sharedLocks='[89b8402f-f042-4649-822b-3ebd6fc60ef2=<REMOTE_VM, ACTION_TYPE_FAILED_VM_IS_BEING_IMPORTED$VmName HostedEngine>]'}'
2016-09-21 04:56:24,458 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.DoesImageExistVDSCommand] (org.ovirt.thread.pool-6-thread-46) [7d5ecb51] START, DoesImageExistVDSCommand( GetImageInfoVDSCommandParameters:{runAsync='true', storagePoolId='57e243b2-0367-00fc-0093-00000000018a', ignoreFailoverLimit='false', storageDomainId='6815aff5-b6a4-4d67-9372-7572ba0d6754', imageGroupId='ce4a73d4-1874-4137-9c0b-8b963c988db3', imageId='fe45e5b9-4e7b-4998-8790-8ce1b6864eee'}), log id: 7485a56f
2016-09-21 04:56:25,481 INFO  [org.ovirt.engine.core.vdsbroker.irsbroker.DoesImageExistVDSCommand] (org.ovirt.thread.pool-6-thread-46) [7d5ecb51] FINISH, DoesImageExistVDSCommand, return: true, log id: 7485a56f
2016-09-21 04:56:25,580 INFO  [org.ovirt.engine.core.bll.exportimport.ImportVmCommand] (org.ovirt.thread.pool-6-thread-46) [] Running command: ImportVmCommand internal: true. Entities affected :  ID: 6815aff5-b6a4-4d67-9372-7572ba0d6754 Type: StorageAction group IMPORT_EXPORT_VM with role type ADMIN,  ID: 6815aff5-b6a4-4d67-9372-7572ba0d6754 Type: StorageAction group IMPORT_EXPORT_VM with role type ADMIN
2016-09-21 04:56:25,832 WARN  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (org.ovirt.thread.pool-6-thread-46) [] Correlation ID: null, Call Stack: null, Custom Event ID: -1, Message: VM HostedEngine has MAC address(es) 00:16:3e:7b:b8:53, which is/are out ouf its MAC pool definitions.
2016-09-21 04:56:26,010 WARN  [org.ovirt.engine.core.bll.exportimport.ImportVmCommand] (org.ovirt.thread.pool-6-thread-46) [] VM '89b8402f-f042-4649-822b-3ebd6fc60ef2' doesn't have active snapshot in export domain
2016-09-21 04:56:26,292 INFO  [org.ovirt.engine.core.vdsbroker.SetVmStatusVDSCommand] (org.ovirt.thread.pool-6-thread-46) [] START, SetVmStatusVDSCommand( SetVmStatusVDSCommandParameters:{runAsync='true', vmId='89b8402f-f042-4649-822b-3ebd6fc60ef2', status='Down', exitStatus='Normal'}), log id: 6ab0d3cd
2016-09-21 04:56:26,310 INFO  [org.ovirt.engine.core.vdsbroker.SetVmStatusVDSCommand] (org.ovirt.thread.pool-6-thread-46) [] FINISH, SetVmStatusVDSCommand, log id: 6ab0d3cd
2016-09-21 04:56:26,338 INFO  [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (org.ovirt.thread.pool-6-thread-46) [] Correlation ID: 7d5ecb51, Call Stack: null, Custom Event ID: -1, Message: Starting to import Vm HostedEngine to Data Center Default, Cluster Default
2016-09-21 04:56:26,338 INFO  [org.ovirt.engine.core.bll.exportimport.ImportVmCommand] (org.ovirt.thread.pool-6-thread-46) [] Lock freed to object 'EngineLock:{exclusiveLocks='[89b8402f-f042-4649-822b-3ebd6fc60ef2=<VM, ACTION_TYPE_FAILED_VM_IS_BEING_IMPORTED$VmName HostedEngine>, HostedEngine=<VM_NAME, ACTION_TYPE_FAILED_NAME_ALREADY_USED>]', sharedLocks='[89b8402f-f042-4649-822b-3ebd6fc60ef2=<REMOTE_VM, ACTION_TYPE_FAILED_VM_IS_BEING_IMPORTED$VmName HostedEngine>]'}'
2016-09-21 04:56:26,338 INFO  [org.ovirt.engine.core.bll.HostedEngineImporter] (org.ovirt.thread.pool-6-thread-46) [] Successfully imported the Hosted Engine VM

Comment 10 Lev Veyde 2016-09-22 08:37:59 UTC
(In reply to Simone Tiraboschi from comment #3)
> Lev, can you please ensure that this is explicitly covered by our CI tests?
> 
> We need to:
> - add (via REST API) an additional storage domain
> - wait for the hosted-engine storage domain to be auto-imported and check it
> via REST API
> - wait for the hosted-engine VM to be auto-imported and check it via REST API
> - wait for the OVF_STORE disks to be generated on the hosted-engine storage
> domain
> 
> The latest step will by normally performed only after one hour; if we don't
> want to block the test for one hour just for that we can reduce that timing
> to one minute with:
> 
> engine-config -s  OvfUpdateIntervalInMinutes=1 && systemctl restart
> ovirt-engine

I think that Yaniv is right, we only have the additional storage addition, which is done with PythonSDK (ovirt-lago).


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