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

Bug 1264777

Summary: [RFE] iscsi discover action returns only list of targets without the corresponding list of IP addresses
Product: [oVirt] ovirt-engine Reporter: Kobi Hakimi <khakimi>
Component: RestAPIAssignee: Ala Hino <ahino>
Status: CLOSED DUPLICATE QA Contact: Raz Tamir <ratamir>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.6.0CC: bugs, ishaby, khakimi, lsurette, rbalakri, Rhev-m-bugs, srevivo, tnisan, ykaul, ylavi
Target Milestone: ---Keywords: FutureFeature
Target Release: ---Flags: amureini: ovirt-future?
rule-engine: planning_ack?
amureini: devel_ack?
rule-engine: testing_ack?
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-31 05:10:31 UTC 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:
Attachments:
Description Flags
ISCSI Discover in GUI none

Description Kobi Hakimi 2015-09-21 08:10:14 UTC
Created attachment 1075416 [details]
ISCSI Discover in GUI

Description of problem:
iscsi discover action returns only list of targets without the corresponding list of IP addresses.
with this info we can't login to all targets only to the first target which is usually the IP of the storage server which we did discover with. and we want to do it automatically discover and login all.

Version-Release number of selected component (if applicable):
Red Hat Enterprise Virtualization Manager Version: 3.6.0-0.12.master.el6

How reproducible:
100%

Steps to Reproduce:
1. open rest client and run the following POST request.
2. URL like:
https://jenkins-vm-17.scl.lab.tlv.redhat.com/ovirt-engine/api/hosts/6979415b-e157-4ef7-a457-5dbd05dbe3a0/iscsidiscover
3. HEADERS: like:
Accept: application/xml
Content-Type: application/xml
4.
<action>
  <iscsi>
     <address>10.35.160.107</address>
  </iscsi>
</action>

Actual results:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
 <action>
<iscsi>
<address>10.35.160.107</address>
</iscsi>
<status>
<state>complete</state>
</status>
<iscsi_target>iqn.1992-04.com.emc:cx.ckm00121000438.b7</iscsi_target>
<iscsi_target>iqn.1992-04.com.emc:cx.ckm00121000438.b6</iscsi_target>
<iscsi_target>iqn.1992-04.com.emc:cx.ckm00121000438.a6</iscsi_target>
<iscsi_target>iqn.1992-04.com.emc:cx.ckm00121000438.a7</iscsi_target>
 </action>

Expected results:
to return also the corresponding IP address for each target as you can see in GUI when you click on discover(see attached snapshot iscsidiscoverGUI.png).


Additional info:
1. mlipchuk and me investigated it with REST API and we found out that the POST response has the IP addresses but we return only the targets without the addresses.
2. the solution should be for all API's(REST, SDK, CLI, JAVA)

Comment 1 Yaniv Kaul 2015-09-22 07:49:46 UTC
Kobi, why isn't this REF on oVirt?

Comment 2 Juan Hernández 2015-09-22 08:51:13 UTC
The discovered targets should be returned using a collection, and each element of the collection should return the relevant information:

  <action>
    ...
    <iscsi_targets>
      <iscsi_target>
        <name>iqn.1992-04.com.emc:cx.ckm00121000438.b7</name>
        <address>10.35.160.107</address>
        <port>3260</port>
      </iscsi_target>
      <iscsi_target>
        <name>iqn.1992-04.com.emc:cx.ckm00121000438.b6</name>
        <address>10.35.160.107</address>
        <port>3260</port>
      </iscsi_target>
      ...
    </iscsi_targets>
  </action>

The current returned data must be preserved in the 3.x branches for backwards compatibility, and should be removed in 4.0.

Alternatively we can implement a "/hosts/{host:id}/discoverediscsitargets" collection, returning the same kind of information. This is more restful, and it is what I prefer.

Comment 3 Kobi Hakimi 2015-09-24 06:32:38 UTC
is it needed to clone to ovirt?

Comment 4 Yaniv Lavi 2015-09-24 06:48:49 UTC
(In reply to Kobi Hakimi from comment #3)
> is it needed to clone to ovirt?

This should be moved to oVirt, not cloned.

Comment 5 Kobi Hakimi 2017-12-24 11:07:01 UTC
Do we have target release for it?

Comment 6 Yaniv Kaul 2017-12-24 11:08:48 UTC
(In reply to Kobi Hakimi from comment #5)
> Do we have target release for it?

No.

Comment 7 Tal Nisan 2018-05-27 13:18:58 UTC
Idan, can you have a look and assess how much work should be done here?

Comment 8 Idan Shaby 2018-05-31 05:10:31 UTC
It was already implemented by Ala in Bug 1510860.

Here's an example of how to use it:

POST http://<engine_url>/ovirt-engine/api/hosts/6c06b1b0-cb75-47f3-9512-cd24ce6894f2/iscsidiscover

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<action>
    <discovered_targets>
        <iscsi_details>
            <address>10.35.146.129</address>
            <port>3260</port>
            <portal>10.35.146.129:3260,1</portal>
            <target>iqn.2008-05.com.xtremio:xio00153500071-514f0c50023f6c00</target>
        </iscsi_details>
        <iscsi_details>
            <address>10.35.146.161</address>
            <port>3260</port>
            <portal>10.35.146.161:3260,1</portal>
            <target>iqn.2008-05.com.xtremio:xio00153500071-514f0c50023f6c01</target>
        </iscsi_details>
        <iscsi_details>
            <address>10.35.146.193</address>
            <port>3260</port>
            <portal>10.35.146.193:3260,1</portal>
            <target>iqn.2008-05.com.xtremio:xio00153500071-514f0c50023f6c04</target>
        </iscsi_details>
        <iscsi_details>
            <address>10.35.146.225</address>
            <port>3260</port>
            <portal>10.35.146.225:3260,1</portal>
            <target>iqn.2008-05.com.xtremio:xio00153500071-514f0c50023f6c05</target>
        </iscsi_details>
    </discovered_targets>
    <iscsi>
        <address>10.35.146.129</address>
    </iscsi>
    <iscsi_targets>
        <iscsi_target>iqn.2008-05.com.xtremio:xio00153500071-514f0c50023f6c00</iscsi_target>
        <iscsi_target>iqn.2008-05.com.xtremio:xio00153500071-514f0c50023f6c01</iscsi_target>
        <iscsi_target>iqn.2008-05.com.xtremio:xio00153500071-514f0c50023f6c04</iscsi_target>
        <iscsi_target>iqn.2008-05.com.xtremio:xio00153500071-514f0c50023f6c05</iscsi_target>
    </iscsi_targets>
    <status>complete</status>
</action>

*** This bug has been marked as a duplicate of bug 1510860 ***

Comment 9 Idan Shaby 2018-05-31 05:11:57 UTC
Forgot to mention an example of the request body:

<action>
  <iscsi>
     <address>10.35.146.129</address>
  </iscsi>
</action>