Bug 1478869 - RESTAPI- detach a storage connection from ISCSI SD in maintenance which is used by another ISCSI SD succeeds
RESTAPI- detach a storage connection from ISCSI SD in maintenance which is u...
Status: CLOSED NOTABUG
Product: ovirt-engine
Classification: oVirt
Component: BLL.Storage (Show other bugs)
4.2.0
Unspecified Unspecified
unspecified Severity medium (vote)
: ovirt-4.2.2
: ---
Assigned To: Eyal Shenitzky
Raz Tamir
: Automation
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-07 07:25 EDT by Avihai
Modified: 2017-12-10 05:05 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2017-12-10 05:05:18 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Storage
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
rule-engine: ovirt‑4.2+


Attachments (Terms of Use)
engine & vdsm logs (1.17 MB, application/x-gzip)
2017-08-07 07:25 EDT, Avihai
no flags Details

  None (edit)
Description Avihai 2017-08-07 07:25:44 EDT
Created attachment 1310026 [details]
engine & vdsm logs

Description of problem:
Detach the connection from the SD-A when SD-B is active still use the same connection , this can be due to fix of bug 1475122 .

When this bug was not fixed we got an error (server error) while trying to do the same operation so we did not see this issue until now (on a build with 1475122 fixed )

Version-Release number of selected component (if applicable):
4.2.0-0.0.master.20170803140556.git1e7d0dd.el7.centos.

How reproducible:
100%

Steps to Reproduce:
1) Create 1 master NFS doamin & 2 non master ISCSI domains SD-A & SD-B  with 1 same connection to the storage server.
2) move one of the ISCSI SD (SD-A) to maintenance
3) Detach the connection from the SD-A when SD-B is active still use the same connection .


Actual results:
Operation succeeds , deleting the connection from SD-A is completed without errors.


Expected results:
operation should fail as the same connection is active on the 2nd active SD .


Additional info:
Engine log:
2017-08-07 14:15:55,462+03 WARN  [org.ovirt.engine.core.dal.job.ExecutionMessageDirector] (default task-26) [storagedomains_delete_af757612-ea97-] The message key 'DetachStorageConnectionFromStorageDomain' is mi
ssing from 'bundles/ExecutionMessages'
2017-08-07 14:15:55,497+03 INFO  [org.ovirt.engine.core.bll.storage.connection.DetachStorageConnectionFromStorageDomainCommand] (default task-26) [storagedomains_delete_af757612-ea97-] Running command: DetachStorageConnectionFromStorageDomainCommand internal: false. Entities affected :  ID: 1f63ae6f-eff4-42a6-88df-551f4f9bcc70 Type: StorageAction group MANIPULATE_STORAGE_DOMAIN with role type ADMIN

Bad behavior in detail with REST API:
Latest 4.2 build ( 3.8.2017) you can delete a used connection (used from other ISCSI SD ) works:
2017-08-06 18:37:38,861 - MainThread - storagedomains - DEBUG - Response body for GET request is: 
<storage_connections>
    <storage_connection href="/ovirt-engine/api/storageconnections/ca174f15-6f85-46fd-aa73-eaadf6cea8f8" id="ca174f15-6f85-46fd-aa73-eaadf6cea8f8">
        <address>10.35.146.129</address>
        <port>3260</port>
        <target>iqn.2008-05.com.xtremio:xio00153500071-514f0c50023f6c00</target>
        <type>iscsi</type>
    </storage_connection>
</storage_connections>
 
2017-08-06 18:37:38,862 - MainThread - storagedomains - INFO - Using Correlation-Id: storagedomains_delete_8ae9b9af-493e-48f2
2017-08-06 18:37:38,863 - MainThread - storagedomains - DEBUG - DELETE request content is --  url:/ovirt-engine/api/storagedomains/f5ec4e42-36df-4af9-9cba-e1f1e5b67d2e/storageconnections/ca174f15-6f85-46fd-aa73-eaadf6cea8f8
2017-08-06 18:37:39,039 - MainThread - core_api - DEBUG - Request DELETE response time: 0.009
2017-08-06 18:37:39,041 - MainThread - storagedomains - DEBUG - Cleaning Correlation-Id: storagedomains_delete_8ae9b9af-493e-48f2
2017-08-06 18:37:39,041 - MainThread - storagedomains - DEBUG - Response code is valid: [200, 202, 204] 
2017-08-06 18:37:39,042 - MainThread - storagedomains - DEBUG - Response body for DELETE request is: 
<action>
    <job href="/ovirt-engine/api/jobs/78b08dfa-593a-441b-9bfc-ffa0da79bd2f" id="78b08dfa-593a-441b-9bfc-ffa0da79bd2f"/>
    <status>complete</status>
</action>
 
- Latest 4.2 build ( 1.8.2017) you can delete a used connection should fail (used from other ISCSI SD )with REST API:

2017-08-07 11:47:23,981 - MainThread - storagedomains - DEBUG - Response body for GET request is: 
<storage_connections>
    <storage_connection href="/ovirt-engine/api/storageconnections/f82bae92-2601-4451-b3d8-64877df9302b" id="f82bae92-2601-4451-b3d8-64877df9302b">
        <address>10.35.146.129</address>
        <port>3260</port>
        <target>iqn.2008-05.com.xtremio:xio00153500071-514f0c50023f6c00</target>
        <type>iscsi</type>
    </storage_connection>
</storage_connections>
 
2017-08-07 11:47:23,982 - MainThread - storagedomains - INFO - Using Correlation-Id: storagedomains_delete_4d17732b-6631-4cab
2017-08-07 11:47:23,982 - MainThread - storagedomains - DEBUG - DELETE request content is --  url:/ovirt-engine/api/storagedomains/f31bbc20-17fe-4c0c-a178-48cedc0779ae/storageconnections/f82bae92-2601-4451-b3d8-64877df9302b
2017-08-07 11:47:24,258 - MainThread - core_api - DEBUG - Request DELETE response time: 0.007
2017-08-07 11:47:24,259 - MainThread - storagedomains - DEBUG - Cleaning Correlation-Id: storagedomains_delete_4d17732b-6631-4cab
2017-08-07 11:47:24,260 - MainThread - storagedomains - ERROR - Details was not found on body
2017-08-07 11:47:24,261 - MainThread - api_utils - ERROR - Failed to delete element NOT as expected:
	Status: 500
	Reason: Internal Server Error

2017-08-07 11:47:24,263 - MainThread - storagedomains - ERROR - Response code is not valid, expected is: [200, 202, 204], actual is: 500
Comment 1 Eyal Shenitzky 2017-12-07 07:21:49 EST
Hi Avihavi,

I failed to reproduce the bug according to the following steps:

1) Create 1 master NFS domain & 2 non-master ISCSI domains SD-A & SD-B  with 1 same connection to the storage server.
2) move one of the ISCSI SD (SD-A) to maintenance
3) Detach the connection from the SD-A when SD-B is active still use the same connection.

I checked 2 scenarios:

1. As you wrote above - the remove operation does succeed for storage domain SD-A as it should because the domain is in maintenance, but the storage connection doesn't remove from domain SD-B (as expected) so this is not a bug.

2. Try to remove the storage connection from SD-B while SD-A is in maintenance,
the following error received by the engine - 
<fault>
    <detail>[Cannot detach Storage Connection. The data domains sd-B should be in maintenance or unattached.]</detail>
    <reason>Operation Failed</reason>
</fault>

I used the following API command - 
DELETE ovirt-engine/api/storagedomains/<domain-id>/storageconnections/<connection-id>

Please close the bug in case the bug does not reproduce.
Comment 2 Avihai 2017-12-07 09:42:30 EST
Eyal,

The bug does reproduce but as you stated this is by design.

So this is the expected behavior:
"
As you wrote above - the remove operation does succeed for storage domain SD-A as it should because the domain is in maintenance, but the storage connection doesn't remove from domain SD-B (as expected) so this is not a bug.
"

If you are sure this is indeed the expected behavior, please close as NOTABUG & I will change the automation scenario.

Current automation code was that detach connection from storage domain SD-A (which is in maintenance) was expected to fail as its shares the same ISCSI connection with SD-B.
Comment 3 Eyal Shenitzky 2017-12-10 05:05:18 EST
After speaking f2f with Avihai we saw that this is a bug in the automation.
Close as NOTABUG.

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