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

Bug 1148500

Summary: [engine-backend] [importDomain] Importing an exising data domain fails with internal engine error after the domain was forcibly removed
Product: Red Hat Enterprise Virtualization Manager Reporter: Elad <ebenahar>
Component: ovirt-engineAssignee: Piotr Kliczewski <pkliczew>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Kubica <pkubica>
Severity: urgent Docs Contact:
Priority: unspecified    
Version: 3.5.0CC: amureini, ecohen, gklein, iheim, lpeer, lsurette, mlipchuk, oourfali, pkliczew, rbalakri, Rhev-m-bugs, sherold, tnisan, yeylon
Target Milestone: ---   
Target Release: 3.5.0   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: org.ovirt.engine-root-3.5.0-15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-17 17:13:49 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1148499    
Bug Blocks:    
Attachments:
Description Flags
engine and vdsm logs none

Description Elad 2014-10-01 15:09:27 UTC
Created attachment 943104 [details]
engine and vdsm logs

Description of problem:
I tried to imoport an existing local data domain to the local DC after it has been destroyed (simulated a disaster scenario). The operation failed with an internal engine error. 

The detachment of the storage domain during the destroy failed on vdsm:
https://bugzilla.redhat.com/show_bug.cgi?id=1148499

Version-Release number of selected component (if applicable):
rhev3.5 vt4
rhevm-3.5.0-0.13.beta.el6ev.noarch

How reproducible:
Always

Steps to Reproduce:
1. Create a local DC with 2 local data domains
2. Destroy the non-master domain. 
3. Import the destroyed data domain 

Actual results:
Import domain operation fails with:

2014-10-01 17:47:07,989 ERROR [org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector] (ajp-/127.0.0.1:8702-2) [6650c27b] Correlation ID: 6650c27b, Job ID: f3b27d7c-5b27-42f3-b64a-cc51fbef569f, Call Stack: null, Custom Event ID: -1, Message: Failed to attach Storage Domain s2 to Data Center green-vdsc-Local. (User: admin


	
Webadmin:	
	
Operation Canceled
Error while executing action Attach Storage Domain: Internal Engine Error



Expected results:
Import a local data domain should succeed

Additional info: engine and vdsm logs

Comment 1 Maor 2014-10-05 15:52:52 UTC
After investigation of the bug, it appears that the bug origin is from jsonRPC.
the engine pass force=true on force detach (see [1]), but for some reason, VDSM using json RPC, mix the parameters so the "true" value of force is set in the master parameter and instead the force is set to false (see [2])

[1]
JsonRpcServer::DEBUG::2014-10-05 18:41:46,661::__init__::504::jsonrpc.JsonRpcServer::(serve_requests) Waiting for request
Thread-179::DEBUG::2014-10-05 18:41:46,661::__init__::467::jsonrpc.JsonRpcServer::(_serveRequest) Calling 'StorageDomain.de
tach' in bridge with {u'storagepoolID': u'fe9aace7-c16e-4d6b-b651-7c575e06c784', u'force': True, u'storagedomainID': u'3815
3495-36a6-485f-b951-8807fb58db76'}

[2]
Logs which I added:
Thread-179::INFO::2014-10-05 18:41:46,663::API::989::vds::(detach) spUUIOD: u'fe9aace7-c16e-4d6b-b651-7c575e06c784'
Thread-179::INFO::2014-10-05 18:41:46,663::API::990::vds::(detach) master: True
Thread-179::INFO::2014-10-05 18:41:46,663::API::991::vds::(detach) masterVersion: 0
Thread-179::INFO::2014-10-05 18:41:46,663::API::992::vds::(detach) force: False

That is the reason of the force detach not working which is part of the import existing Storage Domain process

Comment 2 Allon Mureinik 2014-10-05 20:12:00 UTC
Maor, is this regression specifically for Local domains?

Comment 3 Maor 2014-10-06 07:51:08 UTC
(In reply to Allon Mureinik from comment #2)
> Maor, is this regression specifically for Local domains?

No, it is a regression reflects on the whole Import Storage Domain feature.
The user will not be able to attach a Domain to a Data Center while it was attached before to a different Data Center, since the logic is based on the force detach

Comment 4 Allon Mureinik 2014-10-06 20:58:35 UTC
Raising priority this this pertains to any data domain, not just local domains.

Piotr, IIUC, the solution to bug 1148499 should also cover this case - can you confirm?

Comment 5 Petr Kubica 2014-10-23 12:06:39 UTC
Verified in 
rhevm 3.5.0-0.17.beta.el6ev
vdsm vdsm-4.16.7.1-1.el6ev.x86_64

Comment 6 Eyal Edri 2015-02-17 17:13:49 UTC
rhev 3.5.0 was released. closing.