Bug 1069581

Summary: [engine-backend] NullPointerException for CanDoAction failure of reconstruct master during re-initialize to a new DC from an unattached domain
Product: [Retired] oVirt Reporter: Elad <ebenahar>
Component: ovirt-engine-coreAssignee: Liron Aravot <laravot>
Status: CLOSED CURRENTRELEASE QA Contact: nlevinki <nlevinki>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.4CC: amureini, gklein, iheim, rbalakri, yeylon
Target Milestone: ---   
Target Release: 3.5.0   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: storage
Fixed In Version: ovirt-3.5.0-alpha1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-17 12:28:18 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 and vdsm logs none

Description Elad 2014-02-25 10:41:38 UTC
Created attachment 867348 [details]
engine and vdsm logs

Description of problem:
Re-initialize DC from an unattached domain for a new DC, which wasn't initialized before, fails with a NullPointerException for CanDoAction failure of reconstruct master. This DC was never initialized before so reconstruct master should not take place.  

Version-Release number of selected component (if applicable):
ovirt-engine-3.4.0-0.11.beta3.el6.noarch

How reproducible:
Always

Steps to Reproduce:
1. Create an unattached storage domain (attach it to DC 'none') 
2. Create a new DC 
3. Re-initialize the new DC from the unattached storage domain

Actual results:
Engine tries to perform a recovery to the storage pool, but the DC is new and doesn't contain any storage domain, so there is no old master domain.

===========
2014-02-25 12:29:42,369 ERROR [org.ovirt.engine.core.bll.storage.RecoveryStoragePoolCommand] (ajp--127.0.0.1-8702-15) [6d77107d] Error during CanDoActionFailure.: java.lang.NullPointerException
        at org.ovirt.engine.core.bll.storage.ReconstructMasterDomainCommand.canDoAction(ReconstructMasterDomainCommand.java:68) [bll.jar:]
        at org.ovirt.engine.core.bll.storage.RecoveryStoragePoolCommand.canDoAction(RecoveryStoragePoolCommand.java:52) [bll.jar:]
===========

Expected results:
Engine should skip the storage pool recovery phase because the DC is new when initializing it from an unattached domain.


User Impact:
The main impact here would be the failure to detach a storage domain from an existing DC and attaching it to a new one.


Additional info: engine and vdsm logs

Comment 1 Elad 2014-02-25 11:55:41 UTC
Reproduced also with RHEV-3.3 (rhevm-3.3.0-0.42.el6ev.noarch)

Comment 2 Elad 2014-05-27 09:36:53 UTC
The option to re-initialize a non-initialized DC is now blocked by engine, it's greyed out in webadmin.
This was tested only in webadmin and not in other APIs. Therefore, I'm leaving the bug as ON_QA until we will have the option to perform re-initialize DC from an unattached domain also via REST API.

Tested on ovirt-3.5.0-alpha1

Comment 3 Gadi Ickowicz 2014-06-17 12:13:09 UTC
Setting verified as per comment 2. Was not yet tested in REST API since RFE is not yet implemented

Comment 5 Sandro Bonazzola 2014-10-17 12:28:18 UTC
oVirt 3.5 has been released and should include the fix for this issue.