Bug 1400519 - Detaching the storage connection from a domain on maintenance throws a Internal Server Error (but succeeds)
Summary: Detaching the storage connection from a domain on maintenance throws a Intern...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: BLL.Storage
Version: 4.0.6
Hardware: Unspecified
OS: Unspecified
unspecified
medium vote
Target Milestone: ovirt-4.1.0-rc
: ---
Assignee: Daniel Erez
QA Contact: Raz Tamir
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-12-01 12:24 UTC by Carlos Mestre González
Modified: 2017-01-09 17:24 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-12-28 11:17:17 UTC
oVirt Team: Storage
rule-engine: ovirt-4.1+
rule-engine: blocker+


Attachments (Terms of Use)
engine.log (366.28 KB, text/plain)
2016-12-01 12:24 UTC, Carlos Mestre González
no flags Details

Description Carlos Mestre González 2016-12-01 12:24:02 UTC
Created attachment 1226809 [details]
engine.log

Description of problem:
Trying to detach the storage connection of a domain in maintenance that is shared with other domain succeeds but throws a Internal Server Error response.

Version-Release number of selected component (if applicable):
rhevm-4.0.6-0.1.el7ev.noarch

How reproducible:
100%

Steps to Reproduce:
1. Create a DC, Cluster add a Host
2. Add a NFS domain as master
3. Create two iscsi domains, iscsi_0 and iscsi_1 that share the same storage connection
5. Put the iscsi_0 in maintenance
6. Try to detach the connection from iscsi_0:

DELETE  /ovirt-engine/api/storagedomains/4463f228-a199-4940-82cb-0ca0aa2b7db8/storageconnections/c3ed9176-d2fe-43c4-b431-b3d28739ba76


Actual results:
Operation succeeds (connection isdetached) but the response is a 500
2016-12-01 12:09:28,440 - MainThread - core_api - DEBUG - Request DELETE response time: 0.370
2016-12-01 12:09:28,441 - MainThread - storagedomains - DEBUG - Cleaning Correlation-Id: stora
gedomains_delete_a0142669-6a8b-4356
2016-12-01 12:09:28,443 - MainThread - storagedomains - ERROR - Details was not found on body
2016-12-01 12:09:28,443 - MainThread - api_utils - ERROR - Failed to delete element NOT as expected:
        Status: 500
        Reason: Internal Server Error


Expected results:
There's a response body.


Additional info:

Comment 1 Red Hat Bugzilla Rules Engine 2016-12-27 16:39:47 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 2 Daniel Erez 2016-12-28 08:23:29 UTC
Hi Carlos,

Detaching a storage domain is done by sending DELETE on the domain.
E.g. DELETE /api/datacenters/123/storagedomains/456

Deleting a shared storage server connection should indeed fail as mentioned in the description.

What's blocking the automation tests?

Comment 3 Carlos Mestre González 2016-12-28 10:59:01 UTC
Nothing is blocking our tests (was it mark as automation blocker?)

AFA I se in our test plans when you put in maintenance the iscsi_0, and THEN detach the storage CONNECTION from that domain with:

DELETE  /ovirt-engine/api/storagedomains/4463f228-a199-4940-82cb-0ca0aa2b7db8/storageconnections/c3ed9176-d2fe-43c4-b431-b3d28739ba76

it should work (and it does in our tests), but it throws a 500 Internal Server Error.

So either:

1) Operation should fail and it should be changed, also the response body should not return "Internal Server Error" but a proper message why the operation failed/is not allowed.
2) Operation should succeed and return code should change to 200.

Comment 4 Daniel Erez 2016-12-28 11:17:17 UTC
(In reply to Carlos Mestre González from comment #3)
> Nothing is blocking our tests (was it mark as automation blocker?)
> 
> AFA I se in our test plans when you put in maintenance the iscsi_0, and THEN
> detach the storage CONNECTION from that domain with:
> 
> DELETE 
> /ovirt-engine/api/storagedomains/4463f228-a199-4940-82cb-0ca0aa2b7db8/
> storageconnections/c3ed9176-d2fe-43c4-b431-b3d28739ba76
> 
> it should work (and it does in our tests), but it throws a 500 Internal
> Server Error.
> 
> So either:
> 
> 1) Operation should fail and it should be changed, also the response body
> should not return "Internal Server Error" but a proper message why the
> operation failed/is not allowed.
> 2) Operation should succeed and return code should change to 200.

In order to detach a domain you should DELETE the storage domain. DELETE on a connection should be used only when cleanup is needed and the connection is not used by any other storage domain (or DirectLUN disk). The tests plans should be changed accordingly.

Comment 5 Carlos Mestre González 2017-01-09 13:37:55 UTC
Hi Daniel,
So I'm still a bit confused, I'm not trying to detach a domain, I'm trying to remove the storage connection from that domain while is in maintenance, this scenario:

1) Two storage domains with the same storage connectaion (iscsi_0 and iscsi_1)
2) Put iscsi_0 on maintenance
3) Try to detach that STORAGE CONNECTION (not domain) from the domain iscsi_0 [So maybe it can be attached to other storage connectin later)
DELETE  /ovirt-engine/api/storagedomains/4463f228-a199-4940-82cb-0ca0aa2b7db8/storageconnections/c3ed9176-d2fe-43c4-b431-b3d28739ba76


does this scenario makes sence?

1) if it does, in the test fails and should be fixed.

2) if it doesn't, then still the engine returns:

	Status: 500
	Reason: Internal Server Error

and should actually return a proper message like:

"Is not possible to remove the storage conecction from a storage domain while it's in maintenance" or something on those lines.

Comment 6 Daniel Erez 2017-01-09 17:24:26 UTC
(In reply to Carlos Mestre González from comment #5)
> Hi Daniel,
> So I'm still a bit confused, I'm not trying to detach a domain, I'm trying
> to remove the storage connection from that domain while is in maintenance,
> this scenario:
> 
> 1) Two storage domains with the same storage connectaion (iscsi_0 and
> iscsi_1)
> 2) Put iscsi_0 on maintenance
> 3) Try to detach that STORAGE CONNECTION (not domain) from the domain
> iscsi_0 [So maybe it can be attached to other storage connectin later)
> DELETE 
> /ovirt-engine/api/storagedomains/4463f228-a199-4940-82cb-0ca0aa2b7db8/
> storageconnections/c3ed9176-d2fe-43c4-b431-b3d28739ba76
> 
> 
> does this scenario makes sence?
> 
> 1) if it does, in the test fails and should be fixed.
> 
> 2) if it doesn't, then still the engine returns:
> 
> 	Status: 500
> 	Reason: Internal Server Error
> 
> and should actually return a proper message like:
> 
> "Is not possible to remove the storage conecction from a storage domain
> while it's in maintenance" or something on those lines.

It isn't possible to remove a storage connection that is used by a storage domain. A storage connection can only be deleted not detached, no need to delete for reusing it (it's relevant just for cleanup).

I've checked the described scenario on latest 4.1 and got an appropriate message: "Cannot remove Storage Connection. Storage connection parameters are used by the following storage domains : scsi2,scsi1."

Do you get a similar message on latest 4.1 build?


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