Bug 1005284 - It is possible to change an iscsi storage connection and set an empty target
Summary: It is possible to change an iscsi storage connection and set an empty target
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 3.4.0
Assignee: Daniel Erez
QA Contact: Meital Bourvine
URL:
Whiteboard: storage
Depends On:
Blocks: rhev3.4beta 1142926
TreeView+ depends on / blocked
 
Reported: 2013-09-06 15:14 UTC by Katarzyna Jachim
Modified: 2016-02-10 17:19 UTC (History)
11 users (show)

Fixed In Version: ovirt-3.4.0-alpha1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
oVirt Team: Storage
Target Upstream Version:
amureini: Triaged+


Attachments (Terms of Use)
test logs (vdsm, engine, server etc.) (3.51 MB, application/x-bzip2)
2013-09-06 15:14 UTC, Katarzyna Jachim
no flags Details


Links
System ID Priority Status Summary Last Updated
oVirt gerrit 22880 None None None Never

Description Katarzyna Jachim 2013-09-06 15:14:35 UTC
Created attachment 794810 [details]
test logs (vdsm, engine, server etc.)

Description of problem:

If you try to add an iscsi storage connection via REST API with empty target, it will fail:

POST request:
<storage_connection>
   <address>10.34.63.202</address>
   <type>iscsi</type>
   <port>3260</port>
   <target></target>
</storage_connection>

response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<fault>
    <reason>Operation Failed</reason>
    <detail>[Target details cannot be empty.]</detail>
</fault>

However, if you create a connection with non-empty target, you can later change the target to empty:

PUT request:
<storage_connection>
   <address>10.34.63.202</address>
   <type>iscsi</type>
   <port>3260</port>
   <target></target>
</storage_connection>

response:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<storage_connection href="/api/storageconnections/28aeccb1-d72b-4742-bff2-4f9199463873" id="28aeccb1-d72b-4742-bff2-4f9199463873">
    <address>10.34.63.202</address>
    <type>iscsi</type>
    <port>3260</port>
    <target></target>
</storage_connection>


Version-Release number of selected component (if applicable): is13


How reproducible: 100%


Steps to Reproduce:
1. create an iscsi storage connection
2. try to change target to empty string

Actual results: it is possible to change an iscsi storage connection so that the target is empty


Expected results: the command should fail with the "Target details cannot be empty." error

Additional info:
Attached logs are from this execution: http://jenkins.qa.lab.tlv.redhat.com:8080/view/Storage/view/3.3/job/3.3-storage_storage_connections_iscsi-iscsi-rest/25/testReport/junit/storage_storage_connections.test_manage_storage_connections_iscsi/013-TestCase288986;test_changing_storage_connection_without_target/TestCase288986_test_changing_storage_connection_without_target/

2013-09-04 17:19:24,283 - MainThread - plmanagement.trace - INFO - art.rhevm_api.tests_lib.low_level.storageconnections._prepare_connection_object(kwargs={'lun_target': '', 'type': 'iscsi'})
2013-09-04 17:19:24,285 - MainThread - storageconnections - DEBUG - PUT request content is --  url:/api/storageconnections/c1a89e8c-b220-424b-8b0f-7133b5cc6040 body:<storage_connection>
    <type>iscsi</type>
    <target></target>
</storage_connection>
 
2013-09-04 17:19:24,625 - MainThread - core_api - DEBUG - Request response time: 0.260
2013-09-04 17:19:24,626 - MainThread - storageconnections - DEBUG - Response body for PUT request is: 
<storage_connection href="/api/storageconnections/c1a89e8c-b220-424b-8b0f-7133b5cc6040" id="c1a89e8c-b220-424b-8b0f-7133b5cc6040">
    <address>256.256.256.256</address>
    <type>iscsi</type>
    <port>3260</port>
    <target></target>
</storage_connection>

Comment 1 Sandro Bonazzola 2014-01-14 08:44:41 UTC
ovirt 3.4.0 alpha has been released

Comment 2 Meital Bourvine 2014-01-16 13:50:08 UTC
Verified on ovirt-3.4.0-alpha1:

request:
Method: PUT
URL: https://10.34.63.25/api/storageconnections/6147014f-e4b9-4a85-bb6d-d08d9a3faed6
Body:
<storage_connection>
<address>10.34.63.202</address>
<type>iscsi</type>
<port>3260</port>
<target></target>
</storage_connection>

Response:
<fault>
<reason>Operation Failed</reason>
<detail>[Target details cannot be empty.]</detail>
</fault>

Comment 3 Itamar Heim 2014-06-12 14:10:57 UTC
Closing as part of 3.4.0


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