Bug 1020812

Summary: attempt to import Export domain as ISO domain creates an orphaned storage connection that prevents subsequent import of the domain as an Export domain
Product: Red Hat Enterprise Virtualization Manager Reporter: David Jaša <djasa>
Component: ovirt-engineAssignee: Daniel Erez <derez>
Status: CLOSED CURRENTRELEASE QA Contact: Leonid Natapov <lnatapov>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.3.0CC: acathrow, amureini, iheim, lpeer, Rhev-m-bugs, scohen, yeylon
Target Milestone: ---Flags: amureini: Triaged+
Target Release: 3.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: storage
Fixed In Version: is23 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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:
Bug Depends On:    
Bug Blocks: 1032811    

Description David Jaša 2013-10-18 10:30:59 UTC
Description of problem:
attempt to import Export domain as ISO domain creates an orphaned storage connection that prevents subsequent import of the domain as an Export domain

Version-Release number of selected component (if applicable):
is19:
rhevm-backend-3.3.0-0.26.master.el6ev.noarch
vdsm-4.13.0-0.3.beta1.el6ev.x86_64

How reproducible:
didn't try to reproduce

Steps to Reproduce:
1. have an existing export domain (NFSv4/V1) and a clean RHEV 3.3 with just a data domain
2. hit "Import Domain", keep type as NFS/ISO, type uri of the Export domain - you'll get an error
3. try to import the domain once again, now as a correct type

Actual results:
"Storage connection already exists" error is returned

Expected results:
this condition is handled somehow - either the storage connection is deleted upon error, or it is reused on another try

Additional info:

the storage connection could not be deleted via API without host being specified (a bug in Feature page: http://www.ovirt.org/Features/Manage_Storage_Connections#Delete_connection_.28DELETE.29 or in API?):
$ curl -D - -H "Content-type: application/xml" -H "prefer: persistent-auth"  -b .cookies/rhevm33 -c .cookies/rhevm33 --cacert .certs/rhevm33.pem https://rhevm33.example.com/api/storageconnections/5242a375-5b64-4879-9e02-b626956700ad 
HTTP/1.1 200 OK
Date: Fri, 18 Oct 2013 10:24:24 GMT
Pragma: No-cache
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 01:00:00 CET
Content-Type: application/xml
Content-Length: 325
Vary: Accept-Encoding
Connection: close

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<storage_connection href="/api/storageconnections/5242a375-5b64-4879-9e02-b626956700ad" id="5242a375-5b64-4879-9e02-b626956700ad">
    <address>nfs_server_IP</address>
    <type>nfs</type>
    <path>/nfs/vms</path>
    <nfs_version>V4</nfs_version>
</storage_connection>
$ curl -D - -H "Content-type: application/xml" -H "prefer: persistent-auth"  -b .cookies/rhevm33 -c .cookies/rhevm33 --cacert .certs/rhevm33.pem https://rhevm33.example.com/api/storageconnections/5242a375-5b64-4879-9e02-b626956700ad -X DELETE
HTTP/1.1 400 Bad Request
Date: Fri, 18 Oct 2013 10:25:39 GMT
Pragma: No-cache
Cache-Control: no-cache
Expires: Thu, 01 Jan 1970 01:00:00 CET
Content-Type: text/html;charset=utf-8
Content-Length: 1309
Vary: Accept-Encoding
Connection: close

<html><head><title>JBoss Web/7.2.2.Final-redhat-1 - JBWEB000064: Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>JBWEB000065: HTTP Status 400 - javax.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException; Premature end of file.]</h1><HR size="1" noshade="noshade"><p><b>JBWEB000309: type</b> JBWEB000067: Status report</p><p><b>JBWEB000068: message</b> <u>javax.xml.bind.UnmarshalException
 - with linked exception:
[org.xml.sax.SAXParseException; Premature end of file.]</u></p><p><b>JBWEB000069: description</b> <u>JBWEB000120: The request sent by the client was syntactically incorrect.</u></p><HR size="1" noshade="noshade"><h3>JBoss Web/7.2.2.Final-redhat-1</h3></body></html>

Comment 3 Allon Mureinik 2013-10-22 16:49:40 UTC
technical insight:

AddExistingFileDomainCommand calls AddStorageServerConnection as an internal command, and only if it succeeds, proceeds to save the domain's details.
If there's a failure, the connection cannot be compensated, since it's its own command.

Comment 4 Allon Mureinik 2013-10-27 08:53:55 UTC
(In reply to Allon Mureinik from comment #3)
> technical insight:
> 
> AddExistingFileDomainCommand calls AddStorageServerConnection as an internal
> command, and only if it succeeds, proceeds to save the domain's details.
> If there's a failure, the connection cannot be compensated, since it's its
> own command.
Albeit this statement is true, the flow from the UI does not pass through it - the frontend is driving it, but lacks a failure callback.

Comment 6 Leonid Natapov 2013-11-24 14:14:33 UTC
is24.1 Import succeeded.

Comment 7 Itamar Heim 2014-01-21 22:28:15 UTC
Closing - RHEV 3.3 Released

Comment 8 Itamar Heim 2014-01-21 22:28:15 UTC
Closing - RHEV 3.3 Released

Comment 9 Itamar Heim 2014-01-21 22:31:07 UTC
Closing - RHEV 3.3 Released